Led not working on Android using Unified Push Notification of worklight (6.0.0.2)

余生长醉 提交于 2019-12-25 06:26:01

问题


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.



来源:https://stackoverflow.com/questions/23831837/led-not-working-on-android-using-unified-push-notification-of-worklight-6-0-0-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!