小编yas*_*eya的帖子

错误:无法确定当前字符,它不是 android 的 react-native 中的字符串、数字、数组或对象

每当我在保持模拟器运行的同时运行react-native run-android时,我都会收到此错误。react-native run-ios完全正常。

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Failed to parse React Native CLI configuration: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'E' with an int value of 69
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
Error: Invalid attribute nameLine: 16Column: 18Char: .    at error (/Users/yashatreya/Desktop/Realyze/Realyze/node_modules/sax/lib/sax.js:651:10)    at …
Run Code Online (Sandbox Code Playgroud)

javascript java android node.js react-native

14
推荐指数
2
解决办法
2万
查看次数

错误:3 INVALID_ARGUMENT:无法在 Firestore 管理中转换数组值中的数组值

我正在尝试在我的 firstore 数据库中保存使用 twitter api 检索到的多个推文对象,但出现此错误:

错误:3 INVALID_ARGUMENT:无法在数组值中转换数组值

下面是示例JSON对象:所有推文对象都与此类似

TweetObj: {
  "created_at": "Wed Feb 12 15:17:24 +0000 2020",
  "id": 1227612675334660000,
  "id_str": "1227612675334660099",
  "full_text": "Writing online is a superpower.\n\nHere’s a list of people who should start writing online.\n\n1. The Niche Hobbyist\n\nThe Internet rewards people with obscure interests. Writing online will help you find other like-minded hobbyists who you wouldn’t be able to find in real-life.",
  "truncated": false,
  "display_text_range": [
    0,
    274
  ],
  "entities": {
    "hashtags": [],
    "symbols": [],
    "user_mentions": …
Run Code Online (Sandbox Code Playgroud)

javascript arrays firebase google-cloud-firestore

6
推荐指数
1
解决办法
761
查看次数

如何在react-native项目中检查google play services版本和firebase版本?

我正在尝试安装 rn-push-notifications,我需要 google play services 版本和 firebase 版本。你能帮我一下吗?

javascript react-native react-native-push-notification react-notifications

5
推荐指数
2
解决办法
7671
查看次数

在 Firebase Cloud Functions 中为每个用户运行调度程序?

我希望运行一个根据我的云功能中的每个用户运行的调度程序,而不是为所有用户同时运行的通用调度程序。

\n\n

例如,如果用户 A 执行某个操作,则仅为用户 A 启动调度程序(例如,每 30 分钟一次),而不为其他用户启动。\n但用户 B 也会执行相同的操作,并在不同时间为自己启动调度程序。

\n\n

Now UserA\xe2\x80\x99s and UserB\xe2\x80\x99s scheduler could be running at different times but same intervals(30 mins)

\n\n

How can I create such a function?\nHelp would be very much appreciated.

\n

firebase google-cloud-functions react-native-firebase

3
推荐指数
1
解决办法
1328
查看次数

Firebase Firestore 分页返回重复的结果

我正在创建一个社交提要,我想在其中无限滚动,使用 firebase 分页,但即使我的 firestore 数据库中有很多不同的数据,查询每次都返回相同的内容。

这是我的初始查询:

const getThreads = async () => {
    try {
      setLoading(true);
      const ref = firestore()
        .collection('Discover')
        .orderBy('rank', 'desc')
        .limit(10);

      let docSnaps = await ref.get();

      if (docSnaps.empty !== true) {
        let docData = docSnaps.docs.map(document => {
          return {
            data: document.data(),
            id: document.id,
          };
        });
        setLastVisible(docData[docData.length - 1].id);
        setThreads(docData); //Setting the data to display in UI
      }
      setLoading(false);
    } catch (e) {
      setLoading(false);
      console.log(e);
      Alert.alert(
        'Oops! Looks like something went wrong',
        'Please try again later',
        [{text: 'OK'}], …
Run Code Online (Sandbox Code Playgroud)

javascript firebase react-native google-cloud-firestore

2
推荐指数
1
解决办法
683
查看次数