QCloudOfflineAuthInfo.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // QCloudOfflineAuthInfo.h
  3. // QCloudTTS
  4. //
  5. // Created by dgw on 2022/6/15.
  6. //
  7. #import <Foundation/Foundation.h>
  8. /*如果您下载的是在线版TTS SDK ,请忽略此接口文件*/
  9. NS_ASSUME_NONNULL_BEGIN
  10. // 离线授权错误吗
  11. typedef NS_ENUM(NSInteger, AuthErrorCode) {
  12. OFFLINE_AUTH_SUCCESS = 0,//"Auth Success"
  13. OFFLINE_AUTH_NETWORK_CONNECT_FAILED = -10,//"Network connect failed."
  14. OFFLINE_AUTH_NETWORK_SERVER_AUTH_FAILED = -11,//"Server Authorization Error !See Response Message."
  15. OFFLINE_AUTH_PARAMETERS_ERROR = -12,//"Parameter cannot be empty."
  16. OFFLINE_AUTH_PACKAGENAME_ERROR = -13,//"Authorization package name error."
  17. OFFLINE_AUTH_DEVICE_ID_ERROR = -14,//"Authorization device ID error."
  18. OFFLINE_AUTH_GET_DEVICE_ID_FAILED = -15,//"The device is abnormal and the device ID cannot be obtained."
  19. OFFLINE_AUTH_PLATFORM_ERROR = -16,//"The platform is not authorized."
  20. OFFLINE_AUTH_BIZCODE_ERROR = -17,//"License business does not match."
  21. OFFLINE_AUTH_EXPIRED = -18,//"Authorization has expired.")
  22. OFFLINE_AUTH_JSON_PARSE_FAILED = -19,//"JSON Parsing Error."
  23. OFFLINE_AUTH_DECODE_ERROR = -20,//"Could not decode license, please check input parameters."
  24. OFFLINE_AUTH_UNKNOWN_ERROR = -21,//"Unknown authorization error."
  25. };
  26. // 离线授权信息类
  27. @interface QCloudOfflineAuthInfo : NSObject
  28. @property (nonatomic, copy, nullable) NSString* respose; //使用在线拉取授权时,服务器返回到json数据
  29. @property (nonatomic, assign) AuthErrorCode err_code; //错误码
  30. @property (nonatomic, copy, nullable) NSString* err_msg; //错误信息
  31. @property (nonatomic, copy, nullable) NSString* deviceId; //设备id
  32. @property (nonatomic, copy, nullable) NSString* expireTime; //到期时间
  33. @property (nonatomic, copy, nullable) NSString* voiceAuthList; //已授权的音色名列表,用分号隔开
  34. +(instancetype _Nonnull )getQCloudOfflineAuthInfo:(AuthErrorCode)err_code Respose:(NSString*_Nullable)respose;
  35. +(NSString* _Nonnull )getErrorMsg:(AuthErrorCode)code;
  36. @end
  37. NS_ASSUME_NONNULL_END