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); }
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); }
public override void ReceivedPushNotification(MSPush push, MSPushNotification pushNotification) { OnPushNotificationReceivedAction?.Invoke(pushNotification); }
public static bool DidReceiveRemoteNotification(NSDictionary userInfo) { return(MSPush.DidReceiveRemoteNotification(userInfo)); }
/// <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); }
/// <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); }
static Task PlatformSetEnabledAsync(bool enabled) { MSPush.SetEnabled(enabled); return(Task.FromResult(default(object))); }
static Task <bool> PlatformIsEnabledAsync() { return(Task.FromResult(MSPush.IsEnabled())); }