Search code examples
iospush-notificationibm-mobilefirst

Hybrid event push-notification for IOS seems like not yet handled on mobilefirst 7.1


Trying to handle notification on an hybrid application. The notification arrives on device (can see it in logs and on device when application closed) but there's no way to handle it by that code:

WL.Client.Push.registerEventSourceCallback(
    "myPush",
    "PushAdapter",
    "PushEventSource",
    function (props, payload) {
        console.log("received notification - in notifications.js")
        alert("moo");
    }
);
console.log("registered event source");

When watching mfp plugin, seems like iOS part missing, how can i handle that notification anyway?


Solution

  • From what I am understanding, you are saying the issue is that the push notification arrives on device only when app is in background, but when app is in foreground app will not be pushed. And this is only happening for iOS?

    Try using this sample to do a simple push in an MFP Cordova application and see if you are still experiencing the same issue. https://github.com/csantanapr/mfp-push-template

    Should be pretty simple to setup for iOS. Need to get p12 file, configure XCode to sign with correct profile, set p12 password in app descriptor, set app id in push adapter.

    Helpful guide that you've probably used: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/notifications/push-notifications-overview/push-notifications-in-hybrid-applications/