Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit cad5ef5

Browse files
authored
Merge pull request brozot#88 from Fawzanm/master
Fixed two issues in the readme
2 parents 61aa6fc + 474933c commit cad5ef5

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## Introduction
77

8-
Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) (FCM).
8+
Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/) (FCM).
99

1010
It currently **only supports HTTP protocol** for :
1111

@@ -41,7 +41,7 @@ Register the provider directly in your app configuration file config/app.php `co
4141
```php
4242
'providers' => [
4343
// ...
44-
44+
4545
LaravelFCM\FCMServiceProvider::class,
4646
]
4747
```
@@ -68,7 +68,7 @@ Publish the package config file using the following command:
6868

6969
Register the provider in your boostrap app file ```boostrap/app.php```
7070

71-
Add the following line in the "Register Service Providers" section at the bottom of the file.
71+
Add the following line in the "Register Service Providers" section at the bottom of the file.
7272

7373
```php
7474
$app->register(LaravelFCM\FCMServiceProvider::class);
@@ -130,7 +130,7 @@ $optionBuilder->setTimeToLive(60*20);
130130
$notificationBuilder = new PayloadNotificationBuilder('my title');
131131
$notificationBuilder->setBody('Hello world')
132132
->setSound('default');
133-
133+
134134
$dataBuilder = new PayloadDataBuilder();
135135
$dataBuilder->addData(['a_data' => 'my_data']);
136136

@@ -147,10 +147,10 @@ $downstreamResponse->numberFailure();
147147
$downstreamResponse->numberModification();
148148

149149
//return Array - you must remove all this tokens in your database
150-
$downstreamResponse->tokensToDelete();
150+
$downstreamResponse->tokensToDelete();
151151

152152
//return Array (key : oldToken, value : new token - you must change the token in your database )
153-
$downstreamResponse->tokensToModify();
153+
$downstreamResponse->tokensToModify();
154154

155155
//return Array - you should try to resend the message to the tokens in the array
156156
$downstreamResponse->tokensToRetry();
@@ -167,7 +167,7 @@ $optionBuilder->setTimeToLive(60*20);
167167
$notificationBuilder = new PayloadNotificationBuilder('my title');
168168
$notificationBuilder->setBody('Hello world')
169169
->setSound('default');
170-
170+
171171
$dataBuilder = new PayloadDataBuilder();
172172
$dataBuilder->addData(['a_data' => 'my_data']);
173173

@@ -181,20 +181,20 @@ $tokens = MYDATABASE::pluck('fcm_token')->toArray();
181181
$downstreamResponse = FCM::sendTo($tokens, $option, $notification, $data);
182182

183183
$downstreamResponse->numberSuccess();
184-
$downstreamResponse->numberFailure();
184+
$downstreamResponse->numberFailure();
185185
$downstreamResponse->numberModification();
186186

187187
//return Array - you must remove all this tokens in your database
188-
$downstreamResponse->tokensToDelete();
188+
$downstreamResponse->tokensToDelete();
189189

190190
//return Array (key : oldToken, value : new token - you must change the token in your database )
191-
$downstreamResponse->tokensToModify();
191+
$downstreamResponse->tokensToModify();
192192

193193
//return Array - you should try to resend the message to the tokens in the array
194194
$downstreamResponse->tokensToRetry();
195195

196-
// return Array (key:token, value:errror) - in production you should remove from your database the tokens present in this array
197-
$downstreamResponse->tokensWithError();
196+
// return Array (key:token, value:errror) - in production you should remove from your database the tokens present in this array
197+
$downstreamResponse->tokensWithError();
198198
```
199199

200200
### Topics Messages
@@ -215,17 +215,17 @@ use LaravelFCM\Message\Topics;
215215
$notificationBuilder = new PayloadNotificationBuilder('my title');
216216
$notificationBuilder->setBody('Hello world')
217217
->setSound('default');
218-
218+
219219
$notification = $notificationBuilder->build();
220220

221221
$topic = new Topics();
222222
$topic->topic('news');
223223

224-
$topicResponse = FCM::sendToTopic($topic, null, $notification, null)
224+
$topicResponse = FCM::sendToTopic($topic, null, $notification, null);
225225

226226
$topicResponse->isSuccess();
227227
$topicResponse->shouldRetry();
228-
$topicResponse->error());
228+
$topicResponse->error();
229229
```
230230

231231
#### Sending a Message to Multiple Topics
@@ -241,14 +241,14 @@ It sends notification to devices registered at the following topics:
241241
$notificationBuilder = new PayloadNotificationBuilder('my title');
242242
$notificationBuilder->setBody('Hello world')
243243
->setSound('default');
244-
244+
245245
$notification = $notificationBuilder->build();
246246

247247
$topic = new Topics();
248248
$topic->topic('news')->andTopic(function($condition) {
249249

250250
$condition->topic('economic')->orTopic('cultural');
251-
251+
252252
});
253253

254254
$topicResponse = FCM::sendToTopic($topic, null, $notification, null);

0 commit comments

Comments
 (0)