mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-21 05:15:00 +00:00
Bug fix message notification not opening chat (#1662)
* added resources to run project * bug fix for message notification not opening the conversation when the notification is clicked * removed unnecessary changes
This commit is contained in:
parent
b77158d244
commit
ed39758118
2 changed files with 10 additions and 4 deletions
|
|
@ -19,7 +19,7 @@ class NotificationOpenHandler {
|
|||
PushNotificationManager.QUEST_BEGUN_PUSH_NOTIFICATION_KEY -> openPartyScreen()
|
||||
PushNotificationManager.QUEST_INVITE_PUSH_NOTIFICATION_KEY -> openPartyScreen()
|
||||
PushNotificationManager.GUILD_INVITE_PUSH_NOTIFICATION_KEY -> openGuildDetailScreen(intent.getStringExtra("groupID"))
|
||||
PushNotificationManager.RECEIVED_PRIVATE_MESSAGE_PUSH_NOTIFICATION_KEY -> openPrivateMessageScreen(intent.getStringExtra("replyTo"))
|
||||
PushNotificationManager.RECEIVED_PRIVATE_MESSAGE_PUSH_NOTIFICATION_KEY -> openPrivateMessageScreen(intent.getStringExtra("replyToUUID"), intent.getStringExtra("replyToUsername"))
|
||||
PushNotificationManager.CHANGE_USERNAME_PUSH_NOTIFICATION_KEY -> openSettingsScreen()
|
||||
PushNotificationManager.GIFT_ONE_GET_ONE_PUSH_NOTIFICATION_KEY -> openSubscriptionScreen()
|
||||
PushNotificationManager.CHAT_MENTION_NOTIFICATION_KEY -> handleChatMessage(intent.getStringExtra("type"), intent.getStringExtra("groupID"))
|
||||
|
|
@ -38,9 +38,9 @@ class NotificationOpenHandler {
|
|||
MainNavigationController.navigate(R.id.gemPurchaseActivity, bundleOf(Pair("openSubscription", true)))
|
||||
}
|
||||
|
||||
private fun openPrivateMessageScreen(userID: String?) {
|
||||
if (userID != null) {
|
||||
MainNavigationController.navigate(R.id.inboxMessageListFragment, bundleOf("userID" to userID))
|
||||
private fun openPrivateMessageScreen(userID: String?, userName: String?) {
|
||||
if (userID != null && userName != null) {
|
||||
MainNavigationController.navigate(R.id.inboxMessageListFragment, bundleOf("userID" to userID, "username" to userName))
|
||||
} else {
|
||||
MainNavigationController.navigate(R.id.inboxFragment)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,12 @@ class ReceivedPrivateMessageLocalNotification(context: Context, identifier: Stri
|
|||
return data["senderName"].hashCode()
|
||||
}
|
||||
|
||||
override fun configureMainIntent(intent: Intent) {
|
||||
super.configureMainIntent(intent)
|
||||
intent.putExtra("replyToUUID", data?.get("replyTo"))
|
||||
intent.putExtra("replyToUsername", data?.get("senderName"))
|
||||
}
|
||||
|
||||
override fun setNotificationActions(notificationId: Int, data: Map<String, String>) {
|
||||
super.setNotificationActions(notificationId, data)
|
||||
val senderID = data["replyTo"] ?: return
|
||||
|
|
|
|||
Loading…
Reference in a new issue