首页 > 解决方案 > 您需要至少调用一次 create() 来创建单例

问题描述

我正在处理地理定位后台任务,当我运行应用程序时一切正常,但是当关闭或重新启动应用程序时,消息显示。

我实际上正在使用这个包进行背景地理定位 https://github.com/mauron85/react-native-background-geolocation

还有用于反应原生的 OneSignal SDK。

    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 3.86 GB / 11.88 GB   Binaries:
    Node: 10.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD   SDKs:
    Android SDK:
      API Levels: 19, 23, 25, 26, 27, 28, 29
      Build Tools: 26.0.3, 28.0.3, 29.0.1
      System Images: android-23 | Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 |
Google APIs  Intel x86 Atom_64, android-29 | Intel x86 Atom,
android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86
Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google
Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64  
IDEs:
    Android Studio: Version  3.5.0.0 AI-191.8026.42.35.5900203   npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: ^0.60.5 => 0.60.6

我正在卸载 OneSignal 和后台地理定位 - 仍然显示消息。

标签: androidreact-nativesingleton

解决方案


推荐阅读