Skip to content

Commit 9f885d2

Browse files
committed
Fixed getParcelableExtra no such method exception
1 parent 5e36d6e commit 9f885d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/notifications/push/amplify_push_notifications/android/src/main/kotlin/com/amazonaws/amplify/amplify_push_notifications/AmplifyPushNotificationsPlugin.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ class AmplifyPushNotificationsPlugin(
157157
}
158158

159159
override fun onNewIntent(intent: Intent): Boolean {
160-
val payload = NotificationPayload.fromIntent(intent)
160+
val payload = intent?.getParcelableExtra("amplifyNotificationPayload", NotificationPayload::class.java)
161+
//TODO: tyllark - Use Amplify Android when they update their fromIntent to use the new getParcelableExtra signiture
162+
//val payload = NotificationPayload.fromIntent(intent)
161163
if (payload != null) {
162164
val notificationHashMap = payload.toWritableMap()
163165
intent.extras?.let {

0 commit comments

Comments
 (0)