简体   繁体   English

如何在后台启动iOS应用

[英]How to start an app iOS in background

I'm developing an app that listens the beacons, I want while app is in background and is near a beacon want the app opens. 我正在开发一个监听信标的应用程序,我想在应用程序处于后台且靠近信标的情况下打开该应用程序。 How can it be done? 如何做呢? I can put the moment of opening in one of these two methods: 我可以用以下两种方法之一来说明开放的时刻:

-(void)locationManager:(CLLocationManager *)manager 
   didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {
 //..........

} }

-(void)locationManager:(CLLocationManager *)manager 
       didEnterRegion:(CLRegion *)region {
     //.........

}

OS can wake the app up in the background, the app can post a local notification, but there is no way for it to become the frontmost app and wake up the device. 操作系统可以在后台唤醒应用程序,该应用程序可以发布本地通知,但是无法使其成为最前端的应用程序并唤醒设备。 Notification can play a sound though, so you have some way to get the user's attention. 通知可以播放声音,因此您可以通过某种方式吸引用户的注意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM