How to intent from parse push notification. i f anybody implemented parse push please help.
Parse.initialize(Splash.this,"id","id");
ParseInstallation.getCurrentInstallation().saveInBackground();
PushService.setDefaultPushCallback(Splash.this, ParsePush.class);
implementing like this.
can't get any values in jsonData.
public class ParsePush extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
ParseInstallation.getCurrentInstallation().saveInBackground();
Intent intent = getIntent();
Bundle extras = intent.getExtras();
String jsonData = extras.getString("com.parse.Data");
System.out.println("Data Json : " + jsonData);
}
}
need to implement an intent from the push notification (parse). that is need to show an activity on clicking the push.. please help.
Try below code in your activity:
Use like this :
//MainActivity.java - Activity you need to open when the notification is clicked.
In your Manifest file add this application.
And add this line in your MainActivity class which you need to open when the notification is clicked.
You have to write a parse broadcast receiver in order to receive notification.. Write in your manifest
then define a broadcast receiver
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
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.
You can download complete code from here
Add Google play service lib in dependency
Initialize Parse in Application Class
Add Following Permissions in AndroidMainifest.xml
Add following things also