Category : firebase

I am sending the message from a Python script as follows. import firebase_admin from firebase_admin import credentials, messaging # initializations cred = credentials.Certificate(‘Full path to firebase-admin-sdk.json’) print(‘Connecting…’) firebase_admin.initialize_app(cred) registration_tokens = [ ‘valid_registration_token_from_client’, ] message = messaging.MulticastMessage( data={‘score’: ‘850’, ‘time’: ‘2:45’}, tokens = registration_tokens ) response = messaging.send_multicast(message) print(‘{0} messages were sent successfully.’.format(response.success_count)) After executing the ..

Read more

I really need help and am not sure why my code is not executing. I tried everything by reading different solution and there was no answer. so, I created a project with Firebase. As usual, i set up a config, and then initialized my firebase, and initialized my auth. After that, i wrote another line ..

Read more

I have a project in which we run several computations and then publish a summary of the results to a Firebase Realtime Database. For publishing to Firebase, I implemented the python class as follows: """Package for all Firebase related tasks""" import firebase_admin from firebase_admin import db from firebase_admin.exceptions import InvalidArgumentError from ngtlib.auth import auth_config, project ..

Read more

I’m using firebase firestore database for my KivyMD project. In the program when a button is pressed the data should be saved in the database if they doesn’t exist. It work successfully. But the problem is a ValueError is appeared when the user enters an existing email address and enter another email at second time ..

Read more

I am using firestore with python to write cloud functions. I need to test a function with following query: from google.cloud import firestore MY_COLLECTION_GROUP = firestore.Client(project="my-project").collection_group("my_collection") def function_to_test(data): my_query = ( MY_COLLECTION_GROUP.where("eventDateTime", "==", data["dateTime"]) .where("user.id", "==", data["user_id"]) .where("user.age", ">=", data["valid_age"]) ) # fetch results from query and proceed further To test the above function, I ..

Read more

I am getting error ‘Credentials’ object has no attribute ‘Certificate’. I already tried to reinstall the firebase_admin package. Traceback (most recent call last): File "main.py", line 29, in <module> cred = credentials.Certificate(‘./FStoreCredential/credentials.json’) AttributeError: ‘Credentials’ object has no attribute ‘Certificate’ Source: Python..

Read more