【发布时间】:2016-04-02 11:16:48
【问题描述】:
我正在尝试设置我的 android 应用程序以通过 Parse 发送推送通知。
build.gradle
compile 'com.parse:parse-android:1.13.0'
Application.java
//in onCreate
Parse.initialize(this, "appId", "clientKey");
ParseInstallation.getCurrentInstallation().saveInBackground();
AndroidManifest.xml
<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.ParsePushBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</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" />
<category android:name="MY_APP_ID" />
</intent-filter>
</receiver>
通过这些更改启动我的应用程序后,我可以看到 Parse 仪表板上正在创建一个安装对象。
现在,当我尝试通过仪表板发送推送并使用 Android 平台创建受众时,它会显示 “您的此广告系列的收件人数不能为空。”
我错过了什么?
编辑 1: 我可以通过 REST api 发送推送。仍然无法通过 Web 控制台发送推送。
【问题讨论】:
标签: parse-platform push-notification google-cloud-messaging parse-android-sdk