iOS版:如何推送通知注册? [英] iOS: how to register for push notifications?

查看:129
本文介绍了iOS版:如何推送通知注册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现推送通知我的iOS 5应用程序由雷Wenderlich指南:<一href=\"http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12\">http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12.

I'm trying to implement Push Notifications for my iOS 5 application by the guide from Ray Wenderlich: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12.

我已经插入以下到我的AppDelegate我的 didFinishLaunchingWithOptions 方法:

I've inserted the following into my didFinishLaunchingWithOptions method in my AppDelegate:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
    (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

当我运行设备上的应用程序(而不是仿真器)不显示弹出/警报,告诉我接受推送通知。我插就行了调试点,我可以看到,该 registerForRemoteNotificationTypes 被调用。

When running the application on my device (not simulator) the popup/alert telling me to accept push notifications isn't displayed. I've inserted a debug-point on the line, and I can see, that the registerForRemoteNotificationTypes is called.

为什么没有任何反应?

推荐答案

也许,删除你的应用程序,然后再试一次。该对话框只出现一次。但我不知道这是否当你重新安装应用程序,对话框将再次出现。

Maybe, delete your app and try again. That dialog only appears once. But I'm not sure that whether that dialog will appear again when you reinstall that app.

您也可以到您的设置应用程序中的通知中心,看看如果你的应用程序是在列表中。

You can also go to your setting app the notification center, see if your app is on the list.

您还可以添加一个破发点,看看是否didRegisterForRemoteNotificationsWithDeviceToken执行。

You can also add a break point and see if didRegisterForRemoteNotificationsWithDeviceToken executes.

这篇关于iOS版:如何推送通知注册?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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