【发布时间】:2015-02-28 00:11:36
【问题描述】:
我对 Android 应用程序开发非常陌生。我使用 parse.com 作为我的后端,并按照教程https://www.parse.com/tutorials/android-push-notifications 设置推送通知。但是,每当我使用解析通知控制台(在网站上)或从 Android 设备发送通知时,我都不会收到任何通知。其次,在解析通知控制台上,每个通知显示 0 作为推送发送。当我在应用程序当前 ParseInstallation 的 deviceToken 字段中检查注册 ID 时,它是空的。甚至 GCMSenderID 也是空的。所以我怀疑我的应用程序没有正确注册,但 installationID 字段不为空。我已在清单文件中添加了所有权限和凭据。
请帮助我。这将是一个很大的帮助。谢谢你:)
这是我的清单文件:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!--
IMPORTANT: If you change the package name of this sample app, change
"com.parse.tutorials.pushnotifications.permission.C2D_MESSAGE" in the
lines below to match the new package name.
-->
<permission
android:name="com.parse.swipeit.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.parse.swipeit.permission.C2D_MESSAGE" />
<application
android:name="com.parse.swipeit.Application"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.parse.swipeit.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver
android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: If you change the package name of this sample app,
change "com.parse.tutorials.pushnotifications" in the lines
below to match the new package name.
-->
<category android:name="com.parse.swipeit" />
</intent-filter>
</receiver>
</application>
【问题讨论】:
-
请发布您的清单
-
@StephanBranczyk 请检查清单
标签: android parse-platform push-notification