Every one I am using the parse service for push notification in my app. but it register all time when i re-install the app in one device.Then problem is that,one device rece
Create new class and extend it with Application. write code in this way
public class BBApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "app key", "client key");
ParseInstallation.getCurrentInstallation().saveInBackground();
ParsePush.subscribeInBackground("", new SaveCallback() {
@Override
public void done(com.parse.ParseException arg0) {
// TODO Auto-generated method stub
if (arg0 == null) {
Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
} else {
Log.e("com.parse.push", "failed to subscribe for push", arg0);
}
}
});
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
}
Add entry in manifest
file
<application android:label="@string/app_name"
android:name="org.cocos2dx.cpp.BBApplication"
android:icon="@drawable/icon">