应用程序构建正常,但在测试时(无论是模拟器还是手机),安装后崩溃,并发生以下错误:
IBM.MCE 3.6.3.0 : GcmDeliveryChannel: GCM app key or project number is not available
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
Process: apptest.test, PID: 3759
java.lang.IllegalArgumentException: Init Process: Properties files doesn't contain GCM AppKey or GCM ProjectNum. If you don't want to support GCM add support.gcm=false to mce.properties
at com.ibm.mce.sdk.gcm.GcmDeliveryChannel.initializeChannel(Unknown Source)
at com.ibm.mce.sdk.registration.DeliveryChannelImpl.initialiseComponents(Unknown Source)
at com.ibm.mce.sdk.registration.DeliveryChannel.initialiseComponents(Unknown Source)
at com.ibm.mce.sdk.registration.RegistrationClientImpl.initSdk(Unknown Source)
at com.ibm.mce.sdk.registration.RegistrationClientImpl.access$200(Unknown Source)
at com.ibm.mce.sdk.registration.RegistrationClientImpl$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run
我可以根据要求提供我的代码和配置文件的片段,但由于演示原因,我不会将其全部上传。
该应用程序的作用基本上是来自IBM Marketing Cloud的推送通知接收器,它使用IBM推送通知,它本身连接到GCM以将推送发送到连接的设备。
我愿意给予更多解释,感谢你的时间。
答案 0 :(得分:0)
您应该有一个MceConfig.json文件,该文件允许您指定您在IBM Marketing Cloud中定义的Google项目编号和应用程序密钥。寻找
"senderId": "YOUR GCM PROJECT ID"
和
"appKey": {
"prod":"YOUR APP KEY"
}
并将其替换为您拥有的值。有关更多详细信息,请参阅示例应用程序。