Latest 2.1.2
Homepage https://github.com/ks3sdk/ks3-ios-sdk
License Apache License, Version 2.0
Platforms ios 7.0, requires ARC
Authors

KS3 SDK for iOS

安装

通过 CocoaPods

pod "Ks3SDK", "~> 2.0.0"

使用方法

首先需要初始化KS3Client。可以利用AccessKeyID、AccessKeySecret初始化(由于AccessKeySecret要放在客户端,因此不安全,仅建议测试时使用),代码如下:


    [[KS3Client initialize] connectWithAccessKey:strAccessKey withSecretKey:strSecretKey];

第二种方式利用token进行请求,每次需要调用SDK的API时都需要使用请求一次token,然后用这个token初始化KS3Request的strKS3Token,再进行API请求(推荐使用),对应的代码如下:


    [YourAppServer sendAsynchronousRequest:tokenRequest queue:[NSOperationQueue currentQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        if (connectionError == nil) {
            NSString *strToken = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
            ks3Request.strKS3Token = strToken; // 设置Token
            [[KS3Client initialize] listBuckets:(KS3ListBucketsRequest *)listBucketRequest]; // 调用KS3 API接口
            // 剩余处理
        }
        else {
            // 错误处理
        }
    }];

服务端签名计算方法参考:API接口文档

API详细使用方法参考 使用文档

示例代码

  • 完整的demo 见 KS3SDKDemo 目录下的代码

代码许可

Apache License, Version 2.0。详情见 License 文件.

Latest podspec

{
    "name": "Ks3SDK",
    "version": "2.1.2",
    "summary": "iOS SDK for Kingsoft Standard Storage Service",
    "description": "An iOS SDK for developers to use Kingsoft Standard Storage Service easier.",
    "homepage": "https://github.com/ks3sdk/ks3-ios-sdk",
    "license": "Apache License, Version 2.0",
    "authors": {
        "voidmain": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ks3sdk/ks3-ios-sdk.git",
        "tag": "v2.1.2"
    },
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "source_files": "KS3YunSDK/**/*.{h,m}"
}

Pin It on Pinterest

Share This