add check for PNs from other namespaces

pull/1061/head
Ryan ZHAO 3 months ago
parent 6aa77a966a
commit 07e75d0cca

@ -435,7 +435,16 @@ public enum PushNotificationAPI {
// If the metadata says that the message was too large then we should show the generic
// notification (this is a valid case)
guard !notification.info.dataTooLong else { return (nil, notification.info, .successTooLong) }
guard !notification.info.dataTooLong else {
SNLog("Ignoring notification due to data being too long")
return (nil, notification.info, .successTooLong)
}
// Only show notifcations for messages from default namespace
guard notification.info.namespace == .default else {
SNLog("Ignoring notification due to namespace being \(notification.info.namespace) instead of default")
return (nil, notification.info, .failureNoContent)
}
// Check that the body we were given is valid
guard

Loading…
Cancel
Save