Java PushService类代码示例(javapushservice类代码示例汇总)

本文整理汇总了Java中com.parse.PushService的典型用法代码示例。如果您正苦于以下问题:Java PushService类的具体用法?Java PushService怎么用?Java PushService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Java PushService类代码示例(javapushservice类代码示例汇总)

PushService类属于com.parse包,在下文中一共展示了PushService类的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());
} 
开发者ID:kamoljan,项目名称:Nefete,代码行数:18,代码来源:NefeteApp.java

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

示例3: savedEvent

import com.parse.PushService; //导入依赖的package包/类
@Subscribe
public void savedEvent(Event event) {

    Util.dismissLoadingDialog();

    if (event.getHash() == null) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    } else {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.event_saved), Toast.LENGTH_LONG).show();

        DataExchange.uploadedEvents.add(event);

        Intent intent = new Intent(this, ViewEventAsAuthorActivity.class);
        intent.putExtra(DataExchange.EVENT_HASH_FOR_VIEW_EVENT_ACTIVITY_KEY, event.getHash());
        PushService.subscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + event.getHash(), MainActivity.class);
        startActivity(intent);
    }
} 
开发者ID:chechulinYuri,项目名称:stepout,代码行数:19,代码来源:CreateEventActivity.java

示例4: getUnresponseStatus

import com.parse.PushService; //导入依赖的package包/类
@Subscribe
public void getUnresponseStatus(String status) {
    Util.dismissLoadingDialog();
    if (status.equals(DataExchange.STATUS_SUCCESS)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.you_unrespond), Toast.LENGTH_LONG).show();

        PushService.unsubscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        ParsePush push = new ParsePush();
        ParseQuery pushQuery = ParseInstallation.getQuery();
        pushQuery.whereNotEqualTo("installationId", ParseInstallation.getCurrentInstallation().getInstallationId());
        pushQuery.whereEqualTo("channels", DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        push.setQuery(pushQuery);
        try {
            JSONObject data = new JSONObject("{\"action\": \"com.stepout.main.CustomReceiver.SHOW_EVENT\", \"message\": \"" + getString(R.string.user_do_not_attend_event, currentEvent.getRespondentsHash().size()) + "\", \"" + DataExchange.EVENT_HASH_FOR_VIEW_EVENT_ACTIVITY_KEY + "\": \"" + currentEvent.getHash() + "\", \"author\": \"" + currentEvent.getAuthorHash() + "\"}");
            push.setData(data);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        push.sendInBackground();
        Intent intentDeletion = new Intent(this, MapsActivity.class);
        startActivity(intentDeletion);
    } else if (status.equals(DataExchange.STATUS_FAIL)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    }
} 
开发者ID:chechulinYuri,项目名称:stepout,代码行数:26,代码来源:ViewEventAsRespondentActivity.java

示例5: removeEventStatus

import com.parse.PushService; //导入依赖的package包/类
@Subscribe
public void removeEventStatus(String status) {

    Util.dismissLoadingDialog();

    if (status.equals(DataExchange.STATUS_REMOVE_SUCCESS)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.remove_success), Toast.LENGTH_LONG).show();

        PushService.unsubscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        ParsePush push = new ParsePush();
        ParseQuery pushQuery = ParseInstallation.getQuery();
        pushQuery.whereNotEqualTo("installationId", ParseInstallation.getCurrentInstallation().getInstallationId());
        pushQuery.whereEqualTo("channels", DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        push.setQuery(pushQuery);
        push.setMessage(getString(R.string.author_deleted_event, android.text.format.DateFormat.format("dd.MM.yy hh:mm", currentEvent.getDate())));
        push.sendInBackground();

        Intent intent = new Intent(this, MapsActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    } else if (status.equals(DataExchange.STATUS_REMOVE_FAIL)) {
        isRemovingProcess = false;
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    }
} 
开发者ID:chechulinYuri,项目名称:stepout,代码行数:26,代码来源:ViewEventAsAuthorActivity.java

示例6: 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);
} 
开发者ID:SDSMT-CSC,项目名称:CS492-FA13,代码行数:21,代码来源:ParseApplication.java

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

示例8: 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);
 } 
开发者ID:tamzi,项目名称:sophia,代码行数:11,代码来源:Application.java

示例9: 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
	      }
	    }
	  });
	  
	} 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:38,代码来源:My_Application.java

示例10: onCreate

import com.parse.PushService; //导入依赖的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

示例11: 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);
	
} 
开发者ID:nikhil-bhat,项目名称:class_board_app,代码行数:11,代码来源:ParseApplication.java

示例12: 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();
} 
开发者ID:FoamyGuy,项目名称:ParseNotificationExample,代码行数:8,代码来源:ParseApplication.java

示例13: 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));
} 
开发者ID:cat-chat,项目名称:cat-chat-android,代码行数:10,代码来源:CatChatApplication.java

示例14: subscribe

import com.parse.PushService; //导入依赖的package包/类
/**
 * Subscribe to push service with the channel is current user id
 * 
 * @param context
 * @throws Exception
 *             if user was not logged in
 */
public static void subscribe(Context context) throws Exception {
	// Since we don't launch activity when receive push notification
	// Activity can be set to whatever activity
	// PushService.subscribe(context, getChannel(context),
	// CloudyPhoneActivity.class);

	// TODO test only
	PushService.subscribe(context, "huy", CloudyPhoneActivity.class);
} 
开发者ID:nguyenhuy,项目名称:CloudyPhone,代码行数:17,代码来源:PushManager.java

示例15: unsubscribe

import com.parse.PushService; //导入依赖的package包/类
/**
 * Unsubscribe to push service
 * 
 * @throws Exception
 *             if user was not logged in
 */
public static void unsubscribe(Context context) throws Exception {
	// PushService.unsubscribe(context, getChannel(context));

	// TODO test only
	PushService.unsubscribe(context, "huy");
} 
开发者ID:nguyenhuy,项目名称:CloudyPhone,代码行数:13,代码来源:PushManager.java

本文标签属性:

示例:示例英文

代码:代码转换器

java:java游戏

PushService:华为mate40pro

上一篇:THE9解散演唱会(the9解散演唱会豆瓣)
下一篇:最强大脑黄明睿高考多少分(黄明睿考上什么大学)(《最强大脑》黄明睿高考多少分没用高考)

为您推荐