1

I have a requirement from client with two points 1. First a notification will generate after two minutes. 2. On click on icon in application list, nothing should happen.

First point I have done, but don't have any clue of how to implement the second point.

Please advise if any have about how to create app with no UI but only a background notification and nothing should happen on clicking on the icon.

Maneesh
  • 6,098
  • 5
  • 36
  • 55

3 Answers3

5

Sorry, but what you're after is not possible on the iPhone. The primary class that represents your application is called UIApplication for a reason. It is part of UIKit.

It sounds as if your client is an Android user, because Android provides this ability via its Service class. But nothing of the sort exists for iOS. Your challenge is now in dealing with your client, not in dealing with software!

QED
  • 9,803
  • 7
  • 50
  • 87
2

Can't be done in for any official Appstore apps.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
1

You could try putting exit(0); at the end of applicationDidFinishLaunching:withOptions: but this will surely get your app rejected.

If you do this you also have to schedule your notification in the same method. Lke:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

  //do your stuff

  exit(0);    //this line kills the app
  return NO;  //this line is just to make compiler happy
}

See also How send application to background when install on device?, it was asked today.

Community
  • 1
  • 1
Rok Jarc
  • 18,765
  • 9
  • 69
  • 124