davibennun / laravel-push-notification

Laravel package to enable sending push notifications to devices
1.23k stars 259 forks source link

deviceToken #108

Open KaminoU opened 8 years ago

KaminoU commented 8 years ago

Hi all,

in the example we have this tips :

PushNotification::app('appNameIOS') ->to($deviceToken) ->send('Hello World, i`m a push message');

My main concern is, how to retrieve the $deviceToken?

Thank you for your reply

abhijeetnaik commented 8 years ago

Hi, you have to get device token from your iOS app. You have to enable APNS push notification service in your app. Once you do that you will get a token like this one "a93a0bXXXXXXXXXXXccd9ea43ec3fd636359865d65" also make sure you have right certificates in place , don't forget to enable PushNotification in capabilities section in build settings.

KaminoU commented 8 years ago

thanks for replying

I am on android and wondering how to get the deviceToken of my logged users to push msg on specific case only...

I have an alternative that is emailing but if I can push it would be great =)

abhijeetnaik commented 8 years ago

thats make life even more easier if you are on android, so if you creating native android app, http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ Once you are done setting up gcm on android, it will return you a token and you can post to your PHP function and use the latter deviceToken.

KaminoU commented 8 years ago

thank you I will try =)

abhijeetnaik commented 8 years ago

your welcome, once done don't forget to like my answer :+1: :D

KaminoU commented 8 years ago

lol =D

relativokobe commented 7 years ago

How to use for FCM? google doesn support gcm anymore :(