WL push notification callback not being invoked in iOS when app is in background - ibm-mobilefirst

We have push notifications working successfully. Backend event source is a Worklight adapter written in JS using the 'WL.Server.createDefaultNotification' and 'WL.Server.notifyAllDevices' API calls to send unicast notifications. In the front-end, the app is registered for push notification call back using 'WL.Client.Push.registerEventSourceCallback' JS API.
These particular scenarios are not working:
App is open in the background after login. Notification message is received, but user does not tap notification banner message - and instead just opens app by touching app icon. Notification callback method is not called - and subsequently payload from the backend is not available for the method.
App is open in the background after login. Notification message is received which only has iOS badge change and payload but no notification message for the banner or lock screen. In which case user has nothing to tap on. When user opens the app again - notification callback is not called.
Knowledgecenter documentation seems to indicate that the callback method should be getting invoked even if the app is running in the background. This is with Worklight 6.2.0.1.

Push is indeed supposed to work as you've describe. This is a bug.
This is no manual workaround for this.
If you are an IBM customer or Business Partner you will need to open a PMR (support ticket).

Related

react-native-firebase - Open app from Headless JS Service / Open app from received notification in background mode

I read
How to handle notification when app in background in Firebase
Open app on firebase notification received (FCM)
But these aren't the solution for react-native-firebase.
I'm using react-native-firebase to handle notifications. In foreground, everything works well. I stuck with background state.
I'm working on a chat project and making 1-to-1 call feature. I push data-notification to clients when they have a call. In iOS, I used CallKit when client received notification, and it worked fine. But in Android I have a problem:
I can show ConnectionService UI for a call, but can't connect to my web socket server because it runs on Headless JS service. So I tried to auto open the app. I want to show a call screen as Skype, and accept/deny the call. (Skype can launch the app when I have a call)
Summary, successful steps:
Receive call notification in foreground state and show calling screen.
Receive call notification in background/closed state and show calling screen on iOS.
Receive call notification in background/closed state on Android.
Stuck here:
Show calling screen in background/closed on Android ???
TL;DR - How to launch/run/open Android app from Headless JS Service?
I dig into react-native-firebase, it catches the notification on onMessageReceived and send notification message to Headless JS Service.
// If the app is in the background we send it to the Headless JS Service
Intent headlessIntent = new Intent(
this.getApplicationContext(),
RNFirebaseBackgroundMessagingService.class
);
headlessIntent.putExtra("message", message);
this
.getApplicationContext()
.startService(headlessIntent);
HeadlessJsTaskService.acquireWakeLockNow(this.getApplicationContext());
Any help would be appreciated
This library is helpful to open app from background state.
React Native Launch Application
If your app is quit from background state
you've to register registerHeadlessTask in index.js like this
AppRegistry.registerHeadlessTask(
'ReactNativeFirebaseMessagingHeadlessTask',
() => notificationActionHandler,
);
and in notificationActionHandler function call libraries function to open app
If your app is in background you can subscribe this
messaging().setBackgroundMessageHandler(remoteMessage => {
console.log('setBackgroundMessageHandler', remoteMessage.data);
})

What could cause ti.cloud to stop display Android Push Notifications (GCM) in status bar

I previously setup an Appcelerator Titanium project with push notifications (as per my Stack Overflow question How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?) and for some months my Android app has been receiving the appropriate push notification from GCM, but I'm now receiving reports that this no longer works from end-users.
The flow usually goes like this...
Android app sends android push token to my Java server
Java server persists the Android push token
Java server sets up Amazon Web Service SNS endpoint for GCM and stores this endpoint for later use.
(some time passes)
Java server invokes Amazon Web Service SNS endpoint with a GCM payload
Amazon SNS passes message to Google GCM
GCM passes message to ti.cloud / ti.cloudpush
Phone displays push notification
The app does receive the push notification and I display an application dialog to show the contents of the message, but NO system-tray push notification is displayed, whereas I thought it was doing this in the past. No system sound is played either.
I can see that if the app is not running, then when the push notification is received the app is launched, but if the display isn't on (or locked) then the message will not be discovered for some time. I really need the native/system push notification to be in the tray.
Does anyone know why system / status notifications are not displayed? Should it be when using the ti.cloud / ti.cloudpush for Android?
Thanks
Rob.

should iOS Instant Messaging App server send APNS(new message) on foreground

I'm creating an instant messaging application. imagine something like skype or yahoo messenger.
Now our server only sends push notification(for new messages) on when the app is on background/multitasked/minimized. But sometimes the server fails to detect that our app is on background, so sometimes it doesn't send push notification even if the app is on background.
Now I'm thinking that our server should just always send push notifications to device even if it is in foreground(so all messages will have a push notif), but we won't show it(the apns) when in foreground. This way, the server won't need to detect if the app is on background or not.
Do you think it's okay, or there will be a sideeffect of always sending apns, you see, if you are chatting whole day on foreground, the client will receive apns but won't show it?
No problem to send lots of notification without reading it, if the payload is different.
You are not forced to show notifications with an alert when a notification is received in foreground.

Any other local or push Notification detection while application running

I want to know that is there any way that when my application keeps running. And device receive any type of local or push badge notification then my application will give a custom alert. That an application received a notification.
Your application can only respond to notifications meant for it... it can do nothing about notifications received by other apps...

Sending commands to iPhone app through Apple Push Notification Service

I am working on an iPhone application and I was wondering if I can send a command from my server to activate my application, at which point my app would contact the server with my payload.
You could send a notification to your app saying there are changes.
If the user decides to start of the app as a result of the notification, you could then check for the payload.
You can't automatically start the app with APS though.