berkayk / laravel-onesignal

OneSignal Push Notifications for Laravel
505 stars 175 forks source link

Added a method to cancel the scheduled OneSignal notifications #81

Closed zzeebbii closed 6 years ago

zzeebbii commented 6 years ago

Notification can be cancelled by passing the ID of it. Delete method is also added as it requires a DELETE HTTP method to cancel a notification

NaturalDevCR commented 6 years ago

This is great, but i have a question, how do you get the Notification ID? when we create a new notification, how do we store that specific ID, so we can use it in the future to delete it? Thanks in advance

zzeebbii commented 6 years ago

@LaravDev Actually none of the method is returning the results from OneSignal except SendCustomNotification. I'll add a method to get response from OneSignal and Will add a merge request again. I was away but now I'm back :-)

NaturalDevCR commented 6 years ago

@zzeebbii That's great!, thanks for your efforts!

NaturalDevCR commented 6 years ago

@zzeebbii so, if i use the SendCustomNotification, i'll get all the data back from OneSignal? how? sorry for asking

zzeebbii commented 6 years ago

@LaravDev Yes, SendCustomNotification returns a Guzzle response. You can use it's getBody method to read the response from OneSignal.

NaturalDevCR commented 6 years ago

@zzeebbii sorry for asking, but i just can't figure out how to get the notification id to cancel it later, can please kindly show an example of how could this be done with SendCustomNotification? thanks in advance!

NaturalDevCR commented 6 years ago

Nevermind, i did it!, and thanks anyway!