Search in sources :

Example 6 with PushNotificationEnvelope

use of com.kickstarter.services.apiresponses.PushNotificationEnvelope in project android-oss by kickstarter.

the class ProjectIntentMapperTest method testPushNotificationEnvelope_emitsFromEnvelope.

@Test
public void testPushNotificationEnvelope_emitsFromEnvelope() {
    final PushNotificationEnvelope envelope = PushNotificationEnvelopeFactory.envelope();
    final Intent intent = new Intent().putExtra(IntentKey.PUSH_NOTIFICATION_ENVELOPE, envelope);
    final TestSubscriber<PushNotificationEnvelope> resultTest = TestSubscriber.create();
    ProjectIntentMapper.pushNotificationEnvelope(intent).subscribe(resultTest);
    resultTest.assertValue(envelope);
}
Also used : PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Intent(android.content.Intent) Test(org.junit.Test)

Example 7 with PushNotificationEnvelope

use of com.kickstarter.services.apiresponses.PushNotificationEnvelope in project android-oss by kickstarter.

the class DebugPushNotificationsView method simulateProjectCancellationButtonClick.

@OnClick(R.id.simulate_project_cancellation_button)
public void simulateProjectCancellationButtonClick() {
    final GCM gcm = GCM.builder().title("Kickstarter").alert("SKULL GRAPHIC TEE has been canceled.").build();
    final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_CANCELLATION).id(3).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
    final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
    pushNotifications.add(envelope);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Activity(com.kickstarter.models.pushdata.Activity) OnClick(butterknife.OnClick)

Example 8 with PushNotificationEnvelope

use of com.kickstarter.services.apiresponses.PushNotificationEnvelope in project android-oss by kickstarter.

the class DebugPushNotificationsView method simulateProjectReminderButtonClick.

@OnClick(R.id.simulate_project_reminder_button)
public void simulateProjectReminderButtonClick() {
    final GCM gcm = GCM.builder().title("Last call").alert("Reminder! SKULL GRAPHIC TEE is ending soon.").build();
    final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().gcm(gcm).project(PushNotificationEnvelope.Project.builder().id(PROJECT_ID).photo(PROJECT_PHOTO).build()).build();
    pushNotifications.add(envelope);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) OnClick(butterknife.OnClick)

Example 9 with PushNotificationEnvelope

use of com.kickstarter.services.apiresponses.PushNotificationEnvelope in project android-oss by kickstarter.

the class DebugPushNotificationsView method simulateProjectFailureButtonClick.

@OnClick(R.id.simulate_project_failure_button)
public void simulateProjectFailureButtonClick() {
    final GCM gcm = GCM.builder().title("Kickstarter").alert("SKULL GRAPHIC TEE was not successfully funded.").build();
    final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_FAILURE).id(4).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
    final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
    pushNotifications.add(envelope);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Activity(com.kickstarter.models.pushdata.Activity) OnClick(butterknife.OnClick)

Example 10 with PushNotificationEnvelope

use of com.kickstarter.services.apiresponses.PushNotificationEnvelope in project android-oss by kickstarter.

the class DebugPushNotificationsView method simulateFriendBackingButtonClick.

@OnClick(R.id.simulate_friend_backing_button)
public void simulateFriendBackingButtonClick() {
    final GCM gcm = GCM.builder().title("Check it out").alert("Christopher Wright backed SKULL GRAPHIC TEE.").build();
    final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_BACKING).id(1).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
    final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
    pushNotifications.add(envelope);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Activity(com.kickstarter.models.pushdata.Activity) OnClick(butterknife.OnClick)

Aggregations

PushNotificationEnvelope (com.kickstarter.services.apiresponses.PushNotificationEnvelope)12 GCM (com.kickstarter.models.pushdata.GCM)9 OnClick (butterknife.OnClick)8 Activity (com.kickstarter.models.pushdata.Activity)7 Intent (android.content.Intent)2 Test (org.junit.Test)2 Notification (android.app.Notification)1