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

Add support for subtitle field (iOS) #7

Merged

Conversation

hramos
Copy link
Contributor

@hramos hramos commented Mar 16, 2023

Expo push notifications can take a subtitle field that is passed on to iOS devices. This PR adds support for this field.

Test Plan

Verify in our own app

We're using laravel-notification-channels/expo in our application. I copied the changes to ExpoMessage.php from this PR into the vendor directory, and updated our code to set the subtitle field:

        return ExpoMessage::create()
            ->title($title)
            ->subtitle($subtitle)
            ->body($body)
            ->enableSound()
            ->setJsonData($jsonData)
            ->badge(1);

I was able to confirm that the push notification that is sent via Expo does in fact include a subtitle ("Notification Tests" in this case):

IMG_AAFBE111BB8B-1

Run tests

$ composer test
> phpunit
PHPUnit 8.5.33 by Sebastian Bergmann and contributors.

................                                                  16 / 16 (100%)

Time: 78 ms, Memory: 14.00 MB

OK (16 tests, 17 assertions)

@hramos hramos marked this pull request as ready for review March 16, 2023 05:53
@nicko170 nicko170 merged commit d9d3a66 into laravel-notification-channels:main Apr 2, 2023
@nicko170
Copy link
Collaborator

nicko170 commented Apr 2, 2023

Thanks @hramos - Pushed in 1.3.0.

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

Successfully merging this pull request may close these issues.

2 participants