1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
2353de6935
fix(deps): update dependency androidx.swiperefreshlayout:swiperefreshlayout to v1.1.0 2022-08-05 09:35:44 +00:00
24 changed files with 6952 additions and 261 deletions

View File

@ -1,3 +0,0 @@
# Override Yarn command so we can automatically setup the repo on running `yarn`
yarn-path "scripts/bootstrap.js"

View File

@ -17,8 +17,6 @@
> ⚠️ `4.0+` 在 iOS 打包中报错,这是因为[使用阿里云产品的 SDK 出现 UTDID 冲突的问题](https://help.aliyun.com/document_detail/39984.html),在 [@EatherToo](https://github.com/EatherToo) 的帮助下([#44](https://github.com/uiwjs/react-native-alipay/pull/44))UTDID 被剥离了。可以在 `Podfile` 中加上 `pod 'UTDID'` 解决打包失败的问题。感谢 [@abing](https://github.com/ouabing)
> ⚠️ `v5.x` 在 android 需要 `Gradle 7+` ([#61](https://github.com/uiwjs/react-native-alipay/issues/61#issuecomment-1206243613) [#60](https://github.com/uiwjs/react-native-alipay/pull/60))
## 注意事项
1. Android支持2.3及以上的系统版本运行。
@ -62,8 +60,8 @@ async function aliPay() {
// payInfo 是后台拼接好的支付参数
// return_url=
const payInfo = 'alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021001172656340&biz_content=%7B%22out_trade_no%22%3A%221111112222222%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%221234%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Fane.boshu.ltd%2Fowner%2Fpay%2Fapi%2FownerPay%2Fcallback&sign=oUQmGtkv8mrhJ0YwHl9%2FfxMcoLACWuSFKiMTC4Id8nc%2FZVvDQ6MLQq5hhtEN03Qn1%2BAtzTAaofE8nNixdroxOek2l5YtOAcYcXVYlJIyogN%2B22erN2NpDTWJ7tQTKgYFDJLRiG0DZJaxfADhUUF6UR9kdA8omoXKLDlP17ZPUs5Jr4aKv5HJtH5C53ui7PbmyWYg934L4UDC2F%2F9pPQlRwwDeE1SAaV3HW9Dt83kK52o8%2FlChXdotbFdAvH0d4qYGhpEYU5sepj9xiOMyL9aC4pMXW9INYLLGbvtqtlRchZTAfH5yji6nqqQm9KKMmcVrWdBDLyjFVNpejq1UjbJBw%3D%3D&sign_type=RSA2&timestamp=2020-07-09+12%3A16%3A16&version=1.0';
const result = await Alipay.alipay(payInfo);
console.log('alipay:result-->>>', result);
const resule = await Alipay.alipay(payInfo);
console.log('alipay:resule-->>>', resule);
}
```
@ -111,9 +109,9 @@ async function authInfo() {
// 支付宝端授权验证
// authInfoStr 是后台拼接好的验证参数
const authInfoStr = 'app_name=mc&auth_type=AUTHACCOUNT&apiname=com.alipay.account.auth&biz_type=openservice&product_id=APP_FAST_LOGIN&scope=kuaijie&pid=2088421915791034&target_id=15946456110003465&app_id=2021001172656340&sign_type=RSA2&sign=keluG28qbbLwAcSDI4VmCNOGHJoF3xgpVeqXu1nCBCYo%2FlYYGe00fTfV9L4G73Sk7%2B4IwK%2BZV8IL%2F04cVtk6SR74lKAR3rYOoUdQ09ZrZFuQoUkO0vekajhp75IDQIg6PedCyY0SjFTqrHlH%2FImscBwitxrlSc9YbN7uW0gY34K8t7v8NhDoqzKJeoIz43UxF5U1DpUA1ISBVxwO7du1t6rYltsRhReayPS3hnvmwYSKQZUEgBvJ%2BT2XdyCaz%2FdGV907lYagPp1Oxkoaj%2FvW5NjNsRnid7vH944CoFj9XtBK%2FNTk2tBPTHFxYRQTEG1PkgkBohGpAWOFGGOuapH0ag%3D%3D';
const result = await Alipay.authInfo(authInfoStr);
// result => success=true&auth_code=9c11732de44f4f1790b63978b6fbOX53&result_code=200&alipay_open_id=20881001757376426161095132517425&user_id=2088003646494707
console.log('authInfo:result-->>>', result);
const resule = await Alipay.authInfo(authInfoStr);
// resule => success=true&auth_code=9c11732de44f4f1790b63978b6fbOX53&result_code=200&alipay_open_id=20881001757376426161095132517425&user_id=2088003646494707
console.log('authInfo:resule-->>>', resule);
}
```

View File

@ -1 +0,0 @@
2.7.4

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {StyleSheet, Button, Text, View} from 'react-native';
import { StyleSheet, Button, Text, View, Linking, AppState } from 'react-native';
import Alipay from '@uiw/react-native-alipay';
export default class App extends Component {
@ -7,7 +7,7 @@ export default class App extends Component {
super(props);
this.state = {
version: '',
};
}
}
componentDidMount() {
Alipay.setAlipayScheme('uiwjspay');
@ -15,25 +15,23 @@ export default class App extends Component {
aliPay = async () => {
try {
// return_url=
const payInfo =
'alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021001172656340&biz_content=%7B%22out_trade_no%22%3A%221111112222222%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%221234%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Fane.boshu.ltd%2Fowner%2Fpay%2Fapi%2FownerPay%2Fcallback&sign=oUQmGtkv8mrhJ0YwHl9%2FfxMcoLACWuSFKiMTC4Id8nc%2FZVvDQ6MLQq5hhtEN03Qn1%2BAtzTAaofE8nNixdroxOek2l5YtOAcYcXVYlJIyogN%2B22erN2NpDTWJ7tQTKgYFDJLRiG0DZJaxfADhUUF6UR9kdA8omoXKLDlP17ZPUs5Jr4aKv5HJtH5C53ui7PbmyWYg934L4UDC2F%2F9pPQlRwwDeE1SAaV3HW9Dt83kK52o8%2FlChXdotbFdAvH0d4qYGhpEYU5sepj9xiOMyL9aC4pMXW9INYLLGbvtqtlRchZTAfH5yji6nqqQm9KKMmcVrWdBDLyjFVNpejq1UjbJBw%3D%3D&sign_type=RSA2&timestamp=2020-07-09+12%3A16%3A16&version=1.0';
const result = await Alipay.alipay(payInfo);
console.log('alipay:result-->>>', result);
const payInfo = 'alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021001172656340&biz_content=%7B%22out_trade_no%22%3A%221111112222222%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%221234%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2Fane.boshu.ltd%2Fowner%2Fpay%2Fapi%2FownerPay%2Fcallback&sign=oUQmGtkv8mrhJ0YwHl9%2FfxMcoLACWuSFKiMTC4Id8nc%2FZVvDQ6MLQq5hhtEN03Qn1%2BAtzTAaofE8nNixdroxOek2l5YtOAcYcXVYlJIyogN%2B22erN2NpDTWJ7tQTKgYFDJLRiG0DZJaxfADhUUF6UR9kdA8omoXKLDlP17ZPUs5Jr4aKv5HJtH5C53ui7PbmyWYg934L4UDC2F%2F9pPQlRwwDeE1SAaV3HW9Dt83kK52o8%2FlChXdotbFdAvH0d4qYGhpEYU5sepj9xiOMyL9aC4pMXW9INYLLGbvtqtlRchZTAfH5yji6nqqQm9KKMmcVrWdBDLyjFVNpejq1UjbJBw%3D%3D&sign_type=RSA2&timestamp=2020-07-09+12%3A16%3A16&version=1.0';
const resule = await Alipay.alipay(payInfo);
console.log('alipay:resule-->>>', resule);
} catch (error) {
console.log('alipay:error-->>>', error);
}
};
}
authInfo = async () => {
try {
const authInfoStr =
'app_name=mc&auth_type=AUTHACCOUNT&apiname=com.alipay.account.auth&biz_type=openservice&product_id=APP_FAST_LOGIN&scope=kuaijie&pid=2088421915791034&target_id=15946456110003465&app_id=2021001172656340&sign_type=RSA2&sign=keluG28qbbLwAcSDI4VmCNOGHJoF3xgpVeqXu1nCBCYo%2FlYYGe00fTfV9L4G73Sk7%2B4IwK%2BZV8IL%2F04cVtk6SR74lKAR3rYOoUdQ09ZrZFuQoUkO0vekajhp75IDQIg6PedCyY0SjFTqrHlH%2FImscBwitxrlSc9YbN7uW0gY34K8t7v8NhDoqzKJeoIz43UxF5U1DpUA1ISBVxwO7du1t6rYltsRhReayPS3hnvmwYSKQZUEgBvJ%2BT2XdyCaz%2FdGV907lYagPp1Oxkoaj%2FvW5NjNsRnid7vH944CoFj9XtBK%2FNTk2tBPTHFxYRQTEG1PkgkBohGpAWOFGGOuapH0ag%3D%3D';
const result = await Alipay.authInfo(authInfoStr);
// result => success=true&auth_code=9c11732de44f4f1790b63978b6fbOX53&result_code=200&alipay_open_id=20881001757376426161095132517425&user_id=2088003646494707
console.log('authInfo:result-->>>', result);
const authInfoStr = 'app_name=mc&auth_type=AUTHACCOUNT&apiname=com.alipay.account.auth&biz_type=openservice&product_id=APP_FAST_LOGIN&scope=kuaijie&pid=2088421915791034&target_id=15946456110003465&app_id=2021001172656340&sign_type=RSA2&sign=keluG28qbbLwAcSDI4VmCNOGHJoF3xgpVeqXu1nCBCYo%2FlYYGe00fTfV9L4G73Sk7%2B4IwK%2BZV8IL%2F04cVtk6SR74lKAR3rYOoUdQ09ZrZFuQoUkO0vekajhp75IDQIg6PedCyY0SjFTqrHlH%2FImscBwitxrlSc9YbN7uW0gY34K8t7v8NhDoqzKJeoIz43UxF5U1DpUA1ISBVxwO7du1t6rYltsRhReayPS3hnvmwYSKQZUEgBvJ%2BT2XdyCaz%2FdGV907lYagPp1Oxkoaj%2FvW5NjNsRnid7vH944CoFj9XtBK%2FNTk2tBPTHFxYRQTEG1PkgkBohGpAWOFGGOuapH0ag%3D%3D';
const resule = await Alipay.authInfo(authInfoStr);
// resule => success=true&auth_code=9c11732de44f4f1790b63978b6fbOX53&result_code=200&alipay_open_id=20881001757376426161095132517425&user_id=2088003646494707
console.log('authInfo:resule-->>>', resule);
} catch (error) {
console.log('authInfo:error-->>>', error);
}
};
}
getVersion = async () => {
try {
const version = await Alipay.getVersion();
@ -42,7 +40,7 @@ export default class App extends Component {
} catch (error) {
console.log('getVersion:error-->>>', error);
}
};
}
render() {
return (
<View style={styles.container}>

View File

@ -1,6 +0,0 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

View File

@ -261,7 +261,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'

View File

@ -1,17 +1,3 @@
const path = require('path');
const pak = require('../package.json');
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module-resolver',
{
extensions: ['.tsx', '.ts', '.js', '.json'],
alias: {
[pak.name]: path.join(__dirname, '..', 'index'),
},
},
],
],
};

View File

@ -1,4 +1,9 @@
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent('main', () => App);
AppRegistry.registerComponent(appName, () => App);

View File

@ -284,8 +284,6 @@ PODS:
- React-jsinspector (0.69.3)
- React-logger (0.69.3):
- glog
- react-native-alipay (5.0.1):
- React-Core
- React-perflogger (0.69.3)
- React-RCTActionSheet (0.69.3):
- React-Core/RCTActionSheetHeaders (= 0.69.3)
@ -401,7 +399,6 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-alipay (from `../..`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
@ -473,8 +470,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
react-native-alipay:
:path: "../.."
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
@ -535,7 +530,6 @@ SPEC CHECKSUMS:
React-jsiexecutor: 1842ca163b160aeb224d2c65b2a60c393b273c67
React-jsinspector: bb2605f98aada5d81f3494690da3ef3b4ff3b716
React-logger: 23a50ef4c18bf9adbb51e2c979318e6b3a2e44a1
react-native-alipay: 537db53cb2de98353e623a60ca0402de37264314
React-perflogger: 39d2ba8cbcac54d1bb1d9a980dab348e96aef467
React-RCTActionSheet: b1ad907a2c8f8e4d037148ca507b7f2d6ab1c66d
React-RCTAnimation: 914a9ba46fb6e7376f7709c7ce825d53b47ca2ee

View File

@ -8,12 +8,12 @@
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-example.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-example-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-example-exampleTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
A7FE8757B0253CD7589FAE91 /* libPods-example-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EA82C6C904106EC5FAA7FB7 /* libPods-example-exampleTests.a */; };
FEB6C514CC3F61A37F24B98C /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 808F513FAF96DAD039E92222 /* libPods-example.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -30,20 +30,19 @@
00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = "<group>"; };
0350257FC9F65E85689797E3 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = example/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = "<group>"; };
1EA82C6C904106EC5FAA7FB7 /* libPods-example-exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
703716FB709265C05CB09BD9 /* Pods-example-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
7DE1E4D0289E49B200722D10 /* libreact-native-alipay.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libreact-native-alipay.a"; sourceTree = BUILT_PRODUCTS_DIR; };
808F513FAF96DAD039E92222 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-example-exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = "<group>"; };
985BE54A6B9DC27AFEEB2892 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
C8734EACFAE9EEF4378FA714 /* Pods-example-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.release.xcconfig"; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@ -52,7 +51,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A7FE8757B0253CD7589FAE91 /* libPods-example-exampleTests.a in Frameworks */,
7699B88040F8A987B510C191 /* libPods-example-exampleTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -60,7 +59,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FEB6C514CC3F61A37F24B98C /* libPods-example.a in Frameworks */,
0C80B921A6F3F58F76C31292 /* libPods-example.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -100,10 +99,9 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
7DE1E4D0289E49B200722D10 /* libreact-native-alipay.a */,
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
808F513FAF96DAD039E92222 /* libPods-example.a */,
1EA82C6C904106EC5FAA7FB7 /* libPods-example-exampleTests.a */,
5DCACB8F33CDC322A6C60F78 /* libPods-example.a */,
19F6CBCC0A4E27FBF8BF4A61 /* libPods-example-exampleTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@ -142,10 +140,10 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
0350257FC9F65E85689797E3 /* Pods-example.debug.xcconfig */,
985BE54A6B9DC27AFEEB2892 /* Pods-example.release.xcconfig */,
703716FB709265C05CB09BD9 /* Pods-example-exampleTests.debug.xcconfig */,
C8734EACFAE9EEF4378FA714 /* Pods-example-exampleTests.release.xcconfig */,
3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */,
5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */,
89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -157,12 +155,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */;
buildPhases = (
1C053A4030B389C2BE4E29E6 /* [CP] Check Pods Manifest.lock */,
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
B01DCDA8C5A673A48FDAE04B /* [CP] Embed Pods Frameworks */,
033831B975B87C321F0A778A /* [CP] Copy Pods Resources */,
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -178,14 +176,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */;
buildPhases = (
79883C92EACAE849F236F5E6 /* [CP] Check Pods Manifest.lock */,
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
E86EC3E356E887B4CD97AFA8 /* [CP] Embed Pods Frameworks */,
5021B8CA64705AEB85BC9B7C /* [CP] Copy Pods Resources */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -268,24 +266,24 @@
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
033831B975B87C321F0A778A /* [CP] Copy Pods Resources */ = {
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
1C053A4030B389C2BE4E29E6 /* [CP] Check Pods Manifest.lock */ = {
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -307,24 +305,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
5021B8CA64705AEB85BC9B7C /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
79883C92EACAE849F236F5E6 /* [CP] Check Pods Manifest.lock */ = {
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -346,7 +327,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B01DCDA8C5A673A48FDAE04B /* [CP] Embed Pods Frameworks */ = {
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -363,21 +344,38 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E86EC3E356E887B4CD97AFA8 /* [CP] Embed Pods Frameworks */ = {
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
@ -432,7 +430,7 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 703716FB709265C05CB09BD9 /* Pods-example-exampleTests.debug.xcconfig */;
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-example-exampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -459,7 +457,7 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C8734EACFAE9EEF4378FA714 /* Pods-example-exampleTests.release.xcconfig */;
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-example-exampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
@ -483,7 +481,7 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0350257FC9F65E85689797E3 /* Pods-example.debug.xcconfig */;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
@ -509,7 +507,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 985BE54A6B9DC27AFEEB2892 /* Pods-example.release.xcconfig */;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;

View File

@ -16,6 +16,8 @@
#import <react/config/ReactNativeConfig.h>
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
@ -41,7 +43,8 @@
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"main", nil);
NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"example", initProps);
if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
@ -57,6 +60,28 @@
return YES;
}
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
// Switch this bool to turn on and off the concurrent root
return true;
}
- (NSDictionary *)prepareInitialProps
{
NSMutableDictionary *initProps = [NSMutableDictionary new];
#ifdef RCT_NEW_ARCH_ENABLED
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
#endif
return initProps;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG

View File

@ -3,49 +3,7 @@
* https://github.com/facebook/react-native
*/
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const escape = require('escape-string-regexp');
const pak = require('../package.json');
const root = path.resolve(__dirname, '..');
const modules = Object.keys({
...pak.peerDependencies,
});
module.exports = {
projectRoot: __dirname,
// quick workaround for another issue with symlinks
watchFolders: [path.resolve(__dirname, '.'), root],
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
// resolver: {
// extraNodeModules: new Proxy(
// {},
// {get: (_, name) => path.resolve('.', 'node_modules', name)},
// ),
// },
// We need to make sure that only one version is loaded for peerDependencies
// So we blacklist them at the root, and alias them to the versions in example's node_modules
resolver: {
blacklistRE: exclusionList(
modules.map(
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
),
),
// extraNodeModules: new Proxy(
// {},
// {get: (_, name) => path.resolve('.', 'node_modules', name)},
// ),
extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},
transformer: {
getTransformOptions: async () => ({
transform: {

View File

@ -3,20 +3,14 @@
"version": "0.0.1",
"private": true,
"scripts": {
"pods": "pod-install --quiet",
"postinstall": "patch-package",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"peerDependencies": {
"react": "*",
"react-native": "*"
},
"dependencies": {
"@uiw/react-native-alipay": "5.0.2",
"@uiw/react-native-alipay": "link:../",
"react": "18.0.0",
"react-native": "0.69.3"
},
@ -27,11 +21,8 @@
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"metro-react-native-babel-preset": "^0.70.3",
"react-test-renderer": "18.0.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0"
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"

View File

@ -1,9 +0,0 @@
const path = require('path');
module.exports = {
dependencies: {
'@uiw/react-native-alipay': {
root: path.join(__dirname, '..'),
},
},
};

6823
example/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,5 @@
import { NativeModules, Platform } from 'react-native';
const LINKING_ERROR =
`The package '@uiw/react-native-alipay' doesn't seem to be linked. Make sure: \n\n` +
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
'- You rebuilt the app after installing the package\n' +
'- You are not using Expo managed workflow\n';
console.log(':::NativeModules:::', NativeModules.RNAlipay)
const RNAlipay = NativeModules.RNAlipay ? NativeModules.RNAlipay : new Proxy(
{},
{
get() {
throw new Error(LINKING_ERROR);
},
}
);
// console.log('>RNAlipay1111>', RNAlipay.setAlipayScheme)
// console.log('>>NativeModules.RNAlipay:', NativeModules.RNAlipay)
export default class Alipay {
/**
* 支付

Binary file not shown.

View File

@ -9,7 +9,7 @@
////////////////////////////////////////////////////////
///////////////// 支付宝标准版本支付SDK ///////////////////
///////// version:15.8.11 modify:2022.07.26///////////
///////// version:15.8.08 motify:2022.02.15///////////
////////////////////////////////////////////////////////
#import <UIKit/UIKit.h>

View File

@ -4,12 +4,14 @@
@interface RNAlipay ()
@property (nonatomic, copy) RCTPromiseResolveBlock payOrderResolve;
@end
@implementation RNAlipay
{
NSString *alipayScheme;
}
RCT_EXPORT_MODULE()
- (instancetype)init
@ -106,19 +108,10 @@ RCT_EXPORT_METHOD(getVersion: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromi
/*!
* [warn][tid:main][RCTModuleData.mm:68] Module Alipay requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`.
* In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
*/;
*/
+ (BOOL)requiresMainQueueSetup
{
return YES;
}
// Don't compile this code when we build for the old architecture.
#ifdef RCT_NEW_ARCH_ENABLED
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return std::make_shared<facebook::react::NativeAwesomeModuleSpecJSI>(params);
}
#endif
@end

View File

@ -1,11 +1,9 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
package = JSON.parse(File.read(File.join(__dir__, '..', "package.json")))
Pod::Spec.new do |s|
s.name = "react-native-alipay"
# s.name = "RNAlipay"
# s.name = "React-Alipay"
s.name = "RNAlipay"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
@ -20,8 +18,7 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "9.0" }
s.source = { :git => "https://github.com/uiwjs/react-native-alipay.git", :tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,mm,swift}"
s.source_files = "**/*.{h,c,m,swift}"
# s.source_files = "**/*.{h,m}"
s.requires_arc = true
@ -36,15 +33,12 @@ Pod::Spec.new do |s|
s.frameworks = "CoreText",
s.frameworks = "WebKit"
# s.dependency "React"
s.dependency "React-Core"
s.resource = 'ios/AlipaySDK.bundle'
# s.vendored_libraries = "libAlipaySDK.a"
s.dependency "React"
s.resource = 'AlipaySDK.bundle'
# s.source_files = "AlipaySDKiOS/AlipaySDK.framework/**/*"
s.vendored_frameworks = 'ios/AlipaySDK.framework'
s.vendored_frameworks = 'AlipaySDK.framework'
s.library = "c++", "z"
# ...
# s.dependency "..."
end

View File

@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
7DE1E4C2289E2AB500722D10 /* AlipaySDK in Frameworks */ = {isa = PBXBuildFile; fileRef = B9EB6BCF24BDF342001A2514 /* AlipaySDK */; };
B9EB6BD424BDF5E6001A2514 /* AlipaySDK in Frameworks */ = {isa = PBXBuildFile; fileRef = B9EB6BCF24BDF342001A2514 /* AlipaySDK */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -34,7 +34,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7DE1E4C2289E2AB500722D10 /* AlipaySDK in Frameworks */,
B9EB6BD424BDF5E6001A2514 /* AlipaySDK in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -1,24 +1,20 @@
{
"name": "@coder-xiaomo/react-native-alipay",
"name": "@uiw/react-native-alipay",
"title": "React Native Alipay",
"version": "5.0.2",
"version": "5.0.0",
"description": "基于 React Native 的支付宝插件支持Android/iOS。",
"main": "index.js",
"react-native": "index",
"typings": "index.d.ts",
"files": [
"android/libs",
"android/src",
"android/build.gradle",
"react-native-alipay.podspec",
"ios",
"index.d.ts",
"index.js",
"README.md"
],
"scripts": {
"example": "yarn --cwd example",
"bootstrap": "yarn example && yarn && yarn example pods",
"build": "typedoc"
},
"repository": {
@ -43,14 +39,13 @@
"licenseFilename": "LICENSE",
"readmeFilename": "README.md",
"peerDependencies": {
"react": "*",
"react-native": "*"
"react": "^16.8.1",
"react-native": ">=0.60.0-rc.0 <1.0.x"
},
"devDependencies": {
"react": "18.0.0",
"react-native": "0.69.3",
"pod-install": "^0.1.0",
"typedoc": "0.20.36",
"typescript": "4.2.4"
"typedoc": "~0.23.10",
"typescript": "~4.7.4"
}
}

29
scripts/bootstrap.js vendored
View File

@ -1,29 +0,0 @@
const os = require('os');
const path = require('path');
const child_process = require('child_process');
const root = path.resolve(__dirname, '..');
const args = process.argv.slice(2);
const options = {
cwd: process.cwd(),
env: process.env,
stdio: 'inherit',
encoding: 'utf-8',
};
if (os.type() === 'Windows_NT') {
options.shell = true;
}
let result;
if (process.cwd() !== root || args.length) {
// We're not in the root of the project, or additional arguments were passed
// In this case, forward the command to `yarn`
result = child_process.spawnSync('yarn', args, options);
} else {
// If `yarn` is run without arguments, perform bootstrap
result = child_process.spawnSync('yarn', ['bootstrap'], options);
}
process.exitCode = result.status;