aliyun / aliyun-oss-react-native

MIT License
148 stars 99 forks source link

asyncListObjects Bug & Fix #66

Open Kuhne1 opened 4 years ago

Kuhne1 commented 4 years ago

The options on the asyncListObjects is broken on ios(Haven't tested on android) All the options update the delimiter parameter on getBucket object instead of marker, prefix, maxKeys.

Please see the issue below.

File: ios/RNAliyunOSS+OBJECT.m

Current --> RCT_REMAP_METHOD OLD CODE

if([options objectForKey:@"delimiter"]) {
    getBucket.delimiter = [options objectForKey:@"delimiter"];
}

if([options objectForKey:@"marker"]) {
    getBucket.delimiter= [options objectForKey:@"marker"]; 
}

if([options objectForKey:@"prefix"]) {
    getBucket.delimiter = [options objectForKey:@"prefix"];
}

if([options objectForKey:@"maxkeys"]) {
    getBucket.delimiter = [options objectForKey:@"maxkeys"];
}

Fixed code below NEW CODE

if([options objectForKey:@"delimiter"]) {
    getBucket.delimiter = [options objectForKey:@"delimiter"];
}

if([options objectForKey:@"marker"]) {
    getBucket.marker = [options objectForKey:@"marker"]; //getBucket.marker
}

if([options objectForKey:@"prefix"]) {
    getBucket.prefix = [options objectForKey:@"prefix"]; //getBucket.prefix
}

if([options objectForKey:@"maxkeys"]) {
    getBucket.maxKeys = [options objectForKey:@"maxkeys"]; //getBucket.maxKeys
}