本文整理汇总了Java中com.parse.PushService.setDefaultPushCallback方法的典型用法代码示例。如果您正苦于以下问题:Java PushService.setDefaultPushCallback方法的具体用法?Java PushService.setDefaultPushCallback怎么用?Java PushService.setDefaultPushCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.parse.PushService
的用法示例。
在下文中一共展示了PushService.setDefaultPushCallback方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override public void onCreate() {
super.onCreate();
Parse.initialize(this, "aTAL8FkWWQRG2bsilzCzwQpVMY2YCK8skFryZIFa", "vLefUWhxBk12E8X4oighFYt25iGnMYRTUP58RDJg");
ParseFacebookUtils.initialize(getString(R.string.app_id));
PushService.setDefaultPushCallback(this, ViewActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
} else {
// TODO Crashlytics.start(this);
// TODO Timber.plant(new CrashlyticsTree());
}
applicationGraph = ObjectGraph.create(getModules().toArray());
}
示例2: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, getString(R.string.parse_app_id),
getString(R.string.parse_client_key));
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);
// Specify a Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
// Save the current installation.
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例3: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "0805cw8bWmLdhkfsYyx6qw3j6mAueM6kw3fJAqmX", "W0UgYdjieM8SkJWGAMqD8LBo62XB04Ajh8F0W0As");
//push code, wants the application and the activity to display when selected
PushService.setDefaultPushCallback(this, Buttons.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
//enables anonymous users if no user is signed in
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);
}
示例4: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "PsOttCLwKheePLzmK04aQKCuPvDPoVp1jticfIzj", "lRI1N7DNqhLIGxkx1B2hkpLKg67B5a7U0fbXS9qQ");
//PushService.setDefaultPushCallback(this, MainActivity.class);
PushService.setDefaultPushCallback(this, MainActivity.class,
R.drawable.ic_stat_ic_launcher);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例5: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Initialize the Parse SDK.
Parse.initialize(this, "YOUR_APP_ID", "YOUR_CLIENT_KEY");
// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
}
示例6: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void onCreate() {
Parse.initialize(this, "8FttRlqaAUPabxXzuLeTMbmgAA389L7oVbFaSqjj", "6sFwktakiPYSDg1NKzgP18yanSjlB9CQKFGUOShs");
// Also in this method, specify a default Activity to handle push notifications
PushService.setDefaultPushCallback(this, Notification.class);
// PushService.subscribe(this, "Everyone", Notification.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseObject.registerSubclass(Message.class);
// ParsePush.subscribeInBackground("Giants");
ParseUser user = new ParseUser();
user.setUsername("caip");
user.setPassword("piacpiac");
user.setEmail("[email protected]");
ParseUser user_2 = new ParseUser();
user_2.setUsername("professor");
user_2.setPassword("prof_iprj");
user_2.setEmail("[email protected]");
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
}
}
});
}
示例7: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
ParseObject.registerSubclass(Post.class);
// Add your initialization code here
Parse.initialize(this, "9p1jgEiWtixYQzIYbrh3oiY2rA9aNuCnOQYOhQ4i", "UETquOw1dDTAD0uUQ3jpf8iW9uVLQ5fGfddkFgdK");
PushService.setDefaultPushCallback(this,PostListActivity.class);
}
示例8: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, Keys.applicationId, Keys.clientKey);
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例9: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, getString(R.string.parse_app_id), getString(R.string.parse_client_key));
PushService.setDefaultPushCallback(this, InboxActivity.class);
ParseFacebookUtils.initialize(getString(R.string.fb_app_id));
}
示例10: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this,
"5W9RXHhz1FYThSlwE5I7OPwBzCDkQEHUDog0MAR7",
"8MvV9aqRhMPJgN1zMIT1PHdst9HylXznJnWKRIwL");
//PushService.setDefaultPushCallback(this, MainActivity.class);
PushService.setDefaultPushCallback(this, MainActivity.class,
R.drawable.ic_stat_ic_launcher);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例11: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// make sure to change the "#..#" with the actualy keys obtained from Parse.com after registration!
Parse.initialize(this, "####################################", "#####################################");
PushService.setDefaultPushCallback(this, MainActivity.class, R.drawable.ic_stat_ic_launcher);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例12: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override public void onCreate() {
super.onCreate();
Parse.initialize(this, "ZT4hK5Z1U58TSxg2g5OjFjvX6tZiByYRVNRfLN5t", "Gx49K57B1FkE3BtjEPP2lrX47oL0ZrTdT5iltrRm");
ParseFacebookUtils.initialize(getString(R.string.app_id));
PushService.setDefaultPushCallback(this, ViewActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
} else {
// TODO Crashlytics.start(this);
// TODO Timber.plant(new CrashlyticsTree());
}
applicationGraph = ObjectGraph.create(getModules().toArray());
}
示例13: initializeParse
import com.parse.PushService; //导入方法依赖的package包/类
private void initializeParse(){
ParseObject.registerSubclass(User.class);
ParseObject.registerSubclass(Request.class);
ParseObject.registerSubclass(Rating.class);
ParseObject.registerSubclass(Message.class);
Parse.initialize(this, Constants.PARSE_APPLICATION_ID, Constants.PARSE_CLIENT_KEY);
PushService.setDefaultPushCallback(this, MentorListActivity.class);
ParseFacebookUtils.initialize(Constants.FACEBOOK_APP_ID);
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例14: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
mContext = this;
client = new OkHttpClient();
Glide.get(this).register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client) );
PushService.setDefaultPushCallback(this, MainActivity.class);
}
示例15: onCreate
import com.parse.PushService; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "H71CQB2s5TvKZkUYPAvlnAOUFg953qcY8ipvcOpA",
"gnzyfpH0w5mFsBOeReXXR4ZmKYw0UrsFfvbUFqJZ");
// Also, specify a default Activity to handle push notifications in this
// method as well
PushService.setDefaultPushCallback(this, InitialPage.class);
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);
// Save the current Installation to Parse.
ParseInstallation.getCurrentInstallation().saveInBackground();
ParsePush.subscribeInBackground("", new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.d("com.parse.push",
"successfully subscribed to the broadcast channel.");
} else {
Log.e("com.parse.push", "failed to subscribe for push", e);
}
}
});
}