void CallPushAccepted(Notification.PushMessage pushMessage)
 {
     new Handler(ApplicationContext.MainLooper).Post(() =>
     {
         PushManager.Instance.OnPushAccepted(PushManager.NotificationFromNative(pushMessage), !IsAppOnForeground);
     });
 }
 bool CallPushReceived(Notification.PushMessage pushMessage)
 {
     new Handler(ApplicationContext.MainLooper).Post(() =>
     {
         PushManager.Instance.OnPushReceived(PushManager.NotificationFromNative(pushMessage), !IsAppOnForeground);
     });
     return(IsAppOnForeground && !PushManager.Instance.ShowPushNotificationAlerts);
 }
Пример #3
0
        public Task <RequestResult> MergeUserId(string oldUserId, string newUserId, bool doMerge)
        {
            var taskSource = new TaskCompletionSource <RequestResult>();

            nativeManager.MergeUserId(oldUserId, newUserId, doMerge, new PushManager.Callback()
            {
                ResultCallback = (Result result) => {
                    taskSource.SetResult(new RequestResult()
                    {
                        Error = PushManager.ErrorFromJavaException(result.Exception)
                    });
                }
            });
            return(taskSource.Task);
        }
Пример #4
0
        public Task <RequestResult> PostEventAsync(string anEvent, Dictionary <string, string> attributes)
        {
            var taskSource        = new TaskCompletionSource <RequestResult>();
            var tagsBundleBuilder = new Tags.TagsBundle.Builder();

            if (attributes != null)
            {
                foreach (var kv in attributes)
                {
                    tagsBundleBuilder.PutString(kv.Key, kv.Value);
                }
            }
            nativeManager.PostEvent(anEvent, tagsBundleBuilder.Build(), new PushManager.Callback()
            {
                ResultCallback = (Result result) => {
                    taskSource.SetResult(new RequestResult()
                    {
                        Error = PushManager.ErrorFromJavaException(result.Exception)
                    });
                }
            });

            return(taskSource.Task);
        }