I have kontakt.io beacon and I try to write application for background scanning with nearby API.
I use this method to subscribe messages:
SubscribeO
There are two ways to kill an app. If you find the app in Settings > Apps and press "Force Stop", or equivalently if you run adb shell am force-stop
, that kills the Nearby subscription too. But if you kill the app by swiping it away in the recents view, or by using adb shell kill
, the Nearby subscription should stay alive and wake your app with a PendingIntent.