简体   繁体   English

如何在iOS中重新注册推送通知

[英]How to RERegister the Push notification in ios

I have problem in app version updates 我的应用程式版本更新有问题

[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[[UIApplication sharedApplication] registerForRemoteNotifications];

In my older version app I have called above method two times wrongly in didfinishedlaunch method, For that I have received the same notification twice. 在我的旧版本应用程序中,我在didfinishedlaunch方法中两次错误地调用了上述方法,为此,我两次收到了相同的通知。 So I have called that method one time only. 因此,我仅一次调用了该方法。 After that I have uploaded that new version into the app store. 之后,我将该新版本上传到应用商店。

My problem is When a user is newly installed my new version app, It will be good, I have received notification single time. 我的问题是,当用户新安装了我的新版本应用程序时,会很好,我已经收到一次通知。

But I have upgraded the older version to the new version, The above problem is repeated for me.Same Notification shows twice. 但是我已经将旧版本升级到新版本,以上问题对我来说是重复的。相同的通知显示两次。

I think you can delete the app and then reinstall it fresh and I think it will ask you about notifications again, of which will be your new code. 我认为您可以删除该应用程序,然后重新安装它,并且我会再次询问通知,其中将包含您的新代码。 If not then I guess it depends on your push notification service (eg Parse etc) where there maybe functionality to then delete a device from the list of registered devices for notifications etc. 如果不是,那么我想这取决于您的推送通知服务(例如Parse等),那里可能有功能然后从注册的设备列表中删除设备以进行通知等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM