push-notificationibm-mobilefirst

Value of "WL.Client.Push" is coming as undefined


I am getting the value for WL.Client.Push as undefined when launching the application. Hence, the below is coming as false.

if(WL.Client.Push)

And that's the reason my push is not getting registered.

Please advise how can I define WL.Client.Push.


Solution

  • This normally happens when you try to use WL.Client.* APIs before the SDK initialization has been completed.

    The right point to start using the WL.Client APIs is after the flow has entered the wlCommonInit() method.

    Do note that IBM MobileFoundation 7.x is out of support, and you should move to MobileFoundation 8.0.

    You can use MFPPush object to invoke Push APIs.

    Documentation here.

    A working sample can be found here.