0
我需要帮助实现一个ParsePushBroadcastReceiver, 为了使用它来解析一个JSON对象,选择一个活动开始。Parse.com android通知 - 获取数据到BrodcastReciever
谢谢。
我试着
<receiver
android:name="com......BroadcastReceiver"
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....BroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
但没有成功......
我的应用程序类
public class AppApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
System.out.println("vrum");
Parse.initialize(this, "...", "..");
PushService.setDefaultPushCallback(this, HomeActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
当我点击通知我进入HomeActivity ... s AME的事情,如果我删除了这一行
PushService.setDefaultPushCallback(this, HomeActivity.class);
阅读此https://parse.com/tutorials/android-push-notifications。你可以有一个自定义类扩展'ParseBroadcastReceiver' – Raghunandan
http://pastebin.com/Djsk4HCk这是我的代码。你能告诉我我错了吗?当我单击通知时,我打开HomeActivity ...不调用CustomParseBroadcastReceiver方法onReceive .. –
这不是必需的。 'PushService.setDefaultPushCallback(this,HomeActivity.class);' – Raghunandan