public void SendNotification(List <string> userIds, NotificationContent content, Action <NotificationsSummary> onSuccess, Action <GetSocialError> onError)
        {
            var rpcContent = content.ToRpcModel();

            LogRequest("sendNotification", string.Format("userIds: {0}, content: {1}", userIds.ToDebugString(), rpcContent));

            rpcContent.UserIds = userIds;

            WithHadesClient(client =>
            {
                var response = client.sendPushNotification(SessionId, rpcContent);
                Ui(() =>
                {
                    LogResponse("sendNotification", response);
                    onSuccess.SafeCall(response.FromRpcModel());
                });
            }, onError);
        }
        public static THCustomNotification ToRpcModel(this NotificationContent content)
        {
            var media = content._mediaAttachment;

            if (!media.IsSupported())
            {
                GetSocialLogs.W("Uploading Texture2D or video is not supported in Editor yet");
            }
            return(new THCustomNotification
            {
                Title = content._title,
                Text = content._text,
                TemplateName = content._templateName,
                TemplateData = content._templatePlaceholders,
                NewAction = content._action.ToRpcModel(),
                Image = media.GetImageUrl(),
                Video = media.GetVideoUrl(),
                ActionButtons = content._actionButtons.ConvertAll(button => button.ToRpcModel()),
                Badge = content._badge.ToRpcModel()
            });
        }
 public void SendNotification(List <string> userIds, NotificationContent content, Action <NotificationsSummary> onSuccess, Action <GetSocialError> onError)
 {
     DebugUtils.LogMethodCall(MethodBase.GetCurrentMethod(), userIds, content, onSuccess, onError);
 }
 /// <summary>
 /// Send notification to any GetSocial user. Also you can use placeholders in <see cref="SendNotificationPlaceholders"/>.
 /// </summary>
 /// <param name="content">Content of push notification.</param>
 /// <param name="target">List of user IDs or placeholders who will receive the notification.</param>
 /// <param name="success">Notifies if operation was successful.</param>
 /// <param name="failure">Called if operation failed.</param>
 public static void Send(NotificationContent content, SendNotificationTarget target, Action success, Action <GetSocialError> failure)
 {
     GetSocialFactory.Bridge.Send(content, target, success, failure);
 }
Exemple #5
0
 public void Send(NotificationContent content, SendNotificationTarget target, Action success, Action <GetSocialError> failure)
 {
     CallAsyncVoid("Notifications.send", GSJson.Serialize(new SendNotificationBody {
         Target = target, Content = content
     }), success, failure);
 }
Exemple #6
0
 public void SendNotification(List <string> userIds, NotificationContent content, Action <NotificationsSummary> onSuccess, Action <GetSocialError> onError)
 {
     _user.CallStatic("sendNotification", userIds.ToJavaList(), content.ToAjo(), new CallbackProxy <NotificationsSummary>(onSuccess, onError));
 }
Exemple #7
0
 public void SendNotification(List <string> userIds, NotificationContent content, Action <NotificationsSummary> onSuccess, Action <GetSocialError> onError)
 {
     _gs_sendNotification(GSJson.Serialize(userIds), content.ToJson(), Callbacks.SendNotification, onSuccess.GetPointer(),
                          Callbacks.FailureCallback, onError.GetPointer());
 }