1

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?}
Cœur
  • 37,241
  • 25
  • 195
  • 267
apo mapo
  • 11
  • 1
  • 5
  • Do you mean bring your app to the foreground? If so then no, you can't do that. Only the user can by tapping your notification – Paulw11 Jul 14 '15 at 12:03

1 Answers1

0

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

Community
  • 1
  • 1
davidgyoung
  • 63,876
  • 14
  • 121
  • 204