本文整理汇总了Java中com.parse.ParsePush.subscribeInBackground方法的典型用法代码示例。如果您正苦于以下问题:Java ParsePush.subscribeInBackground方法的具体用法?Java ParsePush.subscribeInBackground怎么用?Java ParsePush.subscribeInBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.parse.ParsePush
的用法示例。
在下文中一共展示了ParsePush.subscribeInBackground方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupParse
import com.parse.ParsePush; //导入方法依赖的package包/类
private void setupParse() {
Parse.initialize(this);
Parse.setLogLevel(
BuildConfig.DEBUG ?
Parse.LOG_LEVEL_VERBOSE :
Parse.LOG_LEVEL_NONE);
ParseInstallation parseInstallation = ParseInstallation.getCurrentInstallation();
parseInstallation.increment("uses");
parseInstallation.saveInBackground();
ParsePush.subscribeInBackground("");
ParsePush.subscribeInBackground("general");
ParsePush.subscribeInBackground("warning");
ParsePush.subscribeInBackground("news");
ParseLocation.registerSubclass(ParseLocation.class);
Schedule.registerSubclass(Schedule.class);
Price.registerSubclass(Price.class);
New.registerSubclass(New.class);
}
示例2: setUpParse
import com.parse.ParsePush; //导入方法依赖的package包/类
public static void setUpParse(Context context) {
Parse.enableLocalDatastore(context);
Parse.initialize(context, "SUA_APPLICATION_ID", "SUA CLIENT_KEY");
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParsePush.subscribeInBackground(Constants.CHANNEL, new SaveCallback() {
@Override
public void done(ParseException error) {
if (error == null) {
Log.i(Constants.TAG, "Successfully subscribed to Parse!");
}else{
Log.i(Constants.TAG, "Error subscribed to Parse!");
}
}
});
}
示例3: onCreate
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Parse.enableLocalDatastore(this);
Parse.initialize(this, "b6M7rAxtdYoUgGMgGkzmYmpDWiN2T6M8c2RTJ5Zg", "Xsqyd44kUtgiOMMvwP8gyVjmdZLvXLxuynmGqqNX");
ParsePush.subscribeInBackground("Apro_2016", new SaveCallback() {
@Override
public void done(ParseException e) {
Log.e(TAG, "Successfully subscribed to Parse!");
}
});
Log.d(TAG, "not rgtd.");
}
示例4: onCreate
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
ParseCrashReporting.enable(this);
Parse.initialize(this, BuildConfig.PARSE_APPKEY,
BuildConfig.PARSE_TOKEN);
ParsePush.subscribeInBackground("wc", new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.e("push", "successfully subscribed to the broadcast channel.");
} else {
Log.e("push", "failed to subscribe for push", e);
}
}
});
}
示例5: addToMyWC
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override
public int addToMyWC(int wcid, int position) {
int retId = communicator.addToMyWC(wcid);
WordCampDB wordCampDB = adapter.getItem(position);
listener.onNewMyWCAdded(wordCampDB);
if (!wordCampDB.getTwitter().isEmpty()) {
ParsePush.subscribeInBackground(wordCampDB.getTwitter().replace("#", ""));
}
return retId;
}
示例6: onCreate
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Register your parse models here
ParseObject.registerSubclass(Address.class);
ParseObject.registerSubclass(Gym.class);
ParseObject.registerSubclass(Message.class);
ParseObject.registerSubclass(SimpleUser.class);
ParseObject.registerSubclass(Trainer.class);
ParseObject.registerSubclass(Review.class);
ParseObject.registerSubclass(TrainerSlots.class);
ParseObject.registerSubclass(BlockedSlots.class);
Parse.enableLocalDatastore(this);
Parse.initialize(this, APPLICATION_ID, CLIENT_KEY);
ParsePush.subscribeInBackground("", new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
PushService.setDefaultPushCallback(getBaseContext(), ChatActivity.class);//change the class where u want to go after clicking on noti
ParseInstallation.getCurrentInstallation().saveInBackground();
} else {
Log.e("com.parse.push", "failed to subscribe for push", e);
}
}
});
FacebookSdk.sdkInitialize(getApplicationContext());
}
示例7: onCreate
import com.parse.ParsePush; //导入方法依赖的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);
}
}
});
}
示例8: ParsePlugin
import com.parse.ParsePush; //导入方法依赖的package包/类
public ParsePlugin() {
// Application id, client key
Parse.initialize(BakerApplication.getInstance(), BakerApplication.getInstance().getString(R.string.parse_application_id), BakerApplication.getInstance().getString(R.string.parse_client_key));
ParsePush.subscribeInBackground("", new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.d("ParsePlugin", "successfully subscribed to the broadcast channel.");
} else {
Log.e("ParsePlugin", "failed to subscribe for push", e);
}
}
});
}
示例9: onCreate
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override public void onCreate() {
super.onCreate();
// Initialize the Parse SDK.
Parse.initialize(this, BuildConfig.PARSE_APP_ID, BuildConfig.PARSE_CLIENT_KEY);
// Register for Push Notifications ?
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
boolean notificationsEnabled =
sharedPref.getBoolean(SettingsFragment.PREF_KEY_ENABLE_NOTIFICATIONS, true);
if(notificationsEnabled){
ParsePush.subscribeInBackground("", new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Timber.d("successfully subscribed to the broadcast channel.");
} else {
Timber.e(e, "failed to subscribe for push");
}
}
});
}
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
} else {
Timber.plant(new CrashReportingTree());
if (!Fabric.isInitialized()) {
Fabric.with(this, new Crashlytics());
}
}
}
示例10: subscribeChannel
import com.parse.ParsePush; //导入方法依赖的package包/类
@Kroll.method
public void subscribeChannel(@Kroll.argument String channel) {
ParsePush.subscribeInBackground(channel);
}
示例11: onCreate
import com.parse.ParsePush; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
((StarterApplication)getApplication()).setMainActivity(this);
ParseAnalytics.trackAppOpenedInBackground(getIntent());
ParsePush.subscribeInBackground("IRSensor", new SaveCallback() {
@Override
public void done(ParseException e) {
}
});
if (!isGooglePlayServicesAvailable()) {
finish();
}
createLocationRequest();
googleApiClient = new GoogleApiClient.Builder(this)
.addApi(LocationServices.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
// init Kandy SDK!!
Kandy.initialize(getApplicationContext(), "DAK35a030f39497484593f5d5372a195704", "DAS4f7751f0b9a04a9383acd3e6954edd5c");
//mainText = (TextView)findViewById(R.id.maintext);
listView = (ListView) findViewById(R.id.list);
pref = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
//fd= pref.edit();
Set<String> values = new HashSet<String>();
values = pref.getStringSet("numbers", values);
arrayList = new ArrayList<String>(values);
adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, android.R.id.text1, arrayList);
listView.setAdapter(adapter);
listView.setDividerHeight(3);
listView.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int arg2, long arg3) {
arrayList.remove(arg2);
adapter.notifyDataSetChanged();
//TODO: persist
return false;
}
});
}
示例12: SubscribeToPushChannel
import com.parse.ParsePush; //导入方法依赖的package包/类
public void SubscribeToPushChannel(String channelName) {
ParsePush.subscribeInBackground(channelName);
}