首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >推送-通知

推送-通知
EN

Stack Overflow用户
提问于 2011-09-02 19:29:31
回答 2查看 1.5K关注 0票数 4

我使用http://stefan.hafeneger.name/download/PushMeBabySource.zip的服务器链接

我使用PushMeBaby服务器和推送应用程序和我的证书和配置文件,它在设备上以警报的形式给出通知,并在第一次运行应用程序时才在控制台上打印以方法编写的语句,但在下一次多次运行应用程序以测试它只返回设备令牌时,以下方法不能在all.Please上执行,这有助于我解决这个问题。

代码语言:javascript
复制
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {

    for (id key in userInfo) {
    NSLog(@”key: %@, value: %@”, key, [userInfo objectForKey:key]);

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”alert” message:key delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
    [alert show];

    /*if(key)
    {

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”alert” message:@”this is in application” delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
    [alert show];
    }*/

    }
}

请尽快帮助我

EN

回答 2

Stack Overflow用户

发布于 2011-09-02 19:31:35

您需要在每次启动应用程序时获取令牌。有时它会改变。

票数 3
EN

Stack Overflow用户

发布于 2011-09-02 20:21:07

代码语言:javascript
复制
The delegate (didReceiveRemoteNotification) gets invoked when a running application receives a remote notification.  

If you implement application:didFinishLaunchingWithOptions: to handle an incoming push notification that causes the launch of the application, this method (didReceiveRemoteNotification) is not invoked for that push notification.

有关推送通知的详细信息,请参阅:

developer apple-ApplePushService

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7282759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档