Category : firebase

I’m encountering a strange behavior with Laravel Jobs and Google Cloud Firestore. This works: Route::get(‘/insert’, function() { $docRef = Firebase::firestore()->database()->collection(‘stats’)->newDocument(); $docRef->set([ ‘from’ => 0, ‘to’ => 100, ‘created_at’ => now() ]); echo "<h1>".’inserted’."</h1>"; }); But when I put the same code in a Laravel queue job, the job works until the $docRef definition then freezes ..

Read more

I am using Kreait Package for Laravel firebase Authentication and other firebase services I found how to create user and signing with different methods such as email and password, custom token, Idp …etc but I don’t find how to signing with phone number and get verification by SMS here is the documentation I read but ..

Read more

I searched a lot around but I couldn’t find a proper way to simply get current date from Firebase Realtime Database. I would like to use it to set a property called "creation_date". What I have tried to do: use GoogleCloudFirestoreFieldValue; … $newOrderData = [ ‘creation_date’ => firebase.firestore.FieldValue.serverTimestamp(), // or FieldValue::serverTimestamp() ‘order_status’ => ‘TO_BE_PAID’, ‘products’ ..

Read more

I was going through a blog and stuck at with the below code it says Now in yourview.blade.php, you have to add a script file. From here begins the work of Javascript SDK <script src="https://www.gstatic.com/firebasejs/7.13.1/firebase.js"></script> Now add this script code <script> document.addEventListener(‘DOMContentLoaded’, function() { var mode = fetchParamsbyUrl(‘mode’); var actionCode = fetchParamsbyUrl(‘oobCode’); var continueUrl = ..

Read more

the image not downloads in storage firebase correctly i need to upload image in storages and return the link of the image uploaded this my controller can help me : $database = $factory->createDatabase(); $storage = $factory->createStorage(); $bucket = $storage->getBucket(); if ($request->hasFile(‘lisc_font_photo_url’)) { $fileNameWithExt = $request->file(‘lisc_font_photo_url’)->getClientOriginalName(); $fileExt = pathinfo($fileNameWithExt, PATHINFO_EXTENSION); $newName = Carbon::now()->timestamp . ‘_’ . ..

Read more

I am using firebase authentication to authenticate users with Laravel, $firebase_id_token = Cookie::get(‘idtoken’); $verifiedIdToken = $auth->verifyIdToken($firebase_id_token); and I am getting InvalidArgumentException Error : "It was not possible to parse your key, reason: " on the verifyIdToken, although $firebase_id_token is valid, I am using PHP 8.0.3 "firebase": "^7.24.0", "firebaseui": "^4.6.1", Sourc..

Read more

Here is my code.. I got an error in getimage function. in the error, I can’t find the return URL value. This value cant find in removeimage function. when I check the console the response gets first after the print console. exactly i don’t know what is problem function uploadImage(file) { const ref = firebase.storage().ref() ..

Read more

This code is when uploading the image store in firebase storage. I want this image URL store in the firebase real-time database. const ref = firebase.storage().ref() const date = new Date(); const name = date.toLocaleTimeString() + ‘-‘ + file.name const metadata = { contentType:file.type } const task = ref.child(name).put(file,metadata) task .then(snapshot => snapshot.ref.getDownloadURL()) .then(url => ..

Read more

composer require brozot/laravel-fcm Using version ^1.3 for brozot/laravel-fcm ./composer.json has been updated Running composer update brozot/laravel-fcm Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 – brozot/laravel-fcm[1.3.0, …, 1.3.1] require illuminate/support 5.*|^6 -> found illuminate/support[v5.0.0, …, 5.8.x-dev, v6.0.0, …, 6.x-dev] but these ..

Read more

I am working on a project where I have to send notifications to registered devices, I have written a complete code for that but firebase not sending push notifications to any device i.e android neither IOS. I am attaching my code please have a look at it. if(!$device_tokens->isEmpty()){ return sendPushNotification($device_tokens, "Confirmation alert", "Have you got ..

Read more

I am working on FIRESTORE with LARAVEL 8. I have integrated the google FIRESTORE service account. I am able to get collection and documents successfully. But when I am trying to get the document snapshot for getting the data it’s giving me an error { "message": "Missing or insufficient permissions.", "code": 7, "status": "PERMISSION_DENIED", "details": ..

Read more

Hello everyone I have trouble setting my web push notifications with firebase. I have my firebase-messaging-sw.js file in public folder importScripts("https://www.gstatic.com/firebasejs/7.23.0/firebase-app.js"); importScripts( "https://www.gstatic.com/firebasejs/7.23.0/firebase-messaging.js" ); /* Initialize the Firebase app in the service worker by passing in the messagingSenderId. * New configuration for [email protected] */ firebase.initializeApp({ apiKey: "AIzaSyD9…….", authDomain: "projekatzasve.firebaseapp.com", projectId: "projekatzasve", storageBucket: "projekatzasve.appspot.com", messagingSenderId: "545…….", ..

Read more