开发者

Apns-alert customization

I have successfully used APNS in iphone app and still have a problem the alert customization.Below is my question:

1 I can't custom the Ale开发者_如何转开发rt view,like title and button title.I custom the alert like:


- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    NSDictionary *apsDic = [userInfo valueForKey:@"aps"];
    NSString *alertStr = [apsDic valueForKey:@"alert"];
    NSNumber *badgeNum = [apsDic valueForKey:@"badge"];
    NSString *soundStr = [apsDic valueForKey:@"sound"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[arr objectAtIndex:1]
                                                        message:msg
                                                       delegate:nil 
                                              cancelButtonTitle:@"OK" 
                                              otherButtonTitles:@"view",nil];
        [alert show];
        [alert release];
}

In my App, the title of the alert is my app's title;and the button titles are "Close" and "View".

2 when I click the "View", is shows the launch view of my app and then it crashes.Why?

So if the alert is provided by the system which can't be customized, the view action is also under control of system. It seems there's contradiction between 1 and 2.

Any help is appreciated! thanks


I find: if your app does not start, the apns-alert is provided by the iOS which you can't customize.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜