开发者

local Notification + run specific function

I want to do specific job when app notify mean开发者_运维技巧s instead of show alert run specific function

is it possible ?


In a word: No. Local notifications are intended to alert the user at a specific time. They only way to run code in your application based on a notification is if the user interacts with the notification in such a way that starts your app, usually by clicking the action (or "view") button.

More details can be found under "Handling Local and Remote Notifications" in the Local and Push Notification Programming Guide.


From iOS 4.0

You can handle a local notification like handling push notification.

When the app is launching by tapping the local notification alert view (naturally the app should be ended before).

In the following method,

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

please do the following code

NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
NSLog("%@", dictionary);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜