Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access Additional data in func didReceive(_ notification: UNNotification) { #170

Closed
appcelerate opened this issue Jan 4, 2017 · 3 comments

Comments

@appcelerate
Copy link

How can I access in
func didReceive(_ notification: UNNotification) {
the additional data from the payload?

@jkasten2
Copy link
Member

jkasten2 commented Jan 7, 2017

@appcelerate You should setup a OSHandleNotificationActionBlock block which will give you a Object where this has been parsed for you. See initWithLaunchOptions for an example of setting one up.

@jkasten2
Copy link
Member

jkasten2 commented Feb 7, 2017

Closing due to inactively. Feel free to reopen if you have more questions on this callback.

@jkasten2 jkasten2 closed this as completed Feb 7, 2017
@ADevelopStudio
Copy link

ADevelopStudio commented Sep 5, 2017

@appcelerate if you still need it:

guard let customData = notification.request.content.userInfo["custom"] as? Dictionary<String,Any> else { return }
guard let oneSignalAdditionalData = customData["a"]  as? Dictionary<String,String> else { return }

Remember! Additional data is always [String: String]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants