Search in sources :

Example 16 with GCM

use of com.kickstarter.models.pushdata.GCM in project android-oss by kickstarter.

the class PushNotifications method displayNotificationFromErroredPledge.

private void displayNotificationFromErroredPledge(@NonNull final PushNotificationEnvelope envelope) {
    final GCM gcm = envelope.gcm();
    final PushNotificationEnvelope.ErroredPledge erroredPledge = envelope.erroredPledge();
    if (erroredPledge == null) {
        return;
    }
    final Long projectId = erroredPledge.projectId();
    final Intent projectIntent = projectIntent(envelope, ObjectUtils.toString(projectId)).putExtra(IntentKey.EXPAND_PLEDGE_SHEET, true);
    final Notification notification = notificationBuilder(gcm.title(), gcm.alert(), CHANNEL_PROJECT_REMINDER).setContentIntent(projectContentIntent(envelope, projectIntent)).build();
    notificationManager().notify(envelope.signature(), notification);
}
Also used : GCM(com.kickstarter.models.pushdata.GCM) PushNotificationEnvelope(com.kickstarter.services.apiresponses.PushNotificationEnvelope) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) Notification(android.app.Notification)

Example 17 with GCM

use of com.kickstarter.models.pushdata.GCM 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

GCM (com.kickstarter.models.pushdata.GCM)17 PushNotificationEnvelope (com.kickstarter.services.apiresponses.PushNotificationEnvelope)13 Activity (com.kickstarter.models.pushdata.Activity)11 OnClick (butterknife.OnClick)8 Notification (android.app.Notification)7 ActivityFeedActivity (com.kickstarter.ui.activities.ActivityFeedActivity)3 MessagesActivity (com.kickstarter.ui.activities.MessagesActivity)3 ProjectPageActivity (com.kickstarter.ui.activities.ProjectPageActivity)3 SurveyResponseActivity (com.kickstarter.ui.activities.SurveyResponseActivity)3 UpdateActivity (com.kickstarter.ui.activities.UpdateActivity)3 PendingIntent (android.app.PendingIntent)2 Intent (android.content.Intent)2 NonNull (android.support.annotation.NonNull)1 NotificationCompat (androidx.core.app.NotificationCompat)1