-
Notifications
You must be signed in to change notification settings - Fork 267
Closed
Description
I need some help here guys.
My implementation of notifications is very simple:
OneSignal.initWithLaunchOptions(launchOptions, appId: "46b495af-9a8c-4af8-937a-3e57d78a0029", handleNotificationReceived: { result in
print("Notification received: \(result)")
guard let typedic = result?.payload.additionalData else {
print("No additional data found, ignoring notif.")
return
}
//...
}, handleNotificationAction: { result in
print("Notification opened: \(result)")
//...
}, settings: [kOSSettingsKeyInFocusDisplayOption:OSNotificationDisplayType.none.rawValue])But, when I get the notification in the background and I tap an action button, I get this exception:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'this request has been neutered - you can't call -sendResponse: twice nor after encoding it'
I have searched a lot around and the reason seems to be the fact that the fetchCompletion is getting called twice.
More Details:
- My notification payload is actually contains both
contentsandcontent-available, but removing either one didn't help the case.
Example:
{
"app_id": "...",
"included_segments": ["All"],
"data": {"type":"..."},
"headings": {"en": "Heading"},
"subtitle": {"en": "subtitle"},
"contents": {"en": "body"},
"buttons": [{"id": "view_button", "text": "details"}]
}- I have no other code or 3rd party library concerning push notifications whatsoever.
- If I enable in-app notification's alert, the action works perfectly fine.
What am I doing wrong?
Metadata
Metadata
Assignees
Labels
No labels