Latest1.0.6
Homepagehttps://github.com/newsdata/shuwen-chatrobot-sdk
LicenseMIT
Platformsios 8.0, requires ARC
DependenciesSHWAnalyticsSDK
FrameworksCoreLocation, SystemConfiguration, CoreFoundation, Security
Authors

iOS 智能会话SDK 接入指南(v1.0.6)

Deploy target : iOS 8.0.

1 如何接入

1.1 在项目的 Podfile 中,添加如下依赖:

target 'YourProject' do
pod 'SHWChatRobotSDK', '~> 1.0.6'
end

1.2 更新安装

pod update
pod install

2 Regist your app.

Get your AppKey in our web site.
appKey值可从新华智云接口人获取(网站建设中,目前请联系接口人)

3 How to use

3.1 设置AppKey和AppSecret

//选择是否使用测试环境。默认为NO,使用正式环境。
[SHWCRPublicConfig setIsTestEnvironment:YES];
[SHWCRPublicConfig setSWAppKey:@"Your_APPKEY" secretKey:@"Your_APPSECRET"];

3.2 提问接口

@interface SHWCRQuestionService : NSObject

/**
*    @brief    聊天中的发送问句接口
*
*    @param     question     用户问句
*    @param     completionHandler     包含服务器返回结果result的回调block
*/+ (void)askQuestion:(NSString *)question callback:(void (^)(NSDictionary *result, NSString *clientErrMsg, NSInteger clientCode))completionHandler;

4 其它

项目使用了巴吉度,请参考接入文档

项目使用了http协议,所以需要适配

  • Info.plist中添加NSAppTransportSecurity类型Dictionary
  • NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES
  • Build settingBuild Options 中的Enable Bitcode 置为 NO

5 错误码

错误码错误类型
200无错误
500服务器错误
900解析错误
901没有有效数据
1000未知错误
1011网络错误

Latest podspec

{
    "name": "SHWChatRobotSDK",
    "version": "1.0.6",
    "summary": "iOSu804au5929u673au5668u4ebau65e0UI SDK",
    "homepage": "https://github.com/newsdata/shuwen-chatrobot-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yangyang": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/newsdata/shuwen-chatrobot-sdk.git",
        "tag": "1.0.6"
    },
    "vendored_frameworks": "SHWChatRobotSDK/Classes/SHWChatRob.framework",
    "requires_arc": true,
    "frameworks": [
        "CoreLocation",
        "SystemConfiguration",
        "CoreFoundation",
        "Security"
    ],
    "dependencies": {
        "SHWAnalyticsSDK": [
            "~> 1.1.8"
        ]
    }
}

Pin It on Pinterest

Share This