等待期之前iPhone的APN开始推? [英] Waiting Period Before iPhone APNs Starts Pushing?

查看:113
本文介绍了等待期之前iPhone的APN开始推?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的两个测试运行的应用程序推送通知。第一个测试程序,我的工作得到了在2天的时间。第二测试应用程序我试图实现推送通知,今晚并已撞我的头了它。我能够交换证书和第一应用程序接收通知,但是当我使用的质子交换膜的第二应用程序,没有任何反应。

我在整个过程中走了两次,今晚,试图获得推到这个第二应用工作。我唯一​​的结论,因为我可以交换.pems,它会为第1的应用程序的工作,就是什么是错的第二个质子交换膜或者有一个等待期推开始工作之前,我只是没我第一次安装过程中实现呢?

编辑:的问题是,我是用

   - (BOOL)应用中:didFinishLaunchingWithOptions:

在我的委托,而不是使用

   - (空)的applicationDidFinishLaunching:

我在做什么...

   - (BOOL)应用:(*的UIApplication)的应用didFinishLaunchingWithOptions:(NSDictionary的*)launchOptions {    //注册推送通知
    UIRemoteNotificationType notifyTypes =(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge);}

当我应该做的事情。

   - (空)的applicationDidFinishLaunching:(UIApplication的*){应用
    // * NSUserDefaults的standardUserDefaults = [NSUserDefaults的standardUserDefaults]
    //注册推送通知
    UIRemoteNotificationType notifyTypes =(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge);
}


解决方案

有是推开始工作,但在我的经验说,期限一般很短前的等待时间。确保小点是绿色在配置门户应用ID网页 - 并确保它是正确的应用程序ID和环境(例如,如果你在调试运行,请确保它被配置为开发)。

除此之外,也可能是您的质子交换膜或配置的个人资料以及一个问题。

从苹果推送的参考指南:


  

您必须修改一些轻微的方式配置文件(例如,切换一个选项)为门户以产生一个新的供应信息。如果配置文件不那么脏,提供给您的原资料,而不需要推的权利。


你有任何错误来了,当你试图推?

I am running Push Notification on two test apps. The first test app I got working over a 2 day period. The 2nd test app I tried to implement Push Notification tonight and have been banging my head over it. I am able to swap the certificates and the 1st app receives notifications, but when I use the .pem for the 2nd app, nothing happens.

I have gone through the entire process twice tonight, trying to get the Push to work for this 2nd app. My only conclusion, given that I can swap the .pems and it will work for the 1st app, is that something is wrong with the 2nd .pem or maybe there is a waiting period before the push starts working, and I just didn't realize it during my first setup?

Edit: The problem was that I was using

-(BOOL)application: didFinishLaunchingWithOptions:

in my delegate and not using

-(void)applicationDidFinishLaunching:

I was doing...

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

    // Register for Push Notifications
    UIRemoteNotificationType notifyTypes = (UIRemoteNotificationTypeAlert |     UIRemoteNotificationTypeSound | UIRemoteNotificationTypeBadge);

}

When I should have been doing

-(void)applicationDidFinishLaunching:(UIApplication *)application {
    //NSUserDefaults *standardUserDefaults = [NSUserDefaults standardUserDefaults];


    // Register for Push Notifications
    UIRemoteNotificationType notifyTypes = (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeBadge);
}

解决方案

There is a waiting period before Push starts working, though in my experience said period is generally quite short. Make sure that the little dot is green in your App ID page of the provisioning portal - and make sure that it is for the correct App ID and environment (for example, if you're running in debug, make sure that it is configured for development).

Apart from that, it could be an issue with your .pem or provisioning profile as well.

From the Apple Push Reference guide:

You have to modify the profile in some minor way (for example, toggle an option) for the portal to generate a new provisioning profile. If the profile isn't so "dirtied," you're given the original profile without the push entitlements.

Do you have any errors coming up when you attempt to push?

这篇关于等待期之前iPhone的APN开始推?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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