意外获得Cloud_firestore/有时会在生产中受到限制
我的Firestore规则:
match /app/info {
allow read;
}
我的代码:
FirebaseFirestore.instance
.collection('app')
.doc('info')
.snapshots()
.listen(
(event) {
final _minVersion = event.data()?['min_version'];
if (_minVersion is! String) return;
shouldUpdateApp(Version.parse(_minVersion), context.appLoc);
},
onError: (Object error, StackTrace? stackTrace) {
FirebaseCrashlytics.instance.recordError(
error,
stackTrace,
reason: 'app info onError',
);
},
)
并且正在完美地开发。
但是,有时在生产中,我会收到Firebase Crashlytics报告的错误。
非致命异常:io.flutter.plugins.firebase.crashlytics.fluttererror
[cloud_firestore/dermission-diendied]呼叫者无权执行指定操作。
更新2022年5月18日:
这仅在设备在后台运行时才发生。
My Firestore rule:
match /app/info {
allow read;
}
My code:
FirebaseFirestore.instance
.collection('app')
.doc('info')
.snapshots()
.listen(
(event) {
final _minVersion = event.data()?['min_version'];
if (_minVersion is! String) return;
shouldUpdateApp(Version.parse(_minVersion), context.appLoc);
},
onError: (Object error, StackTrace? stackTrace) {
FirebaseCrashlytics.instance.recordError(
error,
stackTrace,
reason: 'app info onError',
);
},
)
And is working perfectly in development.
However, sometimes in production I get errors reported to Firebase Crashlytics.
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError
[cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.. Error thrown app info onError.
Update 18 May 2022:
This only happens when the device is 100% running in background.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论