当前位置: 首页>>代码示例>>Java>>正文


Java ParsePush.subscribeInBackground方法代码示例

本文整理汇总了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);
}
 
开发者ID:Gnzlt,项目名称:UCOmove,代码行数:23,代码来源:UCOmoveApplication.java

示例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!");
                }
            }
        });
    }
 
开发者ID:rudsonlive,项目名称:ParseLiveo,代码行数:23,代码来源:ParsePushApp.java

示例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.");
}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:17,代码来源:parse_config.java

示例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);
            }
        }
    });
}
 
开发者ID:aagam-shah,项目名称:WordCamp-Android,代码行数:21,代码来源:MyApplication.java

示例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;
}
 
开发者ID:aagam-shah,项目名称:WordCamp-Android,代码行数:13,代码来源:PastWCFragment.java

示例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());
}
 
开发者ID:fitness-buddy,项目名称:Fitness-Buddy-Group-Project,代码行数:33,代码来源:StrengthCoachApplication.java

示例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);
			}
		}
	});
}
 
开发者ID:arturf1,项目名称:EatingClub,代码行数:36,代码来源:EatingClub.java

示例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);
                }
            }
        });
    }
 
开发者ID:bakerframework,项目名称:baker-android-refactor,代码行数:16,代码来源:ParsePlugin.java

示例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());
        }
    }
}
 
开发者ID:gbaldera,项目名称:Yts,代码行数:33,代码来源:YtsApplication.java

示例10: subscribeChannel

import com.parse.ParsePush; //导入方法依赖的package包/类
@Kroll.method
public void subscribeChannel(@Kroll.argument String channel) {
    ParsePush.subscribeInBackground(channel);
}
 
开发者ID:gimdongwoo,项目名称:Titanium-Parse-Android,代码行数:5,代码来源:ParseModule.java

示例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;
        }
    });
}
 
开发者ID:Nyceane,项目名称:HackathonPADLS,代码行数:50,代码来源:MainActivity.java

示例12: SubscribeToPushChannel

import com.parse.ParsePush; //导入方法依赖的package包/类
public void SubscribeToPushChannel(String channelName) {
  ParsePush.subscribeInBackground(channelName);
}
 
开发者ID:E2010,项目名称:android-parse-module-titanium-3-5,代码行数:4,代码来源:ParseSingleton.java


注:本文中的com.parse.ParsePush.subscribeInBackground方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。