Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read Google Maps Notifications via NotificationListenerService

Is it possible to read, Google Maps navigation notification which are shown periodically as the user moves?

For example the distance remaining from next turn is periodically updated. I tried using the NotificationListenerService for this but the notifications generated by Google Maps don't have any of that information when I try using the method getNotifications().getExtras().

Usually notifications published by messaging apps like Whatsapp have everything that one needs in the extras hashmap but Google map doesn't. Is there a possible workaround for this?

Thanks

like image 353
Mohit Yadav Avatar asked Nov 09 '22 01:11

Mohit Yadav


1 Answers

From Oreo: statusBarNotification.getNotification().getExtras() returns a Bundle with the navigation information.

Before Oreo: It's more tricky as the information is found inside the RemoteViews included in the notification.

like image 156
Xut Avatar answered Nov 15 '22 06:11

Xut