我正在将react-native-device-info从v2迁移到v3,并且我有一个重大变化。在更新包之前,一切正常。该错误出现在所有模拟器和真实设备上。
\n\n我得到的错误是:
\n\nNativeFirebaseError: [messaging/unregistered] You must be registered for remote notifications before calling get token, see messaging().registerForRemoteNotifications() or requestPermission().\nRun Code Online (Sandbox Code Playgroud)\n\n环境信息:
\n\n System:\n OS: macOS 10.15.4\n CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz\n Memory: 6.44 GB / 16.00 GB\n Shell: 5.7.1 - /bin/zsh\n Binaries:\n Node: 12.14.0 - ~/.nvm/versions/node/v12.14.0/bin/node\n Yarn: 1.22.4 - /usr/local/bin/yarn\n npm: 6.13.4 - ~/.nvm/versions/node/v12.14.0/bin/npm\n SDKs:\n iOS SDK:\n Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2\n Android SDK:\n API Levels: 28, 29\n …Run Code Online (Sandbox Code Playgroud) javascript typescript react-native react-native-firebase react-native-device-info
清单合并失败:属性 meta-data#android.support.VERSION@value value=(26.0.1) from [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 也是目前在 [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0)。建议:将 'tools:replace="android:value"' 添加到 AndroidManifest.xml:26:9-28:38 的元素以覆盖。
注册护士 v0.55
react-native-device-info v0.21.5
应用程序/build.gradle:
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.myapp"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
}
dependencies {
compile project(':react-native-device-info')
compile project(':react-native-splash-screen')
compile(project(":react-native-google-sign-in")) { //ForGoogleSignIn
exclude group: "com.google.android.gms"
} …Run Code Online (Sandbox Code Playgroud) 我的应用程序显示一些文本。Component当字体大小通过设置 --> 辅助功能 --> 字体大小更改时,我需要重新渲染:
所以基本上这是se序列:
此时我需要重新加载应用程序,因为有些Components需要调整。
我正在使用react-native-device-info来获取字体大小,const fontScale = DeviceInfo.getFontScale();但在应用程序完全关闭和打开之前,它的值不会更新。
有任何想法吗?
accessibility font-scaling react-native react-native-device-info react-hooks
我刚刚用“react-native init NameProject”创建了一个应用程序,并且有一个我经常使用的基本目录,所以当我插入它时,我安装了依赖项和链接,它发生在我身上......我已经删除了“node_modules”目录,重新安装,重新链接,似乎没有解决问题......
截屏:
react-native react-native-router-flux react-native-device-info
我正在尝试获取设备的当前国家/地区,但没有找到任何内容。在 React Native 中可以这样做吗?我尝试使用react-native-device-info但它也不支持但在以前的版本中它可以通过 getDeviceCountry() 获得。现在对于最新版本,它显示错误:
类型错误:_reactNativeDeviceInfo.default.getDeviceCountry 不是函数。(在 '_reactNativeDeviceInfo.default.getDeviceCountry()' 中,'_reactNativeDeviceInfo.default.getDeviceCountry' 未定义)
这个仓库(https://github.com/rebeccahughes/react-native-device-info#usage)看起来有一些通过React Native访问设备信息的方法。
有人有实际设备的一些示例输出数据吗?
如果能够了解数据的样子,而不必在一堆设备上编译和运行它,那就太好了。
我正在实现 API 将应用程序与服务器连接。我必须在那里使用 deviceId 。正如这里提到的,我们可以使用第三方库“react-native-device-info”。但是当我使用它时,我收到了错误,如所附的屏幕截图所示。根据错误,它说要进行链接,但由于我使用的是 React 版本 0.62,因此存在自动链接。那么会出现什么问题呢?花了太多时间去寻找,但到目前为止我还没有找到合适的解决方案。
hybrid-mobile-app react-native deviceid expo react-native-device-info
react-native ×7
android ×2
build.gradle ×1
deviceid ×1
expo ×1
font-scaling ×1
ios ×1
javascript ×1
react-hooks ×1
typescript ×1