Android Wear: Listen to incoming notifications

后端 未结 2 1137
粉色の甜心
粉色の甜心 2021-01-22 21:42

Is it possible to listen for incoming notifications in an Wearable Android App? I have tried to implement a NotificationListenerService, but the service\'s onNotifi

相关标签:
2条回答
  • 2021-01-22 21:45

    Try this:

    adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:$YOUR_PACKAGE/$YOUR_PACKAGE.$YOUR_NOTIFICATION_LISTENER

    0 讨论(0)
  • 2021-01-22 21:50

    It's not possible to use a NotificationListenerService in Android Wear as there is no screen for the user to allow this. You have to do it in the device's app and to use the Wearable Data Layer API to perform the action on Wear's side.

    0 讨论(0)
提交回复
热议问题