Posts

Post not yet marked as solved
0 Replies
1.2k Views
Hi there,I had setup a chat module in my app using PubNub service not PubNub Chat Engine. Every thing is working fine, until push notifications come up. This app has Android version also (not built by me). I was able to receive a fully functional Apple Push Notification using payload1 mentioned bellow. But it only works for iOS devices in term of Notifications, no Notifications for Android device which has GCM added for Notification.So i did some RND and Found this link https://support.pubnub.com/support/discussions/topics/14000006344and used Payload2 mentioned bellow. Using this both platforms get notifications. But now in iOS Notification comes on both foreground and background app state. but all of the bellow mentioned methods does not call, the only method is now calling is willPresent in foreground. I want to know why is that. Is is some thing Wrong with Payload or Tag or what ? Kindly help me out struggling for a week for this. Thanks in advance.payload1 = [ "aps" : [ "alert" : [ "title" : self.loginUserProfile.firstName, "body" : message], "pn_exceptions" : [ tokenString ], "content-available": 1, "sound" : "marco_alert.aiff", "publisher" : self.loginUserProfile.userId, "date" : Date().dateString()] ] as [String : Any]payload2 = [ "pn_apns": [ "date": Date().dateString(), "aps": [ "sound": "marco_alert.aiff", "alert": [ "title": self.loginUserProfile.firstName, "body": message ], ], "pn_exceptions": [tokenString], "publisher": self.loginUserProfile.userId, "content-available": 0 ], "pn_gcm": [ "data": messageString ]] as [String : Any]Functions that are not hitting when recived a background Notification:func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)&func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any])&func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)```i need my app to hitt any of these when in Background because my logic is dependent over here. Thanks
Posted
by aasn.
Last updated
.