Пример #1
0
 static Push()
 {
     _pushDelegate.OnPushNotificationReceivedAction = notification =>
     {
         var pushEventArgs = new PushNotificationReceivedEventArgs
         {
             Title      = notification.Title,
             Message    = notification.Message,
             CustomData = notification.CustomData?.ToDictionary(i => i.Key.ToString(), i => i.Value.ToString())
         };
         PushNotificationReceived?.Invoke(null, pushEventArgs);
     };
     MSPush.SetDelegate(_pushDelegate);
 }
Пример #2
0
 static Push()
 {
     _pushDelegate.OnPushNotificationReceivedAction = notification =>
     {
         var pushEventArgs = new PushNotificationReceivedEventArgs
         {
             Title      = notification.Title,
             Message    = notification.Message,
             CustomData = NSDictionaryToDotNet(notification.CustomData)
         };
         PushNotificationReceived?.Invoke(null, pushEventArgs);
     };
     MSPush.SetDelegate(_pushDelegate);
 }
Пример #3
0
 public override void ReceivedPushNotification(MSPush push, MSPushNotification pushNotification)
 {
     OnPushNotificationReceivedAction?.Invoke(pushNotification);
 }
Пример #4
0
 public static bool DidReceiveRemoteNotification(NSDictionary userInfo)
 {
     return(MSPush.DidReceiveRemoteNotification(userInfo));
 }
Пример #5
0
 /// <summary>
 /// Call this from the corresponding method override in your AppDelegate.
 /// </summary>
 /// <param name="error">Associated error.</param>
 public static void FailedToRegisterForRemoteNotifications(NSError error)
 {
     MSPush.DidFailToRegisterForRemoteNotificationsWithError(error);
 }
Пример #6
0
 /// <summary>
 /// Call this from the corresponding method override in your AppDelegate.
 /// </summary>
 /// <param name="deviceToken">Device token.</param>
 public static void RegisteredForRemoteNotifications(NSData deviceToken)
 {
     MSPush.DidRegisterForRemoteNotificationsWithDeviceToken(deviceToken);
 }
Пример #7
0
 static Task PlatformSetEnabledAsync(bool enabled)
 {
     MSPush.SetEnabled(enabled);
     return(Task.FromResult(default(object)));
 }
Пример #8
0
 static Task <bool> PlatformIsEnabledAsync()
 {
     return(Task.FromResult(MSPush.IsEnabled()));
 }