laravel-notification-channels / gcm Goto Github PK
View Code? Open in Web Editor NEWLaravel Notification Channel for Google GCM (Android)
Home Page: http://laravel-notification-channels.com/
License: MIT License
Laravel Notification Channel for Google GCM (Android)
Home Page: http://laravel-notification-channels.com/
License: MIT License
Laravel 8 has been released today and we need to update this repo to support it.
See https://laravel.com/docs/8.x/upgrade & laravel-notification-channels/channels#107
$packet->setNotification([
'title' => $message->title,
'body' => $message->message,
'sound' => $message->sound,
] + $message->data);
this part of code should be option (just like apn content-available)
When the title has any Chinese characters, str_slug()
will return ""
. Which always throw an exception of $key must be null or a non-empty string
Allow to set collapse key on GcmMessage
Hi,
I got this exception.
I've track this to code where "NotificationFailed" if fired in GcmChannel.php
That code looks like this
$this->events->fire(
new NotificationFailed($notifiable, $notification, $this, [
'token' => $token,
'error' => $result['error'],
])
);
The NotificationFailed Event function looks like this:
/**
* Create a new event instance.
*
* @param mixed $notifiable
* @param \Illuminate\Notifications\Notification $notification
* @param string $channel
* @param array $data
* @return void
*/
public function __construct($notifiable, $notification, $channel, $data = [])
{
$this->data = $data;
$this->channel = $channel;
$this->notifiable = $notifiable;
$this->notification = $notification;
}
So, I've track that problem is in $channel parameter. While event function required string to be send, GCMChannel is sending $this object which latter cannot be serialised for queueing.
As of today google has announced to deprecate gcm and discontinue the service on the 11th of April in 2019, might be best to put up a deprecation notice in the package also?
For some reason in GCM Service Provider, when setpApiKey function is called, it doesn't transfer string.
I've setup string in env file, and array in broadcasting file.
Also, I've try to dump it in home controller, and it worked fine.
$gcmConfig = config('broadcasting.connections.gcm');
dd($gcmConfig['key']);
But in that function, it doesn't pass as I'm getting this exception.
exception 'ZendService\Google\Exception\InvalidArgumentException' with message 'The api key must be a string and not empty' in /home/vendor/zendframework/zendservice-google-gcm/library/ZendService/Google/Gcm/Client.php:64
Can we tag a new release so able to use package auto discovery without require dev-master?
Zend updated their GCM library with support for FCM a few months ago.
The release notes are here: https://github.com/zendframework/ZendService_Google_Gcm/releases/tag/release-2.0.0
FCM adds more features to push notifications, and Google are strongly advising all users on GCM to upgrade to FCM. Details on the differences from GCM to FCM are here: https://developers.google.com/cloud-messaging/faq
Migrating to this newer version and adding support for notification priorities would fix #6
And currently we cannot notification without title value because line 75 in GcmChannel.php
$packet->setCollapseKey(str_slug($message->title));
As it says in GCM documentation, title isn't required for iOS but it is for Android.
https://developers.google.com/cloud-messaging/http-server-ref
Hi,
Is it possible to get error in GCM directly in notification variable?
Something like $result = $user->notify(new GCMMessage($data));
So I can catch potential errors in $result.
Now it's always null no matter did GCM went through or not.
Really very nice package. Please add support for multiple apps like setting up GCM key dynamically.
When can we expect the update for Laravel 5.4?
Like title, priority - there is option to add sound to payload
Let me know when you're done with the initial code / tests / readme. I'll do a code review and set up packages, and other services
Hi,
There is possibility to send push notifications to iOS devices through GCM.
But message that is send to GCM need to have specific structure which I couldn't accomplish with this package.
Is there plan maybe to add this option as well in this package? As it would be cool option to send both iOS and Android notifications through same package.
Kind regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.