我有一個應用程序,我想在其中使用解析通知。 我也有一個正確的樣本解析推送通知。如何和在哪裏可以使用推它呢? 我的解析應用程序擁有這些代碼:如何將解析通知添加到我的應用程序?
public class ParseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, " ", " ");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
也:
public class ParseStarterProjectActivity extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// To track statistics around application
ParseAnalytics.trackAppOpened(getIntent());
// inform the Parse Cloud that it is ready for notifications
PushService.setDefaultPushCallback(this, ParseStarterProjectActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
它工作正常,但我不知道在哪裏我可以在這個代碼添加到我的主要應用。