Exemple #1
0
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            Logger.Log("AppDelegate.RegisteredForRemoteNotifications");
            AppEvents.SetPushNotificationsDeviceToken(deviceToken);

            var token = deviceToken.Description;

            if (!string.IsNullOrWhiteSpace(token))
            {
                var deviceTokenValue = token.Trim('<').Trim('>').Replace(" ", "");
                Logger.Log("AppDelegate.RegisteredForRemoteNotifications: Token: {0}", deviceTokenValue);

                RemoteNotificationsService.Instance.SetTokenValue(deviceTokenValue);
                RemoteNotificationsService.Instance.FireRegisteredForNotifications(new RemoteNotificationsArgs(true, deviceTokenValue));
            }
        }