简体   繁体   中英

How can wake up(or start) my app from background(not running)? ios - ibeacon - iphone

Important: IOS support wake(start) apps when apps not running.

I build a ibeacon app. This is work good . When app is not runnig IOS wake up my app and my app give notification. when app is not runnig, ios run this function (in background) is working

func locationManager(manager: CLLocationManager!, didEnterRegion region: CLRegion!) {


    var localNotification:UILocalNotification = UILocalNotification()
    localNotification.alertAction = "iBeacon notification."
    localNotification.alertBody = "Detect a signal."
    UIApplication.sharedApplication().scheduleLocalNotification(localNotification)

}

I wanna write a code as "start my app" in this code block ? Like

app.start() or  app.wakeup()

Is it possible?

if(answer == yes){how can i do?}

Unfortunately, this is not possible on iOS. The operating system has restrictions that prevent an app from bringing itself to the foreground unless a user explicitly gestures for it to do so.

For a demonstration of how this does not work, and the alternatives, please see my similar answer here:

https://stackoverflow.com/a/22230693/1461050

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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