【发布时间】:2020-12-29 10:42:46
【问题描述】:
我想通过 Expo 添加 IAP 以进行订阅(每月)。
我关注这份文件 (https://docs.expo.io/versions/latest/sdk/in-app-purchases/)
我用这个代码yarn add expo-in-app-purchases 添加了库,没有问题。
我写导入代码时应用崩溃了import * as InAppPurchases from 'expo-in-app-purchases';
错误很严重Invariant Violation: Native module cannot be null.
我的 package.json 文件:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/drawer": "^5.11.4",
"@react-navigation/native": "^5.8.10",
"@react-navigation/stack": "^5.12.8",
"expo": "~40.0.0",
"expo-in-app-purchases": "^9.1.0",
"expo-status-bar": "~1.0.3",
"install": "^0.13.0",
"moment": "^2.29.1",
"npm": "^6.14.10",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "^1.9.0",
"react-native-reanimated": "^1.13.2",
"react-native-screens": "^2.16.1",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "~7.9.0"
},
"private": true
}
您对此有什么想法吗?
最后,有没有关于小吃或github等的演示?
【问题讨论】:
标签: react-native expo