Search in sources :

Example 16 with PushNotificationEnvelope

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

the class PushNotifications method displayNotificationFromSurveyResponseActivity.

private void displayNotificationFromSurveyResponseActivity(@NonNull final PushNotificationEnvelope envelope, @NonNull final SurveyResponse surveyResponse) {
    final GCM gcm = envelope.gcm();
    final PushNotificationEnvelope.Survey survey = envelope.survey();
    if (survey == null) {
        return;
    }
    final Notification notification = notificationBuilder(gcm.title(), gcm.alert(), CHANNEL_SURVEY).setContentIntent(surveyResponseContentIntent(envelope, surveyResponse)).build();
    notificationManager().notify(envelope.signature(), notification);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Notification(android.app.Notification)

Aggregations

PushNotificationEnvelope (com.kickstarter.services.apiresponses.PushNotificationEnvelope)16 GCM (com.kickstarter.models.pushdata.GCM)13 OnClick (butterknife.OnClick)8 Activity (com.kickstarter.models.pushdata.Activity)8 Notification (android.app.Notification)4 Intent (android.content.Intent)4 PendingIntent (android.app.PendingIntent)2 Test (org.junit.Test)2