Skip to content

Commit 0b4122f

Browse files
committed
docs: link aliyun-oss-react-native and repair initWithSecurityToken and initWithServerSTS
1 parent cfa75d1 commit 0b4122f

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

README-CN.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ yarn install aliyun-oss-react-native --save
5151
react native项目下运行`react-native link`命令
5252

5353
```script
54-
react-native link
54+
react-native link aliyun-oss-react-native
5555
```
5656

5757
注意:由于react native脚手架不同版本的问题,有时候自动安装可能会失败,可手动添加android和iOS的的依赖库。同样为了兼容IPv6-Only网络,iOS工程中需参考aliyun-oss-ios-sdk说明中引入以下包。
@@ -193,7 +193,7 @@ AliyunOSS.enableDevMode()
193193

194194
### initWithPlainTextAccessKey(不建议)
195195

196-
该接口需要通过明文授权acckeyId和accekeySecret,开发者这可以使用,但是我们不建议
196+
该接口需要通过明文授权accesskeyId和accesskeySecret,开发者这可以使用,但是我们不建议
197197

198198
```javascript
199199
const endPoint = "XXX"
@@ -202,7 +202,7 @@ const configuration = {
202202
timeoutIntervalForRequest: 30,
203203
timeoutIntervalForResource: 24 * 60 * 60
204204
};
205-
AliyunOSS.initWithPlainTextAccessKey(accessKey, secretKey, endPoint, configuration);
205+
AliyunOSS.initWithPlainTextAccessKey(accesskeyId, accesskeySecret, endPoint, configuration);
206206
```
207207

208208
### initWithSigner
@@ -218,15 +218,15 @@ AliyunOSS.initWithSigner(signature, accessKey, endPoint, configuration);
218218
该接口通过SecurityToken授权,参考[STS访问控制](https://help.aliyun.com/document_detail/32046.html?spm=a2c4g.11186623.2.8.dfV9i0),使用可查看
219219

220220
```
221-
AliyunOSS.initWithSecurityToken(signature, accessKey, endPoint, configuration);
221+
AliyunOSS.initWithSecurityToken(SecurityToken, accessKeyId, accessKeySecret, endPoint, configuration);
222222
```
223223

224224
### initWithServerSTS
225225

226226
该接口通过本地鉴权服务器授权,使用可查看
227227

228228
```javascript
229-
AliyunOSS.initWithSecurityToken(signature, accessKey, endPoint, configuration);
229+
AliyunOSS.initWithSecurityToken(/*local auth server*/, endPoint, configuration);
230230
```
231231

232232
### asyncUpload
@@ -241,10 +241,10 @@ AliyunOSS.asyncUpload(bucketname, objectKey, filepath).then().catch()
241241

242242
```javascript
243243
AliyunOSS.initMultipartUpload(bucketname,objectkey).then((e)=>{
244-
console.log(e)
245-
//e 为uploadId
244+
//e 为uploadId
245+
console.log(e)
246246
}).catch((error) => {
247-
console.log(error)
247+
console.log(error)
248248
})
249249
```
250250
### multipartUpload
@@ -280,7 +280,7 @@ AliyunOSS.listParts(multipartBucket,multipartObjectKey,upoadId).then((e)=>{
280280

281281
```
282282
// xxx为图片处理选项,具体可查看官网
283-
AliyunOSS.asyncDownload(bucketname,objectkey,{"x-oss-process":'xxxx'}).then((e) => {
283+
AliyunOSS.asyncDownload(bucketname,objectkey,{"x-oss-process": 'xxxx'}).then((e) => {
284284
console.log(e)
285285
}).catch((e)=>{
286286
console.log(e)

README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ yarn install aliyun-oss-react-native --save
5050
run `react-native link` in the react native project
5151

5252
```
53-
react-native link
53+
react-native link aliyun-oss-react-native
54+
```
55+
56+
`Note`:for suppport IPv6-Only networkd,you need to require :
57+
```javascript
58+
1. libresolv.tbd
59+
2. CoreTelephony.framework
60+
3. SystemConfiguration.framework
5461
```
5562

5663
### Manual Installation
@@ -66,15 +73,15 @@ pod 'aliyun-oss-react-native', :path => '../node_modules/aliyun-oss-react-native
6673
- **no CocoaPods**
6774
6875
1. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ `Add Files to <...>` Go to `node_modules` ➜ `aliyun-oss-react-native` ➜ `ios` ➜ select `RNAliyunOSS.xcodeproj`
69-
2. Add `RNAliyun.a` to `Build Phases -> Link Binary With Libraries`
76+
2. Add `libRNAliyunOSS.a` to `Build Phases -> Link Binary With Libraries`
7077
3. In XCode, in the project navigator, right click `Frameworks` ➜ `Add Files to [your project's name]`. Go to `node_modules` ➜ `aliyun-oss-react-native` ➜ `AliyunSDK`. Add `AliyunOSSiOS.framework`, and select *Copy items if needed* in the pop-up box.
7178
7279
#### Android
7380
1. Add the following lines to `android/settings.gradle`:
7481
7582
```gradle
76-
include ':react-native-rn-sdk'
77-
project(':react-native-rn-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/aliyun-oss-rn-sdk/android')
83+
include ':react-native-react-sdk'
84+
project(':react-native-react-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/aliyun-oss-rn-sdk/android')
7885
```
7986

8087
2. Add the compile line to the dependencies in `android/app/build.gradle`:
@@ -221,33 +228,33 @@ AliyunOSS.initWithSigner(signature, accessKey, endPoint, configuration);
221228

222229
init client with SecurityToken
223230

224-
```
225-
AliyunOSS.initWithSecurityToken(signature, accessKey, endPoint, configuration);
231+
AliyunOSS.initWithSecurityToken(SecurityToken, accessKeyId, accessKeySecret, endPoint, configuration);
232+
226233
```
227234
228235
### initWithServerSTS
229236
230-
init auth client with loacl auth server
237+
init auth client with local auth server
231238
232239
```javascript
233-
AliyunOSS.initWithSecurityToken(signature, accessKey, endPoint, configuration);
240+
AliyunOSS.initWithServerSTS(/*local auth server*/, endPoint, configuration);
234241
```
235242

236243
### asyncUpload
237244

238245
```
239-
AliyunOSS.asyncUpload(bucketname, objectKye, filepath).then().catch()
246+
AliyunOSS.asyncUpload(bucketname, objectKey, filepath).then().catch()
240247
```
241248
### asyncAppendObject
242249
### asyncResumableUpload
243250
### initMultipartUpload
244251

245252
```javascript
246-
AliyunOSS.initMultipartUpload(bucketname,objectkey).then((e)=>{
247-
console.log(e)
248-
//e is uploadId
253+
AliyunOSS.initMultipartUpload(bucketname,objectkey).then((e) => {
254+
//e is uploadId
255+
console.log(e)
249256
}).catch((error) => {
250-
console.log(error)
257+
console.log(error)
251258
})
252259
```
253260
### multipartUpload

0 commit comments

Comments
 (0)