1111
1212## Contents
1313
14- - [ Installation] ( #installation )
15- - [ Usage] ( #usage )
16- - [Available Message methods](#available-message-methods)
17- - [ Changelog] ( #changelog )
18- - [ Testing] ( #testing )
19- - [ Security] ( #security )
20- - [ Contributing] ( #contributing )
21- - [ Credits] ( #credits )
22- - [ License] ( #license )
23-
14+ - [ Installation] ( #installation )
15+ - [ Usage] ( #usage ) - [ Available Message methods] ( #available-message-methods )
16+ - [ Changelog] ( #changelog )
17+ - [ Testing] ( #testing )
18+ - [ Security] ( #security )
19+ - [ Contributing] ( #contributing )
20+ - [ Credits] ( #credits )
21+ - [ License] ( #license )
2422
2523## Installation
24+
2625You can install the package via composer:
26+
2727``` bash
2828composer require alymosul/laravel-exponent-push-notifications
2929```
@@ -38,11 +38,15 @@ If you are using Laravel 5.5 or higher this package will automatically register
3838],
3939
4040```
41- Before publish exponent notification migration you must add in .env file:
41+
42+ Before publish exponent notification migration you must add in .env file:
43+
4244``` bash
4345EXPONENT_PUSH_NOTIFICATION_INTERESTS_STORAGE_DRIVER=database
4446```
47+
4548You can publish the migration with:
49+
4650``` bash
4751php artisan vendor:publish --provider=" NotificationChannels\ExpoPushNotifications\ExpoPushNotificationsServiceProvider" --tag=" migrations"
4852```
@@ -54,6 +58,7 @@ php artisan migrate
5458```
5559
5660You can optionally publish the config file with:
61+
5762``` bash
5863php artisan vendor:publish --provider=" NotificationChannels\ExpoPushNotifications\ExpoPushNotificationsServiceProvider" --tag=" config"
5964```
@@ -77,7 +82,7 @@ return [
7782
7883## Usage
7984
80- ``` php
85+ ``` php
8186use NotificationChannels\ExpoPushNotifications\ExpoChannel;
8287use NotificationChannels\ExpoPushNotifications\ExpoMessage;
8388use Illuminate\Notifications\Notification;
@@ -94,6 +99,7 @@ class AccountApproved extends Notification
9499 return ExpoMessage::create()
95100 ->badge(1)
96101 ->enableSound()
102+ ->title("Congratulations!")
97103 ->body("Your {$notifiable->service} account was approved!");
98104 }
99105}
@@ -102,11 +108,15 @@ class AccountApproved extends Notification
102108### Available Message methods
103109
104110A list of all available options
105- - ` body('') ` : Accepts a string value for the body.
106- - ` enableSound() ` : Enables the notification sound.
107- - ` disableSound() ` : Mutes the notification sound.
108- - ` badge(1) ` : Accepts an integer value for the badge.
109- - ` ttl(60) ` : Accepts an integer value for the time to live.
111+
112+ - ` title('') ` : Accepts a string value for the title.
113+ - ` body('') ` : Accepts a string value for the body.
114+ - ` enableSound() ` : Enables the notification sound.
115+ - ` disableSound() ` : Mutes the notification sound.
116+ - ` badge(1) ` : Accepts an integer value for the badge.
117+ - ` ttl(60) ` : Accepts an integer value for the time to live.
118+ - ` jsonData('') ` : Accepts a json string or an array for additional.
119+ - ` channelID('') ` : Accepts a string to set the channelId of the notification for Android devices.
110120
111121### Managing Recipients
112122
@@ -122,7 +132,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen
122132
123133## Testing
124134
125- ``` bash
135+ ``` bash
126136$ composer test
127137```
128138
@@ -136,8 +146,8 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
136146
137147## Credits
138148
139- - [ Aly Suleiman] ( https://github.com/Alymosul )
140- - [ All Contributors] ( ../../contributors )
149+ - [ Aly Suleiman] ( https://github.com/Alymosul )
150+ - [ All Contributors] ( ../../contributors )
141151
142152## License
143153
0 commit comments