kutia-software-company/larafirebase

Ability to set notification sound?

exzachlyvv opened this issue · 1 comments

To set the notification sound, the Firebase Cloud Messaging payload must have a notification.sound key.

Supports default or the filename of a sound resource bundled in the app.

Referenced in this StackOverflow post.

Let's add the ability to add a sound key.

Thanks for this

I will recheck because larafirebase already has some basic data you can send like:

withTitle
withBody
withImage
withClickAction
withPriority

If you want to send anything you like you can use from raw method:

Larafirebase::fromRaw([
    'registration_ids' => ['token1', 'token2'],
    'data' => [
        'key_1' => 'Value 1',
        'key_2' => 'Value 2'
    ],
    'android' => [
        'ttl' => '1000s',
        'priority' => 'normal',
        'notification' => [
            'key_1' => 'Value 1',
            'key_2' => 'Value 2'
        ],
    ],
])->send();