Urban Airship Phonegap

时间:2015-05-10 14:44:39

标签: android cordova phonegap-plugins

我正在使用phonegap AU插件开发应用程序。 构建过程通过Phonegap Build运行并成功发生。 但是,当我尝试打开应用程序时,我收到以下错误:

W/PackageParser( 6962): No actions in intent filter at     /storage/emulated/0/Download/PushPG-debug.apk Binary XML file line #15 
D/RCPManagerService( 816): PackageReceiver onReceive() bundle Bundle[{com.urbanairship.autopilot=com.urbanairship.phonegap.PushAutopilot, com.google.android.gms.version=6587000}] 
I/PCWCLIENTTRACE_PushUtil( 6564): SPPPushClient is installed : true 
I/PCWCLIENTTRACE_PushUtil( 6564): sales region : global 
I/PCWCLIENTTRACE_PushUtil( 6564): getPushTypeList : [SPP, GCM] 
I/dalvikvm( 7257): Could not find method android.support.v4.app.NotificationManagerCompat.from, referenced from method com.urbanairship.push.PushManager.<init> 
I/dalvikvm( 7257): Could not find method android.support.v4.app.NotificationManagerCompat.notify, referenced from method com.urbanairship.push.PushManager.show 
E/AndroidRuntime( 7257): at com.urbanairship.push.PushManager.<init>(PushManager.java:212) 
E/SPPClientService(13835): [[PushClientService]] F:false, D:false, E:false, T:false, S:true, R:false

在我的config.xml中,我添加了以下行: 我的测试代码:

document.addEventListener('urbanairship.registration', this.onUrbanAirshipRegistration, false);
onUrbanAirshipRegistration = function (event) { 
if (event.error) { 
console.log('there was an error registering for push notifications'); 
} else { 
console.log("Registered with ID: " + event.pushID); 
} 
app.receivedEvent('urbanairship.registration'); 
},

2 个答案:

答案 0 :(得分:0)

Urban Airship不支持Phonegap Build,但有一个可以手动安装的插件:https://github.com/urbanairship/phonegap-ua-push

答案 1 :(得分:0)

我认为你在错误的地方添加了一些代码。你不能在config.xml中添加document.addeventlistner ....

请您再次仔细阅读以下链接。

文档:http://docs.urbanairship.com/

对于诽谤:https://github.com/urbanairship/phonegap-ua-push

感谢。