Monitoring intermittent MobileFirst application crashes - ibm-mobilefirst

How do I obtain more information, in addition to server logs and trace, on my application that crashes from time to time?

Application crashes can be tracked via the Analytics Console. By using Analytics SDK, the user setcontext api's to set the user in the application. That will ensure the application user data
and the crash captured (when the app starts next time to connect to the Mobilefirst server). This way one can capture the crash logs and analytics from the deviceId and user perspective.
More details:
https://www.ibm.com/support/knowledgecenter/en/SSHS8R_7.1.0/com.ibm.worklight.monitor.doc/monitor/c_op_analytics_data_capture.html#c_op_analytics_data_capture__manually_captured_data (see the [crash report] section)

Related

MobileFirst Analytics WL.Analytics.log in offline mode

We are using
WL.Analytics.log({"key" : 'value'});
to perform some analytics log in an iOS cordava app.
We are able to view the data using
http://localhost:9500/*/_search?q=module:%TestOldButtonPressedEvent%22%20AND%20timestamp:[2017-04-20%20TO%202017-04-20]
Question:
Yesterday, the mobileFirst and analytics was down for maintenance, user perform "TestOldButtonPressedEvent" using the iPad offline. (the app supports offline mode.
However, after the server is up today, there's no data in the elastic search result.
Does it means it doesn't keep the data in the iPad in offline mode and resend it to the analytics server once the server is up again?

IBM MobileFirst Analytics console not synchronize with operations console

I have a push notification issue with mobilefirst 7.1.
When the mobile device subscribes and receive the push notification message, i see the logged data in the operations console. But I don't see any data in the analytics console. Maybe it doesn't synchronize each other? But the device's data does exist. It only syncs with the device in operations console.
Unfortunately, we do not currently log push notification data in the analytics console. However, our dev team will be looking into it as we see this is an issue.

IBM Worklight Offline Support

we have an app which uses JSONStore to support offline, if device is offline and user submit data it stores it offline, now when device is online and when user login to the app it sync with server and submit all data to server.
the question is, Is it possible when device comes online then my offline data sync with server without user open my app ?
Does worklight support that? Or I have to do something else?
please advice
Like Idan said, Worklight does not support this, but depending on the OS, it could support it.
For instance, on Android, you could use BroadcastReceivers to detect changes in network connectivity, and execute an action when it happens, regardless of whether your app is closed or not.
Here is the API for the receiver: http://developer.android.com/reference/android/content/BroadcastReceiver.html and here is a SO answer explaining how to use it to detect WiFi connectivity: https://stackoverflow.com/a/22626736/2245921 So you can modify this BroadcastReceiver to run the sync code that you would normally do if your app was already open.
If you are using any other platform (iOS, Windows) there might be an equivalent that you can use.
Also, keep in mind that if you are doing a hybrid application, you can create your own Cordova plugin to execute native code from Javascript. Here is the documentation on how to do so: http://cordova.apache.org/docs/en/3.5.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide

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

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.

iOS Inter App Communication in Background

There is a platform application which connects to the remote server and stores required information in its local repository, that is in CoreData. I want to develop my application over this platform app. Since it is not possible to access its local storage, I have to communicate with it somehow. I am able to send/receive data using URL Schemes; however it's frustrating for user to switch between apps constantly.
Is it possible to communicate with another application via URL Schemes (or any other way) without bringing it to foreground?
With few exceptions, such as receiving CoreLocation data in the background or being notified to wake up by a local notification, it is not possible in iOS for an application to "run in the background"
This is a pretty common query on Stack Overflow, the official iOS reply can be found here
There are SO articles here and here.
Background data exchange is however not going to be a thing as there are restrictions on background app rules (so the URL transfer is going to foreground your second app)