lkaybob / php-fcm-v1 Goto Github PK
View Code? Open in Web Editor NEWImplementation of Firebase Cloud Messaging HTTP v1 API in PHP
Home Page: https://packagist.org/packages/lkaybob/php-fcm-v1
License: MIT License
Implementation of Firebase Cloud Messaging HTTP v1 API in PHP
Home Page: https://packagist.org/packages/lkaybob/php-fcm-v1
License: MIT License
Build is failing, since [email protected] has been released. It seem that timelib
has been updated inside the released PHP, and I am working on this issue.
This package doesn't guarantee working on Laravel. It would be better to create new package, wrapping this package.
When using a payload for example:
{"notification":{"title":"We are opening soon","body":"test"}, "android": {"notification": {"sound": "soon.wav","channel_id":"soon"}}}
The "android" part is being overwritten when you set setPriority or setTimeToLive.
it is then overwritten by
"android":{"priority":"HIGH","ttl":"86400s"}
We could fix it by modifying "Client.php" to use array_replace_recursive instead of array_merge
if (!is_null($notification)) { $result = array_replace_recursive($result, $notification()); $isPlayload = true; }
if (!is_null($data)) { $result = array_replace_recursive($result, $data()); $isPlayload = true; }
if (!is_null($config)) { $result = array_replace_recursive($result, $config()); }
Which will result in:
"android":{"notification":{"sound":"soon.wav","channel_id":"soon"},"priority":"HIGH","ttl":"86400s"}
There might be a need not to hold JSON file as it is. Some users could holde credential information in a secret (For example, Vault by HashiCorp)
Spliting credentials configuration would be able to adapt those cases.
Impacted by Codecov security issue
I've tried with something like:
$data = [];
$data['id'] = 10;
$data['link'] = 'https://www.github.com';
$client -> build($recipient, $notification, $data);
But got this error: "Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to phpFCMv1\Client::build() must be an instance of phpFCMv1\Data or null, array given"
...but $data is an array...
What's wrong?
Thanks.
For better usage, two things could be useful.
Need to add proxy option during calling fire method
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.