Where can I find my Firebase reference URL in Firebase account?

前端 未结 8 626
半阙折子戏
半阙折子戏 2021-02-06 23:07

In the third last line of the below code, how can I find the firebase URL. I am not able to find it. Can anyone provide me the best link on how to setup firebase facebook login

8条回答
  •  情歌与酒
    2021-02-06 23:32

    For Firestore I tried this to find get the databaseUrl and it works for me:

    Go to Cloud Firestore tab and take the id as circled in the image.

    Then the databaseURL is https://football-f559a.firebaseio.com

    Tested this with Python and Firebase Admin sdk

    import firebase_admin
    from firebase_admin import credentials, firestore
    
    cred = credentials.Certificate("./firebase-admin.json")
    firebase_admin.initialize_app(cred, {
        'databaseURL': 'https://football-f559a.firebaseio.com'
    })
    
    db = firestore.client()
    
    for k in db.collection("countries").get():
        print(k.id, k.to_dict())
    

    Output:

    A {'name': 'aaaaa'}
    C {'name': 'C2'}
    

    UPDATE:

    Apparently I can use any databaseURL and it still works:

    'databaseURL': 'https://xxxxx.firebaseio.com'
    

提交回复
热议问题