点击推送通知时 PhoneGap iPhone 应用程序崩溃
Xcode 4.2,使用PhoneGap模板,Urban Airship库。
Xcode 编译我的应用程序并将其安装在我的 iPhone 上,我可以从 Urban Airship Web 界面向它发送推送通知。
所以这是我的问题:如果我在应用程序在后台打开时点击通知,该应用程序就会进入前台。但是,如果当我点击通知时应用程序尚未在后台运行,应用程序介绍屏幕会短暂出现,并且应用程序会立即崩溃。
此时,该应用程序现在处于后台,我可以打开它并操作它。
我希望也许其他人也经历过这个问题,或者至少能够识别出这些症状,并且知道我可以采取什么措施来解决它。
Xcode 4.2, using PhoneGap template, Urban Airship library.
Xcode compiles my application and installs it on my iPhone, and I can send push notifications to it from the Urban Airship Web interface.
So here’s my problem: If I tap on a notification while the app is open in the background, the app comes into the foreground. However, if the app is not already in the background when I tap a notification, the app intro screen briefly appears, and the app immediately crashes.
At this point, the app is now in the background, and I can open it and operate it.
I have downloaded and installed the Library and Sample App from http://urbanairship.com/docs/apns_test_client.html and have gotten it to work correctly on my iPhone: I can receive notifications from Urban Airship, and the app opens when I tap a notification, even though the app wasn’t already in the background. Of course, this sample doesn’t use PhoneGap.
I’m hoping maybe someone else, has experienced this problem, or can at least recognize the symptoms, and has an idea what I might do to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是phonegap 中的一个小错误。
在您的 AppDelegate.m 文件中查看 didFinishLaunchingWithOptions,如果您注释掉下面的行,该问题就会消失。
This is a small bug in phonegap.
in your AppDelegate.m file look at didFinishLaunchingWithOptions, if you comment out the lines below that problem should go away.