Category : firebase

I follow this link in order to delete a child on Realtime Firebase. https://firebase-php.readthedocs.io/en/stable/realtime-database.html#delete-data It work’s in localhost (my local dev environment) but when I put the website on production (using shared hosting) it doesn’t work. I can write with push() method new child, I can read also, but I cannot delete them. In my ..

Read more

I want to integrate firebase OTP in laravel API , I went through the documentation https://www.positronx.io/laravel-firebase-phone-number-otp-authentication-tutorial/ but got stucked when I had to use the javascript code inside the blade.php file as I am working on controller file I couldnt code script inside controller. Is there anyway to make it worked on controller php file ..

Read more

Composer has been installed with laravel. However, each command is resulting into failing with the error message below. $ composer require kreait/laravel-firebase Using version ^3.1 for kreait/laravel-firebase ./composer.json has been updated Running composer update kreait/laravel-firebase Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. ..

Read more

halo . i’m try library fcm from https://github.com/kreait/laravel-firebase , this my config ‘credentials’ => [ ‘file’ => public_path(‘serviceaccount.json’), // config service account from firebase /* * If you want to prevent the auto discovery of credentials, set the * following parameter to false. If you disable it, you must * provide a credentials file. */ ..

Read more

PHP Warning: Module ‘grpc’ already loaded in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library ‘protobuf.so’ (tried: /usr/lib/php/20190902/protobuf.so (/usr/lib/php/20190902/protobuf.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/protobuf.so.so (/usr/lib/php/20190902/protobuf.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0Configuration File (php.ini) Path: /etc/php/7.4/cli Source: ..

Read more

step 1: This is my controller code. firebase file and firebase DB are connected properly. but when run in postman i got 500 error but I am new on firebase show I don’t know how can I resolved this public function ride_confirm(Request $request) { $input = $request->all(); $validator = Validator::make($input, [ ‘km’ => ‘required’, ‘vehicle_type’ ..

Read more

** .. Unable to sending push notification to android using laravel8 and firebase getting error invalid :[{"error":"InvalidRegistration"}] find my code below , Is am not setup my app correctly or something wrong in my code..** public function send(Request $request) { return $this->sendNotification($request->device_token, [ "title" => "Sample Message", "body" => "This is Test message body" ]); ..

Read more

I have encounter an issue when I want to deploy my web apps on Vercel. I am developing an apps that has login function. At local environment, everything is good, login/logout function works well but when I deploy to Vercel, it show errors The token is invalid: file_put_contents(/var/task/user/storage/framework/cache/data/24/fc/24fc69d48eaa682f929a7045e8f4700237c0083e): failed to open stream: No such file ..

Read more

There is an error at method claims(). What I want to do is get the uid from the verified token (I think ?). try { $verifiedIdToken = $auth->verifyIdToken($idTokenString); $uid = $verifiedIdToken->claims()->get(‘sub’); $_SESSION[‘verified_user_id’] = $$uid; $_SESSION[‘idTokernString’] = $idTokenString; $_SESSION[‘status’] = "Logged in successfully"; return redirect()->route(‘userHomepage’); } There is someone having the same issue here but kinda ..

Read more

I am trying to connect my localhost apps to firebase. The firebase controller works fine with the code below: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use KreaitFirebase; use KreaitFirebaseFactory; use KreaitFirebaseServiceAccount; use KreaitFirebaseDatabase; class FirebaseController extends Controller { protected $database; public function __construct() { $this->database = app(‘firebase.database’); } public function index() { $factory = (new Factory) ..

Read more

$fields = array( "to" => $login_device_token->token, "notification" => array( "title" => ‘Call’, "click_action" =>’FLUTTER_NOTIFICATION_CLICK’), "data" => array( "type" => $msg_type, "id" => $msg_id, "sub_no" => $sub_no, "name" => $name, "image" => $image, ), "content_available" =>true, ); $headers = array( ‘Authorization: key=KEY’, ‘Content-Type:application/json’ ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); ..

Read more

I’m getting this error Error: Call to a member function remove() on array in file How can I remove specific data from array where clinic_id matches? $factory = (new Factory())->withServiceAccount($app) ->withDatabaseUri(‘db’); $database = $factory->createDatabase(); $reference = $database->getReference(‘list_notification’)->getValue(); foreach ($reference as $ref){ if($ref["clinic_id"] === $clinicId){ $ref->remove(); } } Sourc..

Read more