androidstudiofirebasefirestore:权限被拒绝
创始人
2024-10-11 08:30:29
0

首先,需要检查代码中是否有获取Firestore数据权限的代码,如果没有需要添加以下代码:

FirebaseFirestore db = FirebaseFirestore.getInstance();
FirebaseAuth auth = FirebaseAuth.getInstance();
if (auth.getCurrentUser() != null) {
    db.collection("collectionName").document("docName")
            .get()
            .addOnCompleteListener(task -> {
                if (task.isSuccessful()) {
                    DocumentSnapshot document = task.getResult();
                    if (document != null) {
                        // Do something with the data
                    }
                } else {
                    // Log any errors
                }
            });
}

其次,需要检查Firestore Rules是否允许读取数据:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

最后,如果还是无法获取数据,请检查Firebase Console中是否已经添加了该应用程序,并且已经启用了Firestore服务。

相关内容

热门资讯

透视透视"aapok... 透视透视"aapoker透视脚本入口"详细辅助解说技巧(免费脚本咨询技巧);1.aapoker透视脚...
透视能赢"模拟器打开... 透视能赢"模拟器打开hhpoker"详细辅助微扑克教程(是有挂软件透明)关于模拟器打开hhpoker...
透视系统"竞技联盟透... 透视系统"竞技联盟透视插件"详细辅助曝光教程(透视挂底牌透明)是由北京得竞技联盟透视插件黑科技有限公...
透视工具"hhpok... 透视工具"hhpoker德州真的假的"详细辅助总结教程(黑侠破解软件);支持2-10人实时对战,虚拟...
透视辅助"拱趴大菠萝... 透视辅助"拱趴大菠萝万能挂图解"详细辅助辅助教程(有人用过技巧)1、不需要AI权限,帮助你快速的进行...
透视辅助"来玩app... 自定义来玩app 德州 辅助系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器...
透视肯定"wepok... 1、透视肯定"wepoker模拟器哪个好用"详细辅助wpk教程(免费钻石教程);详细教程。2、wep...
透视透视"wepok... 透视透视"wepoker有辅助插件吗"详细辅助细节揭秘(插件程序激活码神器);人气非常高,ai更新快...
透视辅助"德扑之心免... 透视辅助"德扑之心免费透视"详细辅助必备教程(有透视功能方法);致您一封信;亲爱德扑之心免费透视玩家...
透视总结"wepok... 1、透视总结"wepoker透视版下载"详细辅助必备教程(好友助力码透明)(UU poker、wep...