1
votes

I am working on an iOS and Android project, and using Worklight unified push notifications.

The push is now received, but I have the following behaviour:

  • in Android, every time I login, I receive an old push notification.
  • in iOS, After I open a push, it is not removed from the iOS notification bar. the badge also still there.

I have a doubt that this is related to onPoll option, in the event source, but when I add the following to my eventSource declaration:

 poll : { 
     interval : 3, 
     onPoll : gotNotificationFromBackEnd,
 },

I receive this error upon deployment:

Failed to deploy adapter from the database (archive:  '/var/folders/8p/qylwgy6j2wq4bktw4r5hxqvr0000gp/T/myAdapter5583128211713256219.adapter').

Any help, explanation?

1
In iOS, how do you open the app? Do you tap the notification or the application launch icon? If it's the latter, that would explain why the notification isn't cleared. And as for the bagde, are you clearing it programatically? If not, it would only be cleared if the notification has no badge or has a zero badge value.Eran
I open the notification by clicking on it, in the notification bar. otherwise, how to clear the notification badge programatically with worklight ?WiPhone

1 Answers

0
votes
  1. In order to control the Badge number that is displayed on top of the application icon in the Home screen, you can use the WL.Badge.setNumber API.

  2. For the adapter to properly deploy, put the function name in quotes.

  3. As for the not-disappearing notification entry in the Notification Center despite reading it, I view this as a defect and have opened a defect report. Thanks.

Edit: As of Worklight 5.0.6.1, the defect above (3) is fixed.


Note #1: I could reproduce (3) above only in iOS; In Android it works correctly.

Note #2: The sample application is missing the securityTest for the iPhone environment in application-descriptor.xml; for the login screen to appear upon application launch in iOS as well (as done in Android), correct this as I have suggested.