TUICallDefine.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. //
  2. // TUICallDefine.h
  3. // TUICallKit
  4. //
  5. // Created by noah on 2022/9/15.
  6. // Copyright © 2022 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <TUICallEngine/TUICommonDefine.h>
  10. @class TUIOfflinePushInfo;
  11. typedef void (^TUICallSucc)(void);
  12. typedef void (^TUICallFail)(int code, NSString *_Nullable errMsg);
  13. /// TUICallEngine Version
  14. static const NSString * _Nullable TUICALL_VERSION = @"2.7.0.1145";
  15. /// You do not have TUICallKit package, please open the free experience in the console or purchase the official package
  16. static const int ERROR_PACKAGE_NOT_PURCHASED = -1001;
  17. /// The package you purchased does not support this ability
  18. static const int ERROR_PACKAGE_NOT_SUPPORTED = -1002;
  19. /// TIM SDK version is too old, Please upgrade version >= 6.6
  20. static const int ERROR_TIM_VERSION_OUTDATED = -1003;
  21. /// Camera or microphone not authorized
  22. static const int ERROR_PERMISSION_DENIED = -1101;
  23. /// not login , please call init() in TUICallEngine first
  24. static const int ERROR_INIT_FAIL = -1201;
  25. /// Params error
  26. static const int ERROR_PARAM_INVALID = -1202;
  27. /// Current status not support
  28. static const int ERROR_REQUEST_REFUSED = -1203;
  29. /// The current method is calling, Do not call it repeatedly
  30. static const int ERROR_REQUEST_REPEATED = -1204;
  31. /// This function is not supported in the current call scene
  32. static const int ERROR_SCENE_NOT_SUPPORTED = -1205;
  33. /// Signaling send failed
  34. static const int ERROR_SIGNALING_SEND_FAIL = -1401;
  35. /// Media type
  36. typedef NS_ENUM(NSInteger, TUICallMediaType) {
  37. TUICallMediaTypeUnknown,
  38. TUICallMediaTypeAudio,
  39. TUICallMediaTypeVideo,
  40. };
  41. /// Call role
  42. typedef NS_ENUM(NSUInteger, TUICallRole) {
  43. TUICallRoleNone,
  44. TUICallRoleCall,
  45. TUICallRoleCalled,
  46. };
  47. /// Call status
  48. typedef NS_ENUM(NSUInteger, TUICallStatus) {
  49. TUICallStatusNone,
  50. TUICallStatusWaiting,
  51. TUICallStatusAccept,
  52. };
  53. /// Call scene
  54. typedef NS_ENUM(NSUInteger, TUICallScene) {
  55. TUICallSceneGroup,
  56. TUICallSceneMulti,
  57. TUICallSceneSingle,
  58. };
  59. /// CallResult
  60. typedef NS_ENUM(NSUInteger, TUICallResultType) {
  61. TUICallResultTypeUnknown,
  62. TUICallResultTypeMissed,
  63. TUICallResultTypeIncoming,
  64. TUICallResultTypeOutgoing,
  65. };
  66. typedef NS_ENUM(NSInteger, TUICallIOSOfflinePushType) {
  67. TUICallIOSOfflinePushTypeAPNs = 0, // APNs
  68. TUICallIOSOfflinePushTypeVoIP = 1, // VoIP
  69. };
  70. /// OfflinePushInfo
  71. NS_ASSUME_NONNULL_BEGIN
  72. @interface TUIOfflinePushInfo : NSObject
  73. @property(nonatomic, copy) NSString *title;
  74. @property(nonatomic, copy) NSString *desc;
  75. @property(nonatomic, assign) BOOL isDisablePush;
  76. /// Default: TUICallIOSOfflinePushTypeAPNs
  77. @property(nonatomic, assign) TUICallIOSOfflinePushType iOSPushType;
  78. @property(nonatomic, assign) BOOL ignoreIOSBadge;
  79. @property(nonatomic, copy) NSString *iOSSound;
  80. @property(nonatomic, copy) NSString *AndroidSound;
  81. @property(nonatomic, copy) NSString *AndroidOPPOChannelID;
  82. @property(nonatomic, copy) NSString *AndroidFCMChannelID;
  83. @property(nonatomic, copy) NSString *AndroidXiaoMiChannelID;
  84. @property(nonatomic, assign) NSInteger AndroidVIVOClassification;
  85. @property(nonatomic, copy) NSString *AndroidHuaWeiCategory;
  86. @property(nonatomic, copy) NSString *extraInfo;
  87. @end
  88. /// Extension param
  89. @interface TUICallParams : NSObject
  90. @property(nonatomic, strong) TUIRoomId *roomId;
  91. @property(nonatomic, strong) TUIOfflinePushInfo *offlinePushInfo;
  92. @property(nonatomic, assign) int timeout;
  93. /// Extended Fields: Used to add extended information in invitation signaling
  94. @property(nonatomic, copy) NSString *userData;
  95. @end
  96. @interface TUICallRecords : NSObject
  97. @property(nonatomic, copy) NSString *callId;
  98. @property(nonatomic, copy) NSString *inviter;
  99. @property(nonatomic, strong) NSArray *inviteList;
  100. @property(nonatomic, assign) TUICallScene scene;
  101. @property(nonatomic, assign) TUICallMediaType mediaType;
  102. @property(nonatomic, copy) NSString *groupId;
  103. @property(nonatomic, assign) TUICallRole role;
  104. @property(nonatomic, assign) TUICallResultType result;
  105. @property(nonatomic, assign) NSTimeInterval beginTime;
  106. @property(nonatomic, assign) NSTimeInterval totalTime;
  107. @end
  108. @interface TUICallRecentCallsFilter : NSObject
  109. @property(nonatomic, assign) NSTimeInterval begin;
  110. @property(nonatomic, assign) NSTimeInterval end;
  111. @property(nonatomic, assign) TUICallResultType result;
  112. @end
  113. NS_ASSUME_NONNULL_END