小编Hon*_*yal的帖子

没有互联网时如何在firestore中捕获错误

我最近将我的应用程序从 firebase 更新到了 firestore,但一直停留在离线持久化状态。我正在使用 react-native-firebase 集成 firestore 并禁用其持久性,但在没有互联网的情况下仍然没有收到任何捕获错误。这是我删除数据的代码,但当没有互联网时,catch 永远不会出错。

firebase.firestore().collection('d').doc(deviceid).delete().then(function () {
                                    console.log("Device Deleted");
                                    that.setState({
                                        loading: false
                                    });
                                    Toast.show('Device Deleted Succesfully', {
                                        duration: Toast.durations.SHORT,
                                        position: Toast.positions.TOP,
                                        shadow: true,
                                        animation: true,
                                        hideOnPress: true,
                                        delay: 0,
                                    });

                                }).catch(function (err) {
                                    console.log(err);
                                    that.setState({
                                        loading: false
                                    });
                                })
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-firestore react-native-firebase

10
推荐指数
3
解决办法
5724
查看次数

Mobile Vision API新探测器框架获取位图图像

我知道之前已经问过类似的问题: - Mobile Vision API - 连接新的探测器对象以继续帧处理

我正在接收帧但是当我调用frame.getBitmap()时它返回一个null对象.我想在https://github.com/tzutalin/dlib-android-app(Android dlib Library)FaceDet函数中使用此位图.

android dlib

7
推荐指数
1
解决办法
1300
查看次数