No vibration or pop-up
prabintim opened this issue · 5 comments
When I send a Push Notificaion from phone (API 24) to my LG Sports Wear (Wear 2.0), it does not vibrate or even show the small slide up notification. The user has no idea that a push notification is there. The same problem is also happening in my app.
The vibration works fine for apps like Gmail.
Here's my notification builder:
//Create android wear dismissal sync id
NotificationCompat.WearableExtender wearableExtender = new NotificationCompat.WearableExtender()
.setDismissalId(messageKey);
// Construct notification
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.extend(wearableExtender)
.setSmallIcon(R.drawable.statusbar_icon)
.setColor(ContextCompat.getColor(context, R.color.colorAccent))
.setContentTitle(contentTitle)
.setContentText(collapsedSummary)
.setAutoCancel(true)
.setLights(Color.BLUE, 100, 1900)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setDefaults(NotificationCompat.DEFAULT_SOUND | NotificationCompat.DEFAULT_VIBRATE)
.setCategory(Notification.CATEGORY_MESSAGE)
.setVisibility(Notification.VISIBILITY_PRIVATE);
Update 1:
The notification was silent because I had the following meta-data in wear manifest.
<meta-data
android:name="com.google.android.wearable.notificationBridgeMode"
android:value="NO_BRIDGING"/>
Update 2:
I also had to set .setDefaults(DEFAULT_ALL)
within the wear notification builder.
Just to clarify, this sample only includes NO_BRIDGING as a comment in the Wear Manifest (not as an element), so it should not impact your app unless you specifically uncommented it to disable bridged notifications when your Wear app is installed (common practice for devs using GCM to create Notifications). All that should be called out in the surrounding comments.
I am glad you solved the issue, but the code you pasted doesn't seem to be from the sample. I think this is more a general question about fixing your code? I am going to resolve this issue (reopen if that isn't the case).
You probably want to use stackoverflow.com for those type of issues. I hope that helps, thanks!
Just in case, I will also add setDefaults() in the next push this month so it includes vibrate for bridged notifications..
I will close when push is live.
This was pushed several weeks ago, thanks!