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

查看:17
本文介绍了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.

感谢任何帮助!谢谢

推荐答案

我发现:如果你的应用没有启动,你无法自定义的 apns-alert 是由 iOS 提供的.

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天全站免登陆