Skip to content Skip to sidebar Skip to footer

How Can I Get Data Or Title From Receiving Notifications?

I create simple 'ParseStarterProject' as default of parse.com project. It works. I send notification from one device to other device successfully via setchannel method. But the pro

Solution 1:

Create a class that extends BroadcastReceiver, here we call it MyCustomReceiver. Declare the usage of this receiver in your manifest:

<receiverandroid:name="com.example.MyCustomReceiver"android:exported="false"><intent-filter><actionandroid:name="com.example.UPDATE_STATUS" /></intent-filter></receiver>

I'm not sure what you mean by you have problems with "MyCustomReceiver class on the main activity", in your comment to @kingspeech's answer.


In the worst case, you can create your own Receiver which extends the ParseBroadcastReceiver (and reference the extended class in the manifest). Then it should work by default, but you'll be able to hook into onReceive(Context, Intent)

Solution 2:

As Parse tutorial directs, you ca use JSONObject to set data and you can put whatever you want. Then when you receive Push notification you can have a access to read the previously prepared JSONObject. Please look at the Android tutorial https://parse.com/docs/push_guide#options/Android.

Hope this helps, Regards.

Post a Comment for "How Can I Get Data Or Title From Receiving Notifications?"