【发布时间】:2016-12-29 14:42:26
【问题描述】:
我正在一步一步地进行,并且完全复制了以下教程中提供的代码:
顺便说一句,我正在用我的 API KEY 替换,我正在使用 USB 调试、我的 moto g、运行 cyanogenmod 和 mashmallow 进行测试。
我无法收到推送通知,也没有收到任何错误。这有什么线索吗?
更新 这是日志猫。我读到有时这个错误是由于缺少 google-services.json,但 xamarin 似乎不需要它。
08-23 14:19:50.207 I/GMPM ( 9213): App measurement is starting up, version: 8487
08-23 14:19:50.207 I/GMPM ( 9213): To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
08-23 14:19:50.216 E/GMPM ( 9213): GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
08-23 14:19:50.216 E/GMPM ( 9213): Scheduler not set. Not logging error/warn.
08-23 14:19:50.231 E/GMPM ( 9213): Uploading is not possible. App measurement disabled
08-23 14:20:26.066 I/GMPM ( 9213): Tag Manager is not found and thus will not be used
08-23 14:21:35.288 I/GMPM ( 9547): App measurement is starting up, version: 8487
08-23 14:21:35.288 I/GMPM ( 9547): To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
08-23 14:21:35.295 E/GMPM ( 9547): GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
08-23 14:21:35.295 E/GMPM ( 9547): Scheduler not set. Not logging error/warn.
08-23 14:21:35.312 E/GMPM ( 9547): Uploading is not possible. App measurement disabled
【问题讨论】:
-
adb logcat中应该有很多日志可以搜索。你在哪一步失败了?它本身就是一个相当大的指南。 -
我认为它没有失败。我完成了整个教程,我只是在 logcat 中没有收到任何错误的通知
-
如果是调试模式,那么在运行应用程序时,您的 OnMessage 函数是否命中?你可以看看这个 - stackoverflow.com/a/29126946/1155650。
-
感谢 @JonDouglas 和 Rohit 的 cmets。我更新了问题
标签: xamarin push-notification google-cloud-messaging xamarin.android