Google nearby API background scan doesn´t work after application kill

后端 未结 2 791
独厮守ぢ
独厮守ぢ 2021-01-06 02:59

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         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-06 03:22

    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.

提交回复
热议问题