firebase

How to paginate data in Firebase in Next.js SSR app?

走远了吗. 提交于 2021-02-16 21:48:48
问题 I am trying to build a next.js server-side rendered blog. For it, I need to paginate the posts data. However, I am yet to find a way to use the query cursors firebase provides to paginate the data. The building query code is: let postsQuery = firebase.firestore().collection('/posts').orderBy('postedOn', 'asc').limitToLast(10); if (currentTagFilter !== 'All') { postsQuery = postsQuery.where('tag', '==', currentTagFilter); } Now, this works for the first page, but I do not know how to request

The provided registration token is not registered

谁说胖子不能爱 提交于 2021-02-16 20:39:19
问题 I'm trying to send push notification for iOS via Google cloud functions but it returns error that The provided registration token is not registered . But I've checked it by debugging my app and the FCM registration token is correct. After that I've tried to send push notification via Firebase console to single device by providing FCM token but it failed due to Unregistered registration token . How this happens because there is no issue with device FCM token? 回答1: I think it should be some

currentUser() is not working type why I am seeing the expression doesn't evaluate to a function, so it can't be invoked

岁酱吖の 提交于 2021-02-16 20:25:38
问题 I'm new in Flutter, I'm working on a simple authentication app when I registered i should navigate to the chat screen and i want to grab current user but when i call FireBaseAuth.instance.currentUser() I got an exception "the expression doesn't evaluate to a function, so it can't be invoked." Why I'm seeing this? Please Help import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; import 'package:flash_chat/constants.dart'; class ChatScreen extends

How to export data from Firebase Crashlytics to another application?

徘徊边缘 提交于 2021-02-16 20:20:46
问题 I am interested in fetching the Crash-free users statistics and the user affected by Crashes trend from the Google firebase Crashlytics. Is there any API using which I can call using my application to export the data from Firebase Crashlytics? I looked at a few other similar questions like theses: How long does Firebase store my crash data? / Export data from Crashlytics? Export data from Firebase Crashlytics console? How to export crash-free users from firebase? , but none of them actually

How to export data from Firebase Crashlytics to another application?

时光总嘲笑我的痴心妄想 提交于 2021-02-16 20:19:01
问题 I am interested in fetching the Crash-free users statistics and the user affected by Crashes trend from the Google firebase Crashlytics. Is there any API using which I can call using my application to export the data from Firebase Crashlytics? I looked at a few other similar questions like theses: How long does Firebase store my crash data? / Export data from Crashlytics? Export data from Firebase Crashlytics console? How to export crash-free users from firebase? , but none of them actually

Way to query and update data in Firestore

左心房为你撑大大i 提交于 2021-02-16 20:07:53
问题 I run a payment system with Stripe and am trying to decrement a quantity field in Firestore after every successful purchase. I can get the document but I'm struggling figuring out how to update it. db.collection('products').where('id', '==', dbRef).get() .then(querySnapshot => { return querySnapshot.forEach(doc => { return res.json({ data: doc.data(), err: err }) }) }) { "data": { "stripe": { "sku": "sku_xxx", "product": "prod_xxx" }, "name": "VERSA HOODIE", "id": "pmz0pvfa", "createdBy":

Firebase Cloud Messaging : Expiration of FCM token

强颜欢笑 提交于 2021-02-16 20:07:16
问题 I understand that the FCM token renews itself if one of the following happens. -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data. The following can be used at the App side to monitor Token renewal. Monitor token generation The onTokenRefreshcallback fires whenever a new token is generated, so calling getToken in its context ensures that you are accessing a current, available registration token. Make sure you have

Error from Firebase Project URL: Adding www causes “Your connection is not private”

霸气de小男生 提交于 2021-02-16 20:05:13
问题 I have a firebase project that loads properly unless I type the url to my project with www. in front. This works : https://myproject.firebaseapp.com This returns an error : https://www.myproject.firebaseapp.com Your connection is not private Attackers might be trying to steal your information from www.myproject.firebaseapp.com (for example, passwords, messages, or credit cards). Learn more NET::ERR_CERT_COMMON_NAME_INVALID Attempt to resolve I followed the "Learn More" in the error above and

Error from Firebase Project URL: Adding www causes “Your connection is not private”

╄→гoц情女王★ 提交于 2021-02-16 20:03:51
问题 I have a firebase project that loads properly unless I type the url to my project with www. in front. This works : https://myproject.firebaseapp.com This returns an error : https://www.myproject.firebaseapp.com Your connection is not private Attackers might be trying to steal your information from www.myproject.firebaseapp.com (for example, passwords, messages, or credit cards). Learn more NET::ERR_CERT_COMMON_NAME_INVALID Attempt to resolve I followed the "Learn More" in the error above and

Cant get Firebase Storage security rules to refuse access to a file

做~自己de王妃 提交于 2021-02-16 18:50:08
问题 I'm sure I'm missing something wrt Firebase Storage rules, but I've done the following: STEP 1 Firstly I set the following Firebase Storage rule: service firebase.storage { match /b/{bucket}/o { match /items/{dev_key}/{perm_id}/{file_name} { allow write: if request.auth.uid == dev_id; allow read: if request.auth.token.permId == perm_id; } } } I expected only signed in users with a custom claim permId matching the relevant location to be able to download the file, allow read: if request.auth