Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Edujugon committed Jul 12, 2016
1 parent 177f7ec commit 336dfb5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog

## v2.1
Laravel Facade Usage integrated into the package.

Now if you wanna get the Push Feedback after sending a notification you can chain the method getFeedback after send method.


## v2.0

Now you can create the object with the push service provider only typing the name
Expand Down
39 changes: 29 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type in console:

Or update your composer.json file.

"edujugon/push-notification": "2.0.*"
"edujugon/push-notification": "2.1.*"

Then

Expand Down Expand Up @@ -88,7 +88,7 @@ Even you may update the url of the Push Service dynamically like so:

$puhs->setUrl('http://newPushServiceUrl.com');

> Not update the url unless it's necessary.
> Not update the url unless it's really necessary.
### Filling the Notification options

Expand Down Expand Up @@ -135,20 +135,28 @@ If you want send the notification to only 1 device, you may pass the value as st

### Send the Notification

Method send() returns Push service Respose as an Object (stdClass).
Method send() can be also chained to the above methods.

$push->send();
$push->setMessage(['message'=>'This is the message','title'=>'This is the title'])
->setApiKey('Server-API-Key')
->setDevicesToken(['deviceToken1','deviceToken2','deviceToken3'...])
->send();

### Review the Notification Response
### Retrieve the Notification Response

If you want to retrieve the push service response again, then:
If you want to retrieve the push service response, you can call the method getFeedback:

$push->feedback;
$push->getFeedback();

or
Or again, chain it to the above methods:

$push->service->feedback;
$push->setMessage(['message'=>'This is the message','title'=>'This is the title'])
->setApiKey('Server-API-Key')
->setDevicesToken(['deviceToken1','deviceToken2','deviceToken3'...])
->send()
->getFeedback();

It will return an object with the response.

### Check if there was any error sending the push notification

Expand All @@ -162,5 +170,16 @@ After sending a notification, you may retrieve the list of unregistered tokens

$push->getUnregisteredDeviceTokens();

This method returns an array of unregistered tokens from the Push service provider. If there aren't any unregistered tokens, returns an empty array.
This method returns an array of unregistered tokens from the Push service provider. If there isn't any unregistered token, it will return an empty array.

### Laravel Alias Facade

After register the Alias Facade for this Package, you can use it like follows:

PushNotification::setMessage(['message'=>'This is the message','title'=>'This is the title'])
->setApiKey('Server-API-Key')
->setDevicesToken(['deviceToken1','deviceToken2','deviceToken3'...])
->send()
->getFeedback();

It would return the Push Feedback of the Notification sent.

0 comments on commit 336dfb5

Please sign in to comment.