push-notification
Detect if the app was launched/opened from a push notification
See This code : – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if ( application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground ) { //opened from a push notification when the app was on background } } same as -(void)application:(UIApplication *)application didReceiveLocalNotification (UILocalNotification *)notification
Silent pushes not delivered to the app on iOS 11
So the release notes of iOS 11.1 beta 1 say iOS 11.1 beta 1 was just released and they mention: “Notifications Resolved Issues • Silent push notifications are processed more frequently. (33278611) I did some tests and it seems to be indeed fixed: Suspended State When I launch the app in a suspended mode and … Read more
Push notification issue with iOS 10
For iOS 10 using xCode 8 GM. I have resolved my issue with following steps using xCode 8 GM for iOS 10: 1) In the targets, under Capabilities enable Push Notifications to add Push Notifications Entitlements. 2) Implement UserNotifications.framework into your app. Import UserNotifications.framework in your AppDelegate. #import <UserNotifications/UserNotifications.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate> @end … Read more
Does Android support near real time push notification?
Firebase Cloud Messaging FCM FAQ is the new version of GCM. It inherits GCM’s core infrastructure to deliver messages reliably on Android, iOS and Chrome. However they’ll continue to support GCM because lot of developers are using GCM SDKs today to handle notifications, and client app upgrade takes time. As of June 26, 2012, Google … Read more
Registering for Push Notifications in Xcode 8/Swift 3.0?
Import the UserNotifications framework and add the UNUserNotificationCenterDelegate in AppDelegate.swift Request user permission func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let center = UNUserNotificationCenter.current() center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in // Enable or disable features based on authorization. } application.registerForRemoteNotifications() return true } Getting device token func application(_ application: UIApplication, … Read more
Get push notification while App in foreground iOS
For displaying banner message while app is in foreground, use the following method. iOS 10, Swift 3/4 : // This method will be called when app received push notifications in foreground func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.alert, .badge, .sound]) } iOS 10, Swift 2.3 : @available(iOS … Read more