如何让 iPhone 应用程序要求多次注册设备以接收推送通知 [英] how to make iPhone app asks to register device for push notification multiple times

查看:24
本文介绍了如何让 iPhone 应用程序要求多次注册设备以接收推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码注册了我的应用程序以接收推送通知,但我收到了要求我注册推送通知的警报,但我不小心按下了取消.现在我想再次收到警报,以便我可以触发委托方法以获取设备令牌.但是我不再收到此警报,每次打开设置时,我发现应用程序的通知已关闭.我试图从设备上删除应用程序,更改应用程序版本,删除测试配置文件,即使我重置了所有 iPhone 设置也清理了目标,但仍然无法解决这个问题.我将非常感谢任何帮助,谢谢

I have used the following code to register my app to receive push notification, and I got the alert that asks me to register for push notification and I accidentally press cancel. Now I want to have the alert again so I can fire the delegate method in order to get the device token. But I don't get this alert any more and every time I open the settings I found that the notification is turned off for the app. I tried to delete the app from device, change app version, delete testing profile ,clean the target even I reset all the iPhone settings, but still was not able to solve this.I would very much appreciate any help, thanks

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

推荐答案

设置中有一个通知选项.检查您的应用程序并从那里打开通知.

Theres a notification option in the settings. Check out your application and turn on the notification from there.

我在某处了解到 iOs 4 有这个错误,即使您删除并重新安装应用程序,它也不会再次询问.

I have learned somewhere that iOs 4 has this bug that it wont ask again even if youremove and reinstall the application.

试试设置->通知->您的应用->开启.

Try Settings->Notifications-> your app-> Turn it on.

希望有帮助.谢谢

这篇关于如何让 iPhone 应用程序要求多次注册设备以接收推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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