Latest 1.3.6
Homepage https://github.com/rooboios/PuddingSDK
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit, WebKit, CoreTelephony, SystemConfiguration, MobileCoreServices, AVFoundation
Authors

RooboSDK

1.SDK初始化

/**
*  @param channelNum 渠道号
*  @param env        环境(appstore,企业,内侧)
*/
+ (void)startWithChannel:(int)channelNum Env:(RBAppEnv)env;

2.用户注册与登录

2.1登陆

/**
*  @param loginBlock  登陆回调
*  @param registBlock 注册回调
*  @param forgetBlock 忘记密码回调
*
*/
+ (void)userLoginWithBackBtnHidden:(BOOL)isHidden login:(nullable void(^)( RBUserModel * _Nullable userModel,NSError * _Nullable error))loginBlock Regist:(nullable void(^)(RBUserModel * _Nullable  userModel,NSError *  _Nullable error))registBlock Forget:(nullable void(^)(BOOL isSucceed,NSError * _Nullable error))forgetBlock;

2.2 注册

/**
*  @param completionBlock 注册结果回调
*
*/
+ (void)userRegist:(nullable void(^)(RBUserModel * _Nullable userModel,NSError * _Nullable error))completionBlock;

2.3忘记密码

/**
*  @param completionBlock 完成回调
*/
+ (void)userForgetPsd:(nullable void(^)(BOOL isSucceed,NSError * _Nullable error))completionBlock;

2.4修改账号

/**
*  @param completionBlock 完成回调
*/
+ (void)userModifyAccount:(nullable void(^)(BOOL isSucceed,NSError * _Nullable error))completionBlock;

2.5修改密码

/**
*  @param completionBlock 完成回调
*/
+ (void)userModifyPsd:(nullable void(^)(BOOL isSucceed,NSError * _Nullable error))completionBlock;

2.6修改其他人的名称

/**
注:管理员才能修改
@param userID 用户的ID
@param name 用户的名称
*/
+ (void)updateOthersUserID:(NSString *_Nonnull)userID name:(NSString *_Nonnull)name completionBlock:(nullable void (^)(BOOL  isSucceed,NSError * _Nullable error)) completionBlock;

2.7更改用户昵称

/**
@param name 名称
*/
+ (void)updateUserName:(NSString *_Nonnull)name completionBlock:(nullable void (^)(BOOL isSucceed,NSError * _Nullable error)) completionBlock;

2.8上传用户头像

/**
*  @param img             图片
*  @param progressBlock   进度回调
*  @param completionBlock 完成回调 response
*/
+ (void)uploadUserImg:(UIImage *_Nonnull)img  progressBlock:(nullable void(^)(NSProgress * _Nullable progress))progressBlock completionBlock:(nullable void (^)(BOOL isSucceed,id response,NSError * _Nullable error))completionBlock;

2.9退出登录

/**
退出登录
*/
+ (void)logOut:(nullable void (^)(BOOL isSucceed,NSError * _Nullable error)) completionBlock;

3.配置网络

3.1打开设备声波配网功能

*  @param deviceID     设备 ID
*  @param netType     网络类型   
RBModifyNetType_ModifyNet:修改网络,
RBModifyNetType_BindDevice:绑定设备配网
+ (void)openVoiceConfigNetWithDeviceID:(NSString *_Nonnull) deviceID type:(RBModifyNetType)netType completionBlock:(nullable void (^)(BOOL isSucceed,NSError * _Nullable error)) completionBlock;

3.2请将手机靠近布丁

+ (void)playNearPudding;

3.3播放声波配网文件

/**
*  @param wifiName wifi 名称
*  @param wifiPsd   wifi 密码
*/
+ (void)playVoiceConfigNetFileWithWifiName:(NSString *_Nonnull)wifiName wifiPsd:(NSString * _Nonnull)wifiPsd;

3.4 获取绑定配网结果

/**
*  @description 此接口会不断通过completionBlock 返回结果,调用此接口时需等待最后的回调,
当 result 为 success 或 failure 时表示此次调用结束。
*  @param completionBlock 中的参数:
isSucceed: 绑定配网是否成功
error:错误信息
dict:result状态  -> wait     正在获取结果
-> failure  失败
-> success  成功
msg 详情描述
*
*/
+ (void)startGetVoiceConfigNetResultBlock:(nullable void (^)(BOOL isSucceed,NSDictionary *_Nullable dict,NSError *_Nullable error)) completionBlock;

3.5获取修改网络结果

/**
*  @description 此接口会不断通过completionBlock 返回结果,调用此接口时需等待最后的回调,
当 result 为success 或failure 时表示此次调用结束。
*  @param completionBlock 中的参数:
isSucceed: 修改网络是否成功
error:错误信息
dict:result状态  -> wait     正在获取结果
-> failure  失败
-> success  成功
msg 详情描述
*
*/
+ (void)startGetModifyNetResultBlock:(nullable void (^)(BOOL isSucceed,NSDictionary *_Nullable dict,NSError *_Nullable error))completionBlock;

4设备权限

4.1更改管理员

/**
@param deviceID 设备ID
@param userID 用户的ID
*/
+ (void)changeManager:(NSString *_Nonnull)deviceID userID:(NSString *_Nonnull)userID completionBlock:(nullable void (^)(BOOL isSucceed, NSError *_Nullable error))completionBlock;

4.2删除所绑定的设备

/**
@param deviceID 设备ID
*/
+ (void)deleteOwnDevice:(NSString *_Nonnull) deviceID  completionBlock:(nullable void (^)(BOOL isSucceed,NSError * _Nullable error)) completionBlock;

4.3添加其他用户到设备成员组里面

/**
@param userPhone 用户的手机号码
*/
+ (void)addUser:(NSString *_Nonnull)userPhone deviceID:(NSString*_Nonnull)deviceID completionBlock:(nullable void (^)(id _Nullable response,NSError *_Nullable error)) completionBlock;

4.4从当前设备成员组中删除用户

/**
@param userid 用户 id
*/
+ (void)deleteUser:(NSString *_Nonnull)userid deviceID:(NSString*_Nonnull)deviceID  completionBlock:(nullable void (^)(id _Nullable response,NSError *_Nullable error)) completionBlock;

5.设备信息

5.1获取当前用户的所有设备

/**
获取当前用户的所有设备
*/
+ (void)fetchAllDevices:(nullable void(^)(NSArray <RBDeviceModel*>* _Nullable device,NSError * _Nullable error))completionBlock;

5.2获取设备硬件信息

/**
@param deviceID 设备的ID数据
*/
+ (void)fetchHardwareInfo:(NSString*_Nonnull)deviceID completion:(nullable void(^)(RBHardware* _Nullable device,NSError * _Nullable error))completionBlock;

5.3获取设备的信息

/**
@param deviceID 设备的ID
*/
+ (void)fetchDeviceDetail:(NSString *_Nonnull) deviceID completionBlock:(nullable void (^)(RBDevicesDetail * _Nullable detail,NSError *_Nullable error)) completionBlock;

6 设备操控

6.1发送表情

/**

@param deviceID 设备ID
@param emojiType 表情ID 
*/
+ (void)sendEmoji:(NSString *_Nonnull)deviceID emojiType:(RBEmojiType) emojiType completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

6.2发送文本内容

/**
@param deviceID 设备ID
@param text 文字内容
*/
+ (void)sendTTS:(NSString *_Nonnull)deviceID content:(NSString *_Nonnull)text completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

6.3旋转设备

/**
旋转设备

@param deviceID 设备ID
@param angle 角度值
*/
+ (void)rotateDevice:(NSString *_Nonnull)deviceID angle:(float)angle completionBlock:(nullable void (^)(BOOL isSucceed,NSError * _Nullable error)) completionBlock;

6.4重启设备

/**
@param completionBlock isSucceed 重启是否成功 error 错误信息
*/
+ (void)restart:(NSString *_Nonnull) deviceID  completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

6.5开启安全防护

/**
@param deviceID 设备的ID
@param isOn 是否打开
*/
+ (void)switchSafetyState:(NSString* _Nonnull)deviceID isOn:(BOOL)isOn completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

6.6修改设备的安防时间段

/**
@param deviceID 设备的ID
@param startTime 开始时间
@param endTime 结束时间
*/
+ (void)updateSafetyTime:(NSString*_Nonnull)deviceID startTime:(NSString * _Nonnull)startTime endTime:(NSString *_Nonnull)endTime  completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

6.7设置夜间模式开关

/**
注:不管是设置时间段和设置夜间模式开关 都需要传送开始时间和结束时间
@param deviceID 设备ID
@param settingType 设置时间段和设置夜间模式开关
@param switchState 夜间模式的开关
@param startTime 开始时间 格式@"07:22"
@param endTime 结束时间   格式@"10:00"
*/
+(void)updateNightMode:(NSString *_Nonnull) deviceID nightSetting:(RBNightSetting)settingType switchState:(BOOL)switchState startTime:(NSString * _Nonnull)startTime endTime:(NSString *_Nonnull)endTime completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

7.设备设置

7.1修改设备的名称

/**
@param deviceID  设备的ID
@param newName 新的名称
*/
+ (void)updateDeviceName:(NSString*_Nonnull)deviceID name:(NSString *_Nonnull)newName completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

7.2进入视频连接成功的声音开关

/**
@param deviceID 设备的ID
@param isOn 打开或者关闭
*/
+ (void)switchVideoConnetVoice:(NSString *_Nonnull) deviceID isOn:(BOOL) isOn completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

7.3修改设备音量

/**
@param deviceID 设备的ID
@param voiceValue 音量值 最小值0 最大值100
*/
+ (void)updateVolume:(NSString *_Nonnull) deviceID voice:(float)voiceValue completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

7.4修改设备的声音音色类型

/**
@param deviceID 设备的id
@param soundName 字符串  NANNAN 或 ROOBO_BOY
*/
+ (void)updateSound:(NSString *_Nonnull ) deviceID  soundName:(NSString* _Nonnull)soundName completionBlock:(nullable void (^)(BOOL isSucceed,NSError *_Nullable error)) completionBlock;

8设备语音

8.1获取 DIY 列表

/**
*  获取 DIY 列表
*  @param deviceId 设备 Id
*  @param start 开始索引
*  @param count 获取数量
*/
+ (void)getDiyListWith:(NSString *_Nonnull)deviceId startNum:(int)start count:(int)count completionBlock:(nullable void (^)(id response,NSError *_Nullable error)) completionBlock;

8.2修改(增加) DIY 问答

/**
*  修改(增加) DIY 问答
*  @param deviceId 设备 ID
*  @param qid 问题 ID
*  @param question 问题
*  @param response 答案
*/
+ (void)updateDiyWithDeviceId:(NSString*_Nonnull)deviceId QuestionId:(NSNumber * _Nullable)qid question:(NSString *_Nonnull)question response:(NSString *_Nonnull)response completionBlock:(nullable void (^)(id response, NSError * _Nullable))completionBlock;

8.3删除 DIY 问答

/**
@param deviceId 设备 ID
@param ids 问题id数组
@param completionBlock error -345: 已存在相同的问答
*/
+ (void)deleteDiyWithDeviceId:(NSString *)deviceId Ids:(NSArray *)ids completionBlock:(void (^)(BOOL, NSError * _Nullable))completionBlock;

8.4获取tts推荐数据

/**
@param deviceId 设备 ID
*/
+(void )fetchTTSListWithDeviceId:(NSString *)deviceId completionBlock:(void (^)(id  _Nullable response, NSError * _Nullable))completionBlock;

8.5获取tts习惯列表

/**
@param deviceId 设备 ID
*/
+ (void )fetchHabitListWithDeviceId:(NSString *)deviceId completionBlock:(void (^)(id  _Nullable response, NSError * _Nullable))completionBlock;

8.6获取tts趣味列表

/**
注:每次请求返回的数据都存在不一样 随机返回
@param deviceId 设备 ID
@param pageZize 每次请求返回的数量 
*/
+ (void)fetchFunnyListWithDeviceId:(NSString *)deviceId pageSize:(NSInteger) pageZize completionBlock:(void (^)(id response, NSError * _Nullable))completionBlock ;

8.7上传趣味变声文件

/**
@param fileURL 文件url 路径
@param deviceId 设备 ID
@param progressBlock 上传进度
@param completionBlock 上传结果
*/
+ (void)uploadFunnyVoiceFileURL:(NSURL *)fileURL deviceId:(NSString *)deviceId progressBlock:(void(^)(NSProgress *progress))progressBlock  completionBlock:(void (^)(id  _Nullable response, NSError * _Nullable))completionBlock;

Latest podspec

{
    "name": "PuddingSDK",
    "version": "1.3.6",
    "summary": "A short summary of PuddingSDK.",
    "description": "A short description of PuddingSDK.",
    "homepage": "https://github.com/rooboios/PuddingSDK",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "roo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rooboios/PuddingSDK.git",
        "tag": "1.3.6"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "vendored_frameworks": "PuddingSDK/ios/RooboSDK.framework",
    "frameworks": [
        "UIKit",
        "WebKit",
        "CoreTelephony",
        "SystemConfiguration",
        "MobileCoreServices",
        "AVFoundation"
    ],
    "libraries": "c++",
    "resources": "PuddingSDK/ios/Resources/**/*.bundle"
}

Pin It on Pinterest

Share This