React-native-onesignal: [Question] Can I set a header and a message in OneSignal.postNotification

Created on 18 Jan 2017  路  6Comments  路  Source: OneSignal/react-native-onesignal

I have the plugin working and I can send notifications to a specific user. I pass the contents object to the postNotification method, but the push notification received uses the same message as the header and the body. Is there a way to pass both a title and a message?

    let data = {'test':'hello'}
    let contents =
    {
      'en': message
    }
    OneSignal.postNotification(contents,data,this.state.userPushKey)
Help Wanted

Most helpful comment

Hello everyone,

The heading can be passed through the othersParameters parameter:
image

An example:
image

The parameters can be found at:
https://documentation.onesignal.com/reference#create-notification

Hope this helps,

All 6 comments

The current API supports contents only, i'll work on extending this API to send a parameters JSON object instead.

@avishayil That would be awesome! Thanks!

+1

Any updates on this feature?

Hi @MEDLJosh , sorry but I haven't found the time to handle this yet.
Any help would be appreciated.

Hello everyone,

The heading can be passed through the othersParameters parameter:
image

An example:
image

The parameters can be found at:
https://documentation.onesignal.com/reference#create-notification

Hope this helps,

Was this page helpful?
0 / 5 - 0 ratings