We are currently using the "firebase-php" library to support Push notifications within the EC2 server.
https://github.com/kreait/firebase-php
We are trying to install and test the notification confirmation, but we are unable to clear the error log below.
local.ERROR: Class'App\Http\Controllers\Api\Firebase\Factory'not found
I installed it using composer, but I am trying to find a path other than /home/ec2-user/vendor/kreait/firebase-php/src/firebase
.
This may be a basic question, but I would appreciate it if you could tell me how to solve it.
use Kreait\Firebase\Factory;
use Kreait\Firebase\ServiceAccount;
use Kreait\Firebase\Messaging\CloudMessage;
(new Firebase\Factory())
- > with ServiceAccount ([
'type' = > 'direct input',
'project_id' = > 'direct input',
'client_id' = > 'direct input',
'client_email' = > 'direct input',
'private_key' = > 'direct input',
]) - > createMessaging()
->send(
CloudMessage::withTarget('token', 'direct input')
->withNotification(
Firebase\Messaging\Notification::create(
US>'Notification Test',
'Send from server'
)
)
);
The code is like this.
For testing purposes, I have entered my ID and token directly.
I'm sorry to trouble you, but I appreciate your cooperation.
(new Firebase\Factory())
(new Factory())
By changing to use Kreait\Firebase\Factory;
Factory
.
917 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
582 PHP ssh2_scp_send fails to send files as intended
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.