@Override public void executeAsync() { QBSubscription subscription = new QBSubscription(QBNotificationChannel.GCM); // subscription.setEnvironment(QBEnvironment.DEVELOPMENT); // String deviceId = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)) .getDeviceId(); if (deviceId == null) { deviceId = "UniversalDeviceId"; } subscription.setDeviceUdid(deviceId); // String registrationID = "APA91bGr9AcS9Wgv4p4BkBQAg_1YrJZpfa5GMXg7LAQU0lya8gbf9Iw1360602PunkWk_NOsLS2xEK8tPeBCBfSH4fobt7zW4KVlWGjUfR3itFbVa_UreBf6c-rZ8uP_0_vxPCO65ceqgnjvQqD6j8DjLykok7VF7UBBjsMZrTIFjKwmVeJqb1o"; subscription.setRegistrationID(registrationID); ArrayList<QBSubscription> createdSubscriptions = null; try { createdSubscriptions = QBPushNotifications.createSubscription(subscription); } catch (QBResponseException e) { setException(e); } if (createdSubscriptions != null) { Log.i(TAG, ">>> Subscription: " + createdSubscriptions.toString()); } }
@Override public void execute() { QBSubscription subscription = new QBSubscription(QBNotificationChannel.GCM); subscription.setEnvironment(QBEnvironment.DEVELOPMENT); // String deviceId = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)) .getDeviceId(); if (deviceId == null) { deviceId = "UniversalDeviceId"; } subscription.setDeviceUdid(deviceId); // String registrationID = "APA91bGr9AcS9Wgv4p4BkBQAg_1YrJZpfa5GMXg7LAQU0lya8gbf9Iw1360602PunkWk_NOsLS2xEK8tPeBCBfSH4fobt7zW4KVlWGjUfR3itFbVa_UreBf6c-rZ8uP_0_vxPCO65ceqgnjvQqD6j8DjLykok7VF7UBBjsMZrTIFjKwmVeJqb1o"; subscription.setRegistrationID(registrationID); QBPushNotifications.createSubscription( subscription, new QBEntityCallback<ArrayList<QBSubscription>>() { @Override public void onSuccess(ArrayList<QBSubscription> subscriptions, Bundle args) { Log.i(TAG, ">>> Subscription: " + subscriptions.toString()); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void executeAsync() { try { QBPushNotifications.deleteSubscription(1558628); Log.i(TAG, ">>> subscription successfully deleted"); } catch (QBResponseException e) { setException(e); } }
@Override public void executeAsync() { try { QBPushNotifications.deleteEvent(1454326); Log.i(TAG, ">>> event successfully deleted"); } catch (QBResponseException e) { setException(e); } }
@Override public void executeAsync() { try { event = QBPushNotifications.getEvent(1454324); } catch (QBResponseException e) { setException(e); } if (event != null) { Log.i(TAG, ">>> event: " + event.toString()); } }
@Override public void executeAsync() { ArrayList<QBSubscription> subscriptions = null; try { subscriptions = QBPushNotifications.getSubscriptions(); } catch (QBResponseException e) { setException(e); } if (subscriptions != null) { Log.i(TAG, ">>> Subscriptions: " + subscriptions.toString()); } }
@Override public void executeAsync() { QBEvent event = buildEvent(); QBEvent createdEvent = null; try { createdEvent = QBPushNotifications.createEvent(event); } catch (QBResponseException e) { setException(e); } if (createdEvent != null) { Log.i(TAG, ">>> Event: " + createdEvent.toString()); } }
@Override public void executeAsync() { QBEvent event = new QBEvent(); event.setId(1454326); event.setActive(true); // send it again QBEvent updatedEvent = null; try { updatedEvent = QBPushNotifications.updateEvent(event); } catch (QBResponseException e) { setException(e); } if (updatedEvent != null) { Log.i(TAG, ">>> Event: " + updatedEvent.toString()); } }
@Override public void execute() { QBPushNotifications.getSubscriptions( new QBEntityCallback<ArrayList<QBSubscription>>() { @Override public void onSuccess(ArrayList<QBSubscription> subscriptions, Bundle args) { Log.i(TAG, ">>> Subscriptions: " + subscriptions.toString()); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void execute() { QBPushNotifications.deleteEvent( 1454324, new QBEntityCallback<Void>() { @Override public void onSuccess(Void result, Bundle bundle) { Log.i(TAG, ">>> event successfully deleted"); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void executeAsync() { QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder(20, 1); Bundle params = new Bundle(); ArrayList<QBEvent> events = null; try { events = QBPushNotifications.getEvents(requestBuilder, params); } catch (QBResponseException e) { setException(e); } if (events != null) { Log.i(TAG, ">>> Events: " + events.toString()); Log.i(TAG, "currentPage: " + params.getInt(Consts.CURR_PAGE)); Log.i(TAG, "perPage: " + params.getInt(Consts.PER_PAGE)); Log.i(TAG, "totalPages: " + params.getInt(Consts.TOTAL_ENTRIES)); } }
@Override public void execute() { QBPushNotifications.getEvent( 1454324, new QBEntityCallback<QBEvent>() { @Override public void onSuccess(QBEvent qbEvent, Bundle args) { Log.i(TAG, ">>> event: " + qbEvent.toString()); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void execute() { QBEvent event = new QBEvent(); event.setId(1470629); event.setActive(true); // send it again QBPushNotifications.updateEvent( event, new QBEntityCallback<QBEvent>() { @Override public void onSuccess(QBEvent qbEvent, Bundle args) { Log.i(TAG, ">>> event: " + qbEvent.toString()); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void execute() { QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder(20, 1); QBPushNotifications.getEvents( requestBuilder, new QBEntityCallback<ArrayList<QBEvent>>() { @Override public void onSuccess(ArrayList<QBEvent> events, Bundle args) { Log.i(TAG, ">>> Events: " + events.toString()); Log.i(TAG, "currentPage: " + args.getInt(Consts.CURR_PAGE)); Log.i(TAG, "perPage: " + args.getInt(Consts.PER_PAGE)); Log.i(TAG, "totalPages: " + args.getInt(Consts.TOTAL_ENTRIES)); } @Override public void onError(QBResponseException errors) { handleErrors(errors); } }); }
@Override public void executeAsync() { String registrationID = "APA91bGr9AcS9Wgv4p4BkBQAg_1YrJZpfa5GMXg7LAQU0lya8gbf9Iw1360602PunkWk_NOsLS2xEK8tPeBCBfSH4fobt7zW4KVlWGjUfR3itFbVa_UreBf6c-rZ8uP_0_vxPCO65ceqgnjvQqD6j8DjLykok7VF7UBBjsMZrTIFjKwmVeJqb1o"; String deviceId = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)) .getDeviceId(); if (deviceId == null) { deviceId = "UniversalDeviceId"; } ArrayList<QBSubscription> subscriptions = null; try { subscriptions = QBPushNotifications.subscribeToPushNotificationsTask( registrationID, deviceId, QBEnvironment.DEVELOPMENT); } catch (QBResponseException e) { setException(e); } if (subscriptions != null) { Log.i(TAG, ">>> subscription created: " + subscriptions); } }