IBM Worklight - push notifications from standalone server take longer to arrive compared to development server - ibm-mobilefirst

I'm using Worklight 6.1 on Liberty profile 8.5.5 in Windows XP in a VMWare in a Mac.
I have an Android app that receives notifications. I'm using an adapter to send the notifications.
It is my own app but the adapter is the same as in the push notifications sample project provided by IBM.
For sending the notification I'm directly calling the adapter from a browser using the REST call (protocol://server:port/app/[dev/]invoke?adapter=myAdapter&procedure...)
When I execute the application in the development server the notifications arrives almost immediately, but when I test the application in the test server (mentioned above) the notifications takes a lot of time to arrive, if they arrive.
However, when the notification does arrive, the next notifications arrives in seconds.
It is something I have experienced in the past also with previous Worklight versions.
I do not know what is the difference between the servers or if the problem is related to the server.
Any hints for debugging this?

I have enabled the trace:
<logging traceSpecification="*=audit=enabled:com.worklight.integration.notification.*=finest=enabled" />
I can see the trace:
com.worklight.integration.notification.gcm.GCMSender 1 sendNoRetry Sending JSON to GCM server: {"collapse_key":"myPush","data":{"alert":"Hay una nueva ficha","payload":"{\n \"alias\": \"myPush\",\n \"identificador\": \"a035\",\n \"nombre\": \"aName35\"\n}","badge":"1"},"registration_ids":["APA91bG03cXkyVM6pA2-CO1g-tZUQL6FwJgugaa68YngIyGbbR_oDzVNn-1RULpoktvMUKwF3D1qK4bx-4OVeAbUzBqNpqO3m_1hwz0Z6I0B_DS_Jvc0wzI_fjKpJ9vqPNO58Bdt40ms"]} [project DemoM]
But I do not know if that trace means that everything has gone ok and the message is now in the GCM servers.
I have also enabled sniffers (WireShark in Mac and SmartSniff in XP) in dev server and stand alone server but I have not been able to detect any pattern. Everything is under https so I only see some traces for google hosts but I can not take any conclusions. Although it is valid to see a trace for google gcm immediately after the server trace that takes less than 500ms
Anyway now it is taking time to the notification to arrive in both servers so I guess everything is working fine in the worklight side.

Related

How to trouble-shoot issue where Expo push notifications not delivered for some devices

Our app uses Expo push notification to deliver push messages. It works just fine for most clients, but I am trying to debug one client where he is not receiving the push messages. Here is what I am seeing:
Using Expo push notification tool as well as my own client code, I
can send messages to his Expo push token. Expo server responds with
ok status. I checked the status given the receipt id and the status
also says ok.
But the client never receives the messages. I ensure
that the app is not already opened on his iOS device and that
notification is enabled for the app.
My question is: how do I debug this further? I understand that Apple server might decide to send or not to send messages based on various factors. How do I find out what Apple server did with the messages?
I have googled quite a bit but I couldn’t find much info on how to proceed. I hope that someone has experienced the same, and can help with some leads.
Thanks for your help,
Huey

How does apps like Whatsapp or telegram listen to the incoming call/message events on Android?

I built a VoIP calling app which maintains a persistent connection with the server to listen to any incoming calls. I implemented a background service to do this.
But since Oreo, this running code is now broken because of the introduction of Background Execution Limits
After looking into forums, I found that some people are suggesting
Convert Service to JobService and let android schedule it
Doing so, my app won't be able to receive calls when it is stopped
Run your operations in foreground services
It is annoying for some users to see a constant notification in the notification bar. So these above-mentioned options aren't working for me to fix my code for Oreo.
How does WhatsApp get the incoming (VOIP) call in Android (Oreo onwards) working around the Background Execution Limits?
(Sticky) foreground services are not affected by the restrictions. So you could use one those as replacement for background services on Oreo.
But foreground services have two disadvantages: They are less likely killed by the system in order to reclaim resources compared to background services, and hence affects the Android system's self-healing capability. And they require you to display a permanent notification. But Users are able to suppress the notification, somewhat mitigating this disadvantage.
I am assuming that you are using SIP to establish the connection and initiate calls. Without a service constantly re-sending REGISTERs, the app doesn't receive INVITEs when the server sends them.
A workaround for this problem is what is called the "push notification strategy". It works as follows, when the server sends a INVITE, it also sends an FCM notification to your app, This wakes up your app which then sends a REGISTER to your server, which in return forks the call to your app. Here is a video that better explains this strategy
There are two options:
use platform push services (APNS or FCM)
maintain persistent socket connection and exclude application from battery optimisations.

MobieFirst v7.1 Application Center not sending push notifications to devices

We are implementing the GCM Push notification for app updates on AppCenter Client app
We have setup the following values in the server configuration
jndiName="ibm.appcenter.gcm.signature.googleapikey value="***"
jndiName="ibm.appcenter.push.schedule.period.unit" value="seconds"
jndiName="ibm.appcenter.push.schedule.period.amount" value="40"
And our app is still not receiving push notifications from GCM,
is there anything additional in the AppCenter Client to modify to enable this feature?
we have already set the config.json file gcmProject attribute with the GCM project number and rebuilt the apk accordingly.
the logs don't show any exceptions and no registered devices are available for push notification update
This type of question does not fit StackOverflow, which is meant for programming-related questions. Please open an IBM PMR (support ticket) to address this kind of server configuration question.

Push notification does not work on mobilefirst platform 7.1 server

We have develop a cross platform app with mobilefirst studio 7.0 and test it on production environment.
It was fine before we upgrade our project with mobilefirst studio 7.1.0.00-201510120-1525 and test it on clean staging server (7.1.0.0 20151012-1525).
It seems that the push notification functionality dedicated on mobilefirst 7.0 did not work properly on production server of mobilefirst platform version 7.1. The source code and configuration file of our mobilefirst push notifcation adapter and configuration files are here.
Inorder to fix the issue, we refer to official push notification tutorial which was documented here.
Surprisingly, although the source project in official tutorial looks fine on development server, it still not work on production server either.
We have test this project using iphone5s with ios 8.4 and HTC 816h phone with android 4.4.2, both of them fail to register push notification service after we login to the HybridEventSource sample application and tap the “Subscribe Notification” button.
The Mobilefirst server logs down internal server error message during the registration process of client devices.
I am wondering how to let the push notification mechanism work again on mobilefirst 7.1?
Either a valid push notification sample code of mobilefirst 7.1 or any fix pack which we do not know is welcomed.
Since we did not authenticate users via mobilefirst server, and devices were connected through vpn to server,
we prefer to have a solution which does not depends on particular mobilefirst server side authentication mechanism.
The server log message generated during this test is in this file.
The log file generated while we run EventSourceNotification app as xcode project is in this file.
For detail system log from ios device, please refer to device log file
And the Log message generated by HTC 816h android 4.4.2 phone is here
Information about our server environment:
Operating system : centos 5.8 linux
Java development kit : Oracle jdk 1.8 update 65 x86-64
Application server : Apache tomcat server 7.0.63
Worklight environment database : oracle database 11g.
Apple push notification service certificate : sandbox version
Well that's kinda suspicious, isn't it?
Since we did not authenticate users via mobilefirst server, and devices were connected through vpn to server, we prefer to have a solution which does not depends on particular mobilefirst server side authentication mechanism.
You are using the push mechanism provided by MFPF but you do not want to go through MFPF? You are required to go through MFPF if you want to use the push mechanism provided by MFPF... What did you mean by the above?
That said, did your DBA examine mf7-1-EventSourceNotifications-catalina.out.log? There are quite a few Oracle-related exceptions there that you should look at.
If you are still unable to resolve it I suggest to open a PMR instead so that the development team will be able to further investigate.

How send a push notification without installation?

My question is as follows:
I have a database on another server with the appropriate records of the devices.
I can send a notification by REST API without necessarily making an installation registry?
Something like:
"Send notification to the following devices:
- id1
- id2
- Id3 "
My idea is to continue to use my other server without getting spending requests or hosting Parse. Only use the push notifications service.
Is it possible?
Not sure what types of devices you are referring to (iOS? Android? Windows Phone?), but push notifications to mobile devices always require an application to be installed on the target device, since the notification is sent to a specific application on a specific device.
And the only way you can get a device ID (which you can use to send push notification to a device) is by having an application on the device send that ID to your server after obtaining it from the relevant push notifications service (APNS for iOS, GCM for Android, etc...).