Apns-警报定制 [英] Apns-alert customization

查看:53
本文介绍了Apns-警报定制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在iphone应用程序中成功使用了APNS,但是仍然存在警报自定义的问题.下面是我的问题:

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

1我无法自定义警报"视图,如标题和按钮标题.我自定义警报,如:

1 I can't custom the Alert 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当我单击视图"时,显示了我的应用程序的启动视图,然后崩溃了.为什么?

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

因此,如果警报是由无法自定义的系统提供的,则查看操作也受系统控制.似乎在1和2之间存在矛盾.

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.

感谢您的帮助! 谢谢

推荐答案

我发现:如果您的应用程序无法启动,则无法自定义的iOS将提供apns-alert.

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

这篇关于Apns-警报定制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆