Closed chancezeus closed 6 years ago
Any update on this?
@chancezeus
you can send data (key,value) by using setData
function in OneSignalMessage
class, here is an example:
public function toOneSignal($notifiable)
{
return OneSignalMessage::create()
->subject($subject)
->body($body)
->url($url)
->setData('show_notification',true);
}
@aliwesome that only adds "custom" data not api properties like ios_badgeType, I requested the ability to add (custom) api properties (and this also ensures that even when the rest api is updated, this package supports everything, instead of only functionality that is available in the latest release).
I just used the example provided here for PHP as a temporary workaround.
I'm wondering if it would be possible (and within the scope of this plugin) to add functionality for setting ios badge information and/or other additional API parameters (content_available, subtitle, attachments) when sending a notification. Maybe through a setParameter/addParameter function (or a __call fluent syntax where ->ios_badgeType sets the badge parameter)...