How to intent from parse push notification. i f anybody implemented parse push please help.
Parse.initialize(Splash.this,\"id\",\"id\");
ParseInstallation.ge
You have to write a parse broadcast receiver in order to receive notification.. Write in your manifest
then define a broadcast receiver
public class ParseBroadcastReceiver extends BroadcastReceiver{
public static final String ACTION = "com.example.package.MESSAGE";
public static final String PARSE_EXTRA_DATA_KEY = "com.parse.Data";
public static final String PARSE_JSON_CHANNEL_KEY = "com.parse.Channel";
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String channel = intent.getExtras().getString(PARSE_JSON_CHANNEL_KEY);
JSONObject json = new JSONObject(intent.getExtras().getString(PARSE_EXTRA_DATA_KEY));
}
Now this json object will contain the data that you have send from parse.. For instance if you have to send notification using javascript api
Parse.Push.send({where: query, // Set our Installation query
data: {
triggerKey:triggerValue,
objectType:"android",
action:"com.example.package.MESSAGE"
}
},{
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
}
});
Note that in your push notification you have to mention the "action" key and it should be same as the one you have mentioned in your broadcast receiver intent filter.