简体   繁体   English

带有phonegap的Android应用不会向城市飞艇注册进行推送

[英]Android app built with phonegap won't register for push with urban airship

I've been trying to get my phonegap/android application to register for push notifications with urban airship, but it isn't working. 我一直在尝试让我的phonegap / android应用程序向城市飞艇注册推送通知,但无法正常工作。 I've followed the documentation/guide here: http://docs.urbanairship.com/build/phonegap.html#setting-up-your-application-with-urbanairship 我在这里遵循了文档/指南: http : //docs.urbanairship.com/build/phonegap.html#setting-up-your-application-with-urbanairship

While the app builds and communicates something to urban airship -- I can see the number of opens -- it will not register a device id for push with them. 该应用程序在构建并与城市飞艇进行通讯时-我可以看到打开次数-它不会注册设备ID以便与他们进行推送。 I did the automatic integration from the above link and it seemed to install the plugin without any errors. 我从上面的链接进行了自动集成,它似乎安装了插件而没有任何错误。

It's unclear how much of this page I'm supposed to do: http://docs.urbanairship.com/build/android.html#urban-airship-setup . 目前尚不清楚我应该在此页面中执行多少操作: http : //docs.urbanairship.com/build/android.html#urban-airship-setup I set up GCM with google, the app with urban airship, and the server key from google, as well as the airshipconfig.properties file and the www/config.xml file. 我使用Google设置了GCM,使用城市飞艇的应用程序设置了GCM,并使用了来自Google的服务器密钥以及airshipconfig.properties文件和www / config.xml文件。 But then it says to download the jar from their website - I already have a jar by the exact same name in platforms/android/libs/ that seems to have been installed when I used the 'phonegap plugin add' command from the first link in the 'automatic integration' section. 但是然后它说要从他们的网站下载jar-我已经在platforms / android / libs /中有一个完全相同名称的jar,当我从第一个链接中使用“ phonegap plugin add”命令时似乎已经安装了“自动集成”部分。 It then goes on to talk about modifying the AndroidManifest file, most of such modifications already are there. 然后继续讨论修改AndroidManifest文件,其中大多数此类修改已经存在。 So it seems those sections are not meant for Phonegap users. 因此,这些部分似乎并不适合Phonegap用户。

However - the app does not register, so I must have done something wrong or skipped something. 但是-该应用程序未注册,因此我必须做错了某些事情或跳过了某些事情。 To make this more complicated, I can't find a way to get a meaningful error message. 更复杂的是,我找不到找到有意义的错误消息的方法。 In my phonegap js code I can do alert() calls, but that doesn't tell me anything about UA/push/registration configuration problems that might be happening but not affect the app build process. 在我的phonegap js代码中,我可以进行alert()调用,但这并不能告诉我有关UA /推送/注册配置问题的信息,这些问题可能正在发生,但不会影响应用程序的构建过程。 All I know is that the 'register' event that's supposed to happen isn't being triggered. 我所知道的是,应该发生的“注册”事件没有被触发。

Has anyone been through this process before/recently? 之前/最近是否有人进行过此过程? I've found a handful of similar questions and guides, but they're all concerning older versions of phonegap and urban airship and haven't been much help so far. 我发现了一些类似的问题和指南,但它们都与旧版本的电话间隙和城市飞艇有关,到目前为止并没有太大帮助。 Neither has urban airship support, who told me they don't help people with specific implementations (of course I didn't expect them to, it was a shot in the dark). 城市飞艇都没有支持,谁告诉我他们没有帮助人们实施特定的实现(当然我没想到他们会这样做,这是在黑暗中打了针)。

Anyway, thanks for your help and for reading this if you've made it this far. 无论如何,感谢您的帮助,如果您已经做到了这一点,请阅读本文。

The answer is something the documentation is not entirely clear about - Android apps don't register for push notification at all. 答案是文档尚不完全清楚-Android应用程序根本不注册推送通知。 The guides were otherwise correct. 指南是正确的。 Once I realized I didn't have to wait for registration, I tried sending a push from UA website, and it worked. 当我意识到我不必等待注册时,我尝试从UA网站发送推送,并且该推送成功了。

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

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