iOS silent push notification only works when connected to xcode

旧城冷巷雨未停 提交于 2019-12-10 03:46:58

问题


I have an odd issue.

I recently updated my Xcode to 6.1.1 to make a change to an app I previously released with Xcode 5 (working great). Now for some reason with the new Xcode when I test my background silent push notification it only completely works when I have my iPhone connected to my Mac?

What the app does is when it gets a silent push the app retrieves data from a server. I added the default sound to the silent push for testing, and I've confirmed that the app does get the push but it does not connect to the server to get the new data. But if I plug in the lightning cable to my mac everything works great, gets data from server etc.

I'm not sure what to do? Any ideas or direction is greatly appreciated.

Thanks!


回答1:


I got no problem to send silent push to my app, even if the app is not connected to Xcode BUT you have to notice that silent push notification is being delivered only if your app is running in the background. If you force quit your app using double tap on iPhone home button, the notification is ignored.

It is probably an Apple rule to let user completely kill an app and stop any outgoing/incoming connection



来源:https://stackoverflow.com/questions/27582529/ios-silent-push-notification-only-works-when-connected-to-xcode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!