Android Parse.com:在onPushOpen上获取Pushnotification消息
在我的android应用程序中,我使用Parse.com提供的推送通知。我已经成功地实现了这一点,但是我的应用程序有多个推送通知,并且应该根据按下的推送通知加载不同的活动。我希望能够从onPushOpen的intent参数中获取推送通知的消息,但它似乎是空的。有人知道我如何用onPushOpen方法获取消息吗 对于某些上下文,我在下面添加了我当前的自定义PushReceiver代码Android Parse.com:在onPushOpen上获取Pushnotification消息,android,parse-platform,push-notification,Android,Parse Platform,Push Notification,在我的android应用程序中,我使用Parse.com提供的推送通知。我已经成功地实现了这一点,但是我的应用程序有多个推送通知,并且应该根据按下的推送通知加载不同的活动。我希望能够从onPushOpen的intent参数中获取推送通知的消息,但它似乎是空的。有人知道我如何用onPushOpen方法获取消息吗 对于某些上下文,我在下面添加了我当前的自定义PushReceiver代码 public class PushReceiver extends ParsePushBroadcastRecei
public class PushReceiver extends ParsePushBroadcastReceiver {
@Override
public void onPushOpen(Context context, Intent intent) {
Log.e("Push", "Clicked");
Intent i = new Intent(context, Splash.class);
i.putExtras(intent.getExtras());
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
谢谢。请确保已升级到Parse-1.8.2 然后你还需要做两件事
<service android:name="com.parse.PushService" />
<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="com...ADD_PACKAGE_INFO_HERE..." />
</intent-filter>
</receiver>
<receiver android:name="com..ADD_PACKAGE_INFO_HERE....PushReceiver"
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>