Skip to content

Commit d4e3861

Browse files
committed
docs: modify README.md
1 parent 00ba5c2 commit d4e3861

File tree

2 files changed

+54
-57
lines changed

2 files changed

+54
-57
lines changed

README-CN.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,21 @@ AliyunOSS.initWithServerSTS("/***http://ip:端口/****/",endPoint, configuration
139139

140140
1. `npm istall`
141141
2. 修改config中accessKeyId 和 accessKeySecret
142-
3. node index.js,端口默认9000,鉴权服务地址为:(http|https)://ip.com:9000/
142+
3. node index.js,端口默认9000,鉴权服务地址为:(http|https)://ip:9000/
143143

144144
* step-5:
145145

146146
```javascript
147-
<!-- 备注:目前接口仅暴漏filePath,上传路径为file:/// -->
148-
AliyunOSS.asyncUpload(bucketname, objectkey, filePath).then( (res) => {
149-
<!-- log的查看可以通过React Native自带的调试工具也可通过XCode Log控制台进行查看 -->
150-
console.log(res)
151-
}).catch((error)=>{
152-
console.log(error)
153-
})
154-
<!-- 监听上传事件和上传进度-->
155-
const downloadProgress = p => console.log(p.currentSize / p.totalSize);
156-
AliyunOSS.addEventListener('uploadProgress', downloadProgress);
147+
<!-- 备注:目前接口仅暴漏filePath,上传路径为file:/// -->
148+
AliyunOSS.asyncUpload(bucketname, objectkey, filePath).then( (res) => {
149+
<!-- log的查看可以通过React Native自带的调试工具也可通过XCode Log控制台进行查看 -->
150+
console.log(res)
151+
}).catch((error)=>{
152+
console.log(error)
153+
})
154+
<!-- 监听上传事件和上传进度-->
155+
const downloadProgress = p => console.log(p.currentSize / p.totalSize);
156+
AliyunOSS.addEventListener('uploadProgress', downloadProgress);
157157
```
158158

159159
## 接口
@@ -167,9 +167,7 @@ initWithPlainTextAccessKey | 支持| 支持
167167
initWithSigner | 支持| 支持
168168
initWithSecurityToken | 支持| 支持
169169
initWithServerSTS | 支持| 支持
170-
asyncUpload | 支持| 支持
171-
asyncAppendObject ||
172-
asyncResumableUpload ||
170+
asyncUpload | 支持| 支持 |
173171
initMultipartUpload | 支持| 支持
174172
multipartUpload | 支持| 支持
175173
listParts | 支持| 支持
@@ -376,7 +374,7 @@ AliyunOSS.asyncListBuckets().then((e) => {
376374

377375
## 示例
378376

379-
仓库Example中提供了React Native android和iOS端运行demo,Android为Example下的android工程,iOS为Example下的NativeAddRN工程,目前Example提供了所有已开发的API DEMO,还在完善中,欢迎参与共建。如何运行Example呢?
377+
仓库Example中提供了React Native android和iOS端运行demo,Android为Example下的android工程,iOS为Example下的iOS工程,目前Example提供了所有已开发的API DEMO,还在完善中,欢迎参与共建。如何运行Example呢?
380378

381379
* step-1:克隆项目并安装依赖包
382380

README.md

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -71,38 +71,39 @@ pod 'aliyun-oss-react-native', :path => '../node_modules/aliyun-oss-react-native
7171
7272
#### Android
7373
1. Add the following lines to `android/settings.gradle`:
74-
```gradle
75-
include ':react-native-rn-sdk'
76-
project(':react-native-rn-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/aliyun-oss-rn-sdk/android')
77-
```
7874
79-
2. Add the compile line to the dependencies in `android/app/build.gradle`:
80-
```gradle
81-
dependencies {
82-
compile project(':aliyun-oss-react-native')
83-
}
84-
```
75+
```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')
78+
```
8579

80+
2. Add the compile line to the dependencies in `android/app/build.gradle`:
81+
```gradle
82+
dependencies {
83+
compile project(':aliyun-oss-react-native')
84+
}
85+
```
8686
3. Add the required permissions in `AndroidManifest.xml`:
87-
```xml
88-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
89-
<uses-permission android:name="android.permission.CAMERA" />
90-
```
87+
88+
```xml
89+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
90+
<uses-permission android:name="android.permission.CAMERA" />
91+
```
9192
4. Add the import and link the package in `MainApplication.java`:
9293

93-
```java
94-
import com.reactlibrary.RNAliyunOssPackage;
94+
```java
95+
import com.reactlibrary.RNAliyunOssPackage;
9596

96-
public class MainApplication extends Application implements ReactApplication {
97-
@Override
98-
protected List<ReactPackage> getPackages() {
99-
return Arrays.<ReactPackage>asList(
100-
new MainReactPackage(),
101-
new RNAliyunOssPackage()
102-
);
103-
}
104-
}
105-
```
97+
public class MainApplication extends Application implements ReactApplication {
98+
@Override
99+
protected List<ReactPackage> getPackages() {
100+
return Arrays.<ReactPackage>asList(
101+
new MainReactPackage(),
102+
new RNAliyunOssPackage()
103+
);
104+
}
105+
}
106+
```
106107

107108
## Usage
108109

@@ -170,8 +171,6 @@ initWithSigner |Y|Y
170171
initWithSecurityToken |Y|Y
171172
initWithServerSTS |Y|Y
172173
asyncUpload |Y| Y
173-
asyncAppendObject ||
174-
asyncResumableUpload ||
175174
initMultipartUpload |Y|Y
176175
multipartUpload | Y | Y
177176
listParts |Y|Y
@@ -347,37 +346,37 @@ AliyunOSS.asyncListBuckets().then((e) => {
347346
```
348347
### doesObjectExist
349348

350-
```
351-
AliyunOSS.doesObjectExist('luozhang001','xx.png').then((e)=>{
349+
```javascript
350+
AliyunOSS.doesObjectExist('luozhang001','xx.png').then( (e) => {
351+
console.log(e)
352+
}).catch((e) => {
352353
console.log(e)
353-
}).catch((e)=>{
354-
console.log(e)
355354
})
356355
```
357356

358357
### asyncCopyObject
359358

360-
```
361-
AliyunOSS.asyncCopyObject('luozhang001',"2.png","luozhang002","sbsbsb").then((e)=>{
362-
console.log(e)
363-
}).catch((e)=>{
364-
console.log("xxxx")
365-
console.log(e)
366-
})
359+
```javascript
360+
AliyunOSS.asyncCopyObject('luozhang001',"2.png","luozhang002","sbsbsb").then( (e) => {
361+
console.log(e)
362+
}).catch((e)=>{
363+
console.log("xxxx")
364+
console.log(e)
365+
})
367366
```
368367
### asyncDeleteObject
369368

370-
```
369+
```javascript
371370
AliyunOSS.asyncDeleteObject('luozhang001','2.png').then((e)=>{
372-
Alert.alert(e)
371+
Alert.alert(e)
373372
}).catch((e)=>{
374373
console.log(e)
375374
})
376375
```
377376

378377
## DEMO
379378

380-
In the repository, we prodive RN SDK DEMO in the Example folder including andriod and ios,`Example/android` provide the android demo;`Example/NativeAddRN` provide the ios demo.Welcome to join us, how to run the Example ?
379+
In the repository, we prodive RN SDK DEMO in the Example folder including andriod and ios,`Example/android` provide the android demo;`Example/iOS` provide the ios demo.Welcome to join us, how to run the Example ?
381380

382381
* step-1:clone the project and install some dependencies
383382

0 commit comments

Comments
 (0)