我正在尝试将 App Clip 功能集成到我开发的应用程序中,该应用程序是与 EXPO 进行本机反应的。
我声明我已经在没有 EXPO 的 React Native 项目中集成了 App Clip 功能,并且我没有遇到任何重大问题,而使用 expo 我有一个我无法解决的问题。
我在 main.m 文件中收到此错误:
不变违规:“ReactNativeTest”尚未注册。在以下情况下可能会发生这种情况:
- Metro(本地开发服务器)从错误的文件夹运行。检查 Metro 是否正在运行,将其停止并在当前项目中重新启动。
- 一个模块由于错误而未能加载并且
AppRegistry.registerComponent
未被调用。
我相信这个问题与 ViewController.m 文件有关:
// moduleName corresponds to the appName used for the
// app entry point in "index.js"
RCTRootView *rootView = [[RCTRootView alloc]
initWithBundleURL:jsCodeLocation moduleName:@"ReactNativeTest"
initialProperties:nil launchOptions:nil];
在没有 EXPO 的项目中,“index.js”中应用程序入口点的模块名称是这样的
但在这种情况下它不起作用,你有解决方案吗?