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

postNotification contents and data format #100

Closed
psyzz opened this issue Oct 29, 2016 · 3 comments
Closed

postNotification contents and data format #100

psyzz opened this issue Oct 29, 2016 · 3 comments

Comments

@psyzz
Copy link

psyzz commented Oct 29, 2016

Hi,

i'm trying to user OneSignal.postNotification, but i didn't find an example for contents and data format:

OneSignal.postNotification(contents, data, player_id);

Do i need to set contents like { title: 'Title', message: 'Message' } ?

Thanks for your great work

@avishayil
Copy link
Contributor

Hi, you should follow OneSignal documentation for this:
https://documentation.onesignal.com/docs/android-native-sdk#section--postnotification-

Your'e basically passing the same parameters as here:
https://documentation.onesignal.com/reference#create-notification

data is responsible for the data you want to transfer.

I.E:

        let data = arr // some array
        let contents = {
            'en': 'You got notification from user'
        }
        OneSignal.postNotification(contents, data, playerId);

@psyzz
Copy link
Author

psyzz commented Nov 1, 2016

Thank you !

@readelobdill
Copy link

Hey there,

Does this library currently support headings parameter as outlined in OneSignal create notification documentation?

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