APNs notification does not trigger Worklight callback function in an iOS application

Technote (troubleshooting)


Problem(Abstract)

When an iOS application is running in the background and receives an APNs notification, the callback function registered with Worklight is not executed. In Worklight you have the option to register a callback function that executes after an notification is received by the application.  However, if this callback function uses graphical elements like an 'alert view' this can cause a race condition to occur because the application view is not yet loaded when it tries to execute.  The results is that the app crashes or freezes.  This only happens if the application happens to be running in the background when the notification is received. 

Resolving the problem

To work around this problem, use a WorkLight or Cordova API.  For example, instead of alert, use navigator.notification.alert API. 

This issue is resolved in fix pack 5.0.0.3.


Cross reference information
Segment Product Component Platform Version Edition
Mobile- Speech and Enterprise Access IBM Mobile Foundation Server Apple iOS 5.0 Consumer, Enterprise

Rate this page:

(0 users)Average rating

Document information


More support for:

IBM Worklight
Notifications

Software version:

5.0

Operating system(s):

Apple iOS

Software edition:

Consumer, Enterprise

Reference #:

1599907

Modified date:

2012-06-27

Translate my page

Machine Translation

Content navigation