mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-31 19:20:34 +00:00
Updated identifiers. Fixed party notification
This commit is contained in:
parent
31f4ea6c0d
commit
17f3e87050
3 changed files with 8 additions and 8 deletions
|
|
@ -47,12 +47,12 @@ public class PartyInviteLocalNotification implements HabiticaLocalNotification {
|
||||||
);
|
);
|
||||||
notificationBuilder.addAction(R.drawable.ic_gryphon, "Accept", pendingIntentAccept);
|
notificationBuilder.addAction(R.drawable.ic_gryphon, "Accept", pendingIntentAccept);
|
||||||
|
|
||||||
Intent rejectInviteIntent = new Intent();
|
Intent rejectInviteIntent = new Intent(context, LocalNotificationActionReceiver.class);
|
||||||
rejectInviteIntent.setAction(res.getString(R.string.reject_party_invite));
|
rejectInviteIntent.setAction(res.getString(R.string.reject_party_invite));
|
||||||
PendingIntent pendingIntentReject = PendingIntent.getBroadcast(
|
PendingIntent pendingIntentReject = PendingIntent.getBroadcast(
|
||||||
context,
|
context,
|
||||||
2000,
|
2000,
|
||||||
acceptInviteIntent,
|
rejectInviteIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
);
|
);
|
||||||
notificationBuilder.addAction(R.drawable.ic_gryphon, "Reject", pendingIntentReject);
|
notificationBuilder.addAction(R.drawable.ic_gryphon, "Reject", pendingIntentReject);
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ public class PushNotificationManager {
|
||||||
private static PushNotificationManager instance = null;
|
private static PushNotificationManager instance = null;
|
||||||
public static String DEVICE_TOKEN_PREFERENCE_KEY = "device-token-preference";
|
public static String DEVICE_TOKEN_PREFERENCE_KEY = "device-token-preference";
|
||||||
|
|
||||||
public static String PARTY_INVITE_PUSH_NOTIFICATION_KEY = "Invited To Party";
|
public static String PARTY_INVITE_PUSH_NOTIFICATION_KEY = "invitedParty";
|
||||||
public static String RECEIVED_PRIVATE_MESSAGE_PUSH_NOTIFICATION_KEY = "newPM";
|
public static String RECEIVED_PRIVATE_MESSAGE_PUSH_NOTIFICATION_KEY = "newPM";
|
||||||
public static String RECEIVED_GEMS_PUSH_NOTIFICATION_KEY = "Gems";
|
public static String RECEIVED_GEMS_PUSH_NOTIFICATION_KEY = "giftedGems";
|
||||||
public static String RECEIVED_SUBSCRIPTION_GIFT_PUSH_NOTIFICATION_KEY = "Subscription";
|
public static String RECEIVED_SUBSCRIPTION_GIFT_PUSH_NOTIFICATION_KEY = "giftedSubscription";
|
||||||
public static String GUILD_INVITE_PUSH_NOTIFICATION_KEY = "invitedGuild";
|
public static String GUILD_INVITE_PUSH_NOTIFICATION_KEY = "invitedGuild";
|
||||||
public static String QUEST_INVITE_PUSH_NOTIFICATION_KEY = "questInvitation";
|
public static String QUEST_INVITE_PUSH_NOTIFICATION_KEY = "questInvitation";
|
||||||
public static String QUEST_BEGUN_PUSH_NOTIFICATION_KEY = "questStarted";
|
public static String QUEST_BEGUN_PUSH_NOTIFICATION_KEY = "questStarted";
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ public class LocalNotificationActionReceiver extends BroadcastReceiver implement
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleLocalNotificationAction(String action) {
|
private void handleLocalNotificationAction(String action) {
|
||||||
|
NotificationManager notificationManager = (NotificationManager) this.conext.getSystemService(this.conext.NOTIFICATION_SERVICE);
|
||||||
|
notificationManager.cancel(10);
|
||||||
|
|
||||||
//@TODO: This is a good place for a factory and event emitter pattern
|
//@TODO: This is a good place for a factory and event emitter pattern
|
||||||
if (action.equals(this.resources.getString(R.string.accept_party_invite))) {
|
if (action.equals(this.resources.getString(R.string.accept_party_invite))) {
|
||||||
if (this.user.getInvitations().getParty() == null) return;
|
if (this.user.getInvitations().getParty() == null) return;
|
||||||
|
|
@ -90,8 +93,5 @@ public class LocalNotificationActionReceiver extends BroadcastReceiver implement
|
||||||
.compose(apiHelper.configureApiCallObserver())
|
.compose(apiHelper.configureApiCallObserver())
|
||||||
.subscribe(aVoid -> {}, throwable -> {});
|
.subscribe(aVoid -> {}, throwable -> {});
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationManager notificationManager = (NotificationManager) this.conext.getSystemService(this.conext.NOTIFICATION_SERVICE);
|
|
||||||
notificationManager.cancel(10);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue