|
|
hace 1 mes | |
|---|---|---|
| .bundle | hace 4 meses | |
| android | hace 1 mes | |
| ios | hace 1 mes | |
| src | hace 1 mes | |
| .env | hace 4 meses | |
| .gitignore | hace 4 meses | |
| .prettierrc.mjs | hace 4 meses | |
| .watchmanconfig | hace 4 meses | |
| Gemfile | hace 4 meses | |
| Gemfile.lock | hace 4 meses | |
| README.md | hace 1 mes | |
| app.json | hace 4 meses | |
| babel.config.js | hace 4 meses | |
| eslint.config.mjs | hace 4 meses | |
| index.d.ts | hace 4 meses | |
| index.js | hace 4 meses | |
| jest.config.js | hace 4 meses | |
| jest.setup.js | hace 4 meses | |
| metro.config.js | hace 4 meses | |
| package-lock.json | hace 4 meses | |
| package.json | hace 4 meses | |
| pnpm-lock.yaml | hace 4 meses | |
| tsconfig.json | hace 4 meses |
https://thecodingmachine.github.io/react-native-boilerplate/docs/navigate
api 文档: https://www.yuque.com/kolo7/ly4p08/koe2e766ehtb7gai?singleDoc# 《PAYMENT_API》 https://www.yuque.com/kolo7/ly4p08/yps2h45o8l3cktgb?singleDoc# 《AUTH_API》 https://www.yuque.com/kolo7/ly4p08/rz9ylvxih1ibv476?singleDoc# 《APPLE_AUTH_API》 设计文档:https://www.yuque.com/kolo7/ly4p08/lgz7bru6f2gvrciq?singleDoc# 《统一登录充值平台》 https://www.yuque.com/kolo7/ly4p08/uuwa89hedxi4qtds?singleDoc# 《google Pay》
订阅产品api:https://www.yuque.com/kolo7/ly4p08/gz4urnur0hmpqfd5?singleDoc# 《SUBSCRIPTION_API》录充值平台》
包名:com.ipeaking.recipemuse
Google控制台 https://console.cloud.google.com/welcome?project=lithe-land-475707-b1&authuser=1
Apple控制台 https://developer.apple.com/account
apple 沙盒测试用户 mealmuse@gmail.com Abc753951
cd android
./gradlew assembleRelease
React Native IAP苹果支付(ApplePay) 在React Native应用中实现Android内购功能
用户点击订阅
↓
调用 requestSubscription()
↓
Apple 显示支付界面
↓
用户确认支付(Face ID/密码)
↓
purchaseUpdatedListener 触发
↓
获取 transactionReceipt
↓
发送收据到后端验证
↓
后端调用 Apple 验证接口
↓
Apple 返回验证结果
↓
后端更新数据库用户订阅状态
↓
返回验证结果到客户端
↓
客户端调用 finishTransaction()
↓
更新 UI 显示会员状态
📍步骤 1:前端调用后台
获取后台定义的商品 SKU 列表(业务控制层)
GET /subscription/products
后台返回:
[ {
"productId": "com.xxx.vip.month",
"displayName": "月会员",
"sort": 1
}, {
"productId": "com.xxx.vip.year",
"displayName": "年会员",
"sort": 2
} ]
📍步骤 2:前端把 productId 列表丢给 react-native-iap const ids = productsFromBackend.map(item => item.productId) const storeProducts = await RNIap.getSubscriptions(ids)
📍步骤 3:前端把“商店信息 + 后台业务信息”合并 const mergedProducts = backendList.map(item => ({ ...item, ...storeProducts.find(p => p.productId === item.productId) }));
最终得到:
商店价格与周期(来自 IAP)
商品业务含义、排序、描述(来自后台)