【发布时间】:2023-03-03 22:30:01
【问题描述】:
最初我认为问题出在我的代码上,尽管它没有任何意义,因为它在我的模拟器上运行得很好 + 它与 tbmp 骨架示例中的非常相似。
现在我肯定认为问题出在我的设备上,所以我想知道是什么阻止了来自 Google Play 游戏的通知。
在我的模拟器中,我在通知栏中收到大量来自 Google Play 游戏的通知,但在物理设备中却没有。 该设备是 Xperia L 4.2.2。
编辑: 是的,谷歌播放服务通知复选框被选中。 这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE_NAME"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<activity
android:name="PACKAGE_NAME.MYACTIVITY"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我已经尝试并到处搜索了这个,也许其他人也经历过同样的事情。
【问题讨论】:
-
你收到谷歌推送通知了吗?
-
我认为问题是我没有收到来自谷歌的任何通知。如果我理解正确,我没有明确使用推送通知,但谷歌播放服务使用相同的方法发送通知,所以我的回答是否定的,我没有收到推送通知:P
-
好吧,我以某种方式修复了它.. 我在 Gmail 应用程序附近,我检查了一些关于自动同步或类似的东西.. 很奇怪我必须这样做,但现在我收到通知 :)
标签: android android-notifications google-play-games