Xamarin GCM推送通知不工作

问题描述:

我下面一步步来,并准确复制下面的教程中提供的代码:Xamarin GCM推送通知不工作

https://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/android/remote_notifications_in_android/

顺便说一句,我和我的API密钥更换,我正在使用usb debug进行测试,使用mashmallow运行我的moto g,运行cyanogenmod。

我无法获得推送通知,但我没有收到任何错误。任何线索?

UPDATE 这里是logcat。我有阅读,有时这个错误是由于失踪的谷歌服务.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 

Full logcat here.

+0

'adb logcat'中应该有大量的日志来搜索。你失败了哪一步?这本身就是一个很大的指导。 –

+0

我认为这不是失败。我完成了整个教程,我只是没有得到通知没有任何错误的logcat – srecce

+0

,如果它的调试模式,然后运行应用程序时,你的OnMessage函数打?你可以看看这个 - http://*.com/a/29126946/1155650。 –

我经历了同样的问题去了。当我最初运行文件MessageSender.exe时,邮件已成功发送并添加到我的主题中,但Xamarin应用程序未收到任何推送通知。我的问题是在WiFi路由器的防火墙设置。只要我切换到手机的4G数据网络,我就会收到设备上的信息。它适合我,但我不确定这是否是您的问题。如果这没有帮助,你会提供更多的信息(日志记录)?