diff --git a/packages/neon/neon/lib/src/models/push_notification.dart b/packages/neon/neon/lib/src/models/push_notification.dart index 83dede8b..96d07497 100644 --- a/packages/neon/neon/lib/src/models/push_notification.dart +++ b/packages/neon/neon/lib/src/models/push_notification.dart @@ -38,12 +38,13 @@ class PushNotification { /// Use [PushNotification.fromJson] when the [subject] is not encrypted. factory PushNotification.fromEncrypted( final Map json, + final String accountID, final RSAPrivateKey privateKey, ) { final subject = decryptPushNotificationSubject(privateKey, json[_subjectKey] as String); return PushNotification( - accountID: json[_accountIDKey] as String, + accountID: accountID, priority: json[_priorityKey] as String, type: json[_typeKey] as String, subject: subject, diff --git a/packages/neon/neon/lib/src/utils/push_utils.dart b/packages/neon/neon/lib/src/utils/push_utils.dart index 2f71828f..3e8ba2d9 100644 --- a/packages/neon/neon/lib/src/utils/push_utils.dart +++ b/packages/neon/neon/lib/src/utils/push_utils.dart @@ -79,7 +79,11 @@ class PushUtils { final keypair = loadRSAKeypair(); for (final message in Uri(query: utf8.decode(messages)).queryParameters.values) { final data = json.decode(message) as Map; - final pushNotification = PushNotification.fromEncrypted(data, keypair.privateKey); + final pushNotification = PushNotification.fromEncrypted( + data, + instance, + keypair.privateKey, + ); if (pushNotification.subject.delete ?? false) { await localNotificationsPlugin.cancel(_getNotificationID(instance, pushNotification));