Is it possible to automatically start my application when device restarts? Can we use push notification to invoke the application when device restarts?
Asked
Active
Viewed 676 times
0
-
Somebody please reply – Bhagyashree Oct 23 '13 at 06:39
-
My app is not VOIP-enabled app – Bhagyashree Oct 23 '13 at 06:52
2 Answers
2
For your first question no it is not possible without JailBreak, you cannot open app without user interaction, although there is an exception for VOIP-enabled app.
more info: Can iPhone apps start on start-up?
For second question yes you can open app with push notification.
more info: Open app at specified page with Push Notification
Edit:
You can get the payload from launchOptions as below:
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSDictionary* payload = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (payload) {
// process the payload here
}
[window addSubview:viewController.view];
[window makeKeyAndVisible];
return YES;
}

Community
- 1
- 1

Tarek Hallak
- 18,422
- 7
- 59
- 68
-
can you explain more about how to set value to UIApplicationLaunchOptionsRemoteNotificationKey in launch options? Thanks. – Bhagyashree Oct 23 '13 at 07:29
0
Take a look at the UIBackgroundModes section in this document - it seems to state that adding the voip
key will autostart an app on boot.
Try this sample code
a sample app seems to confirm this behavior.

Siddh
- 712
- 4
- 21
-
This is for VOIP-enabled app, and please make sure to put reference to the Author. http://stackoverflow.com/a/9300992/1262634 – Tarek Hallak Oct 23 '13 at 06:48