Amazon SNS push notifications not handled when Xamarin.iOS app not running -
I am developing an iOS app in Xamarin, and received push notice through Amazon SNS from our existing back office. Need to. / P>
For that time I am using the Amazon web page to send test notifications through APNSSSand.
I have written my code and have created a certificate for the iOS app and everything is fine when the app is running, even if the app is in the background or not loaded at all, then by any iOS device Information is not received.
In Project Options in Zamadine Studios I have enabled the following background mode: Enable Background Mode, Background Background, Remote Notifications in General Settings for iOS Device, Background App Refresh Globally and Able to App has been done.
I think that I will miss a lot of either configuration or apple certificates, but I can not do it after reading various solutions from different iOS / Objective C and I have been able to find a solution. is.
Subscribe to Public Static Zero () (If (UIDevice.CurrentDevice) was a problem in my code to push notifications while running on iOS 8.0. SystemWarson [0] & gt; = '8') {UIApplication.SharedApplication.RegisterForRemoteNotifications ()} Other {UIRemoteNotificationType Notification Type = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound; UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (Information Type); }}
My new code:
subscribe to public static zeros () (if current device (uidice) systemversion [0] & gt; = '8') {UIUserNotificationType type = UIUserNotificationType.Badge | UIUserNotificationType.Sound | UIUserNotificationType.Alert; UIUserNotificationSettings settings = UIUserNotificationSettings.GetSettingsForTypes (type, null); UIApplication.SharedApplication.RegisterUserNotificationSettings (settings);} else {UIRemoteNotificationType Adisucnaprkar = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound; UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (Information Type);}}
This Dlav now allows to correctly notifications when the app is in the background or running.
Comments
Post a Comment