Led not working on Android using Unified Push Noti

2019-09-06 17:53发布

问题:

I'm using the UPN system of Worklight Consumer Edition 6.0.0.2 to send push notifications.

When I receive a push notification no led light appears on Android. Why? I tried on:

  • a Samsung S4 with Android 4.3;
  • a Nexus 5 with Android 4.4;
  • a Samsung S3 mini with Android 4.1.2 .

I use WL.Server.createDefaultNotification to build the notification payload:

var notificationObj = WL.Server.createDefaultNotification(notification.TITLE, badge,{});
notificationObj.GCM.sound="default";

and then I use notifyAllDevices to push:

WL.Server.notifyAllDevices(userSubscription, notificationObj);

I have the app closed and the screen is switched off. The result is: I receive the push notification successfully and a sound is played, but no led at all.

回答1:

The Notification priority API as provided by Android to allow for pulsing the notification LED (starting Android 4.1 "Jelly Bean" and above), is not available in Worklight.

If you'd like Worklight product designers to evaluate adding it to a future release, consider submitting a feature request.

AFAIK there is no way for a developer to extend support for this API in the application code, so there is no workaround.