config.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. //
  2. // config.h
  3. // ABtong
  4. //
  5. // Created by qin on 2025/7/28.
  6. //
  7. //
  8. #ifndef config_h
  9. #define config_h
  10. #import <UIKit/UIKit.h>
  11. #ifdef DEBUG
  12. static NSString *WebSocketUrl = @"ws://abt1.my-im.com:9326?";
  13. #else
  14. static NSString *WebSocketUrl = @"ws://aiim.my-im.com:9326?";
  15. #endif
  16. #ifdef DEBUG
  17. static NSString *httphost = @"https://abt1.my-im.com";
  18. #else
  19. static NSString *httphost = @"http://aiim.my-im.com:8080";
  20. #endif
  21. //abt1.my-im.com,abt2.my-im.com是安博通版本的两台测试服务器,
  22. //abt1.my-im.com可以替换原来的52,做开发环境测试。
  23. //本地数据库文件名称
  24. static NSString *locateDB = @"BlocateDB.sqlite";
  25. //JitsiMeet 服务器
  26. static NSString *JitsiMeetSV = @"https://rtc2.my-im.com/";
  27. //static NSString *JitsiMeetSV = @"https://rtc.my-im.com/";
  28. //static NSString *JitsiMeetSV = @"https://meet.jit.si/";
  29. //旧地址 @"https://rtc.my-im.com/"
  30. static NSString *filehttphost = @"http://upload.my-im.com";//生产文件服务器
  31. static NSString * privacyPolicy = @"https://main.abtim-my.com/myimyszc.html";//隐私政策
  32. //websocket
  33. //心跳
  34. static NSString *SendCode_PING= @"0";
  35. //准备
  36. static NSString *SendCode_READY= @"1";
  37. //消息
  38. static NSString *SendCode_MESSAGE= @"2";
  39. //读取消息
  40. static NSString *SendCode_READ= @"3";
  41. //其他设备登录
  42. static NSString *SendCode_OTHER_LOGIN= @"4";
  43. //好友申请
  44. static NSString *SendCode_NEW_FRIEND= @"5";
  45. //群申请验证
  46. static NSString *SendCode_GROUP_VALIDATE= @"6";
  47. //音视频通话结果
  48. static NSString *SendCode_WEBRTC_result= @"7";
  49. //视频通话
  50. static NSString *SendCode_WEBRTC_CALL= @"8";
  51. //关闭视频通话
  52. static NSString *SendCode_WEBRTC_CLOSE= @"9";
  53. //视频通话忙碌
  54. static NSString *SendCode_WEBRTC_BUSY= @"10";
  55. //webrtc信令
  56. static NSString *SendCode_WEBRTC_xinling= @"11";
  57. //对方正在忙
  58. static NSString *SendCode_WEBRTC_DFBUSY= @"12";
  59. //删除指令
  60. static NSString *SendCode_deletemsg= @"del";
  61. //消息已收到回执
  62. static NSString *SendCode_RECMsg = @"rec";
  63. //message
  64. //文本消息
  65. static NSString *MessageType_text= @"0";
  66. //图片消息
  67. static NSString *MessageType_image= @"1";
  68. //文件消息
  69. static NSString *MessageType_file= @"2";
  70. //语音消息
  71. static NSString *MessageType_voice= @"3";
  72. //撤回消息
  73. static NSString *MessageType_back= @"4";
  74. //删除消息
  75. static NSString *MessageType_delete= @"del";
  76. //视频消息
  77. static NSString *MessageType_video= @"5";
  78. //转发的消息
  79. static NSString *MessageType_forward= @"6";
  80. //音视频通话结果
  81. static NSString *MessageType_webrtcrs= @"7";
  82. //事件消息
  83. static NSString *MessageType_event= @"9";
  84. //webrtc 信令消息
  85. static NSString *MessageType_webrtc= @"webrtc";
  86. // 撤回
  87. static NSString *MessageType_CallBack2 = @"11"; // 撤回2
  88. // 删除
  89. static NSString *MessageType_Del = @"12";
  90. // 对方正在忙
  91. static NSString *MessageType_DFBUSY = @"13";
  92. static NSString *Type_FRIEND= @"0";
  93. static NSString *Type_GROUP= @"1";
  94. static int MAX_USERS = 100;
  95. typedef NS_ENUM(NSInteger, GlobalColorType) {
  96. GCTypeGreen,
  97. GCTypeGreend,
  98. GCTypeYellow,
  99. GCTypeBluel,
  100. GCTypeBlued,
  101. GCTypeRedd,
  102. GCTypeRedl,
  103. GCTypeOrangeR,
  104. GCTypeDark1,
  105. GCTypeDark2,
  106. GCTypeDark3,
  107. GCTypeDark4,
  108. GCTypeDark5,
  109. GCTypeDark6,
  110. GCTypeDark7,
  111. GCTypeWhite,
  112. GCTypeBlack,
  113. GCTypeinpuv,
  114. GCTycellbg,
  115. };
  116. static inline UIColor *globalColor(GlobalColorType type) {
  117. switch (type) {
  118. case GCTypeGreen:
  119. return [UIColor colorWithRed:0x1E/255.0 green:0xEC/255.0 blue:0x99/255.0 alpha:1.0];
  120. case GCTypeGreend:
  121. return [UIColor colorWithRed:0x50/255.0 green:0xCA/255.0 blue:0x75/255.0 alpha:1.0];
  122. case GCTypeYellow:
  123. return [UIColor colorWithRed:0xF0/255.0 green:0xFB/255.0 blue:0x60/255.0 alpha:1.0];
  124. case GCTypeBluel:
  125. return [UIColor colorWithRed:0x2E/255.0 green:0xF6/255.0 blue:0xE6/255.0 alpha:1.0];
  126. case GCTypeBlued:
  127. return [UIColor colorWithRed:0x58/255.0 green:0x28/255.0 blue:0xEE/255.0 alpha:1.0];
  128. case GCTypeRedd:
  129. return [UIColor colorWithRed:0xFF/255.0 green:0x3A/255.0 blue:0x00/255.0 alpha:1.0];
  130. case GCTypeRedl:
  131. return [UIColor colorWithRed:0xFF/255.0 green:0x5F/255.0 blue:0x00/255.0 alpha:1.0];
  132. case GCTypeOrangeR:
  133. return [UIColor colorWithRed:0xFF/255.0 green:0x66/255.0 blue:0x00/255.0 alpha:1.0];
  134. case GCTypeDark1:
  135. return [UIColor colorWithRed:0xF3/255.0 green:0xF4/255.0 blue:0xFF/255.0 alpha:1.0];
  136. case GCTypeDark2:
  137. return [UIColor colorWithRed:0xD2/255.0 green:0xD2/255.0 blue:0xD2/255.0 alpha:1.0];
  138. case GCTypeDark3:
  139. return [UIColor colorWithRed:0xA1/255.0 green:0xA1/255.0 blue:0xA1/255.0 alpha:1.0];
  140. case GCTypeDark4:
  141. return [UIColor colorWithRed:0x78/255.0 green:0x7C/255.0 blue:0x85/255.0 alpha:1.0];
  142. case GCTypeDark5:
  143. return [UIColor colorWithRed:0x34/255.0 green:0x34/255.0 blue:0x34/255.0 alpha:1.0];
  144. case GCTypeDark6:
  145. return [UIColor colorWithRed:0x2F/255.0 green:0x32/255.0 blue:0x37/255.0 alpha:1.0];
  146. case GCTypeDark7:
  147. return [UIColor colorWithRed:0x83/255.0 green:0x89/255.0 blue:0x99/255.0 alpha:1.0];
  148. case GCTypeWhite:
  149. return [UIColor colorWithRed:0xFF/255.0 green:0xFF/255.0 blue:0xFF/255.0 alpha:1.0];
  150. case GCTypeBlack:
  151. return [UIColor colorWithRed:0x00/255.0 green:0x00/255.0 blue:0x00/255.0 alpha:1.0];
  152. case GCTypeinpuv:
  153. return [UIColor colorWithRed:0x25/255.0 green:0x2A/255.0 blue:0x4D/255.0 alpha:1.0];
  154. case GCTycellbg:
  155. return [UIColor colorWithRed:0x1A/255.0 green:0x1E/255.0 blue:0x3A/255.0 alpha:1.0];
  156. default:
  157. return [UIColor blackColor]; // 默认颜色或者其他颜色
  158. }
  159. }
  160. /// 屏幕宽度,会根据横竖屏的变化而变化
  161. #define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
  162. /// 屏幕高度,会根据横竖屏的变化而变化
  163. #define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
  164. #define SCREEN_TOP [UIDevice navigationFullHeight] //顶部状态栏加导航栏高度
  165. #define NAVIGATIONBAR_HEIGHT [UIDevice navigationBarHeight]
  166. #define SCREEN_BOTTOM (isIphoneX ? 83 : 49) //底部tabbar高度
  167. #define SCREEN_X_BTM [UIDevice safeDistanceBottom] //刘海屏底部高度
  168. #define STATUS_Height [UIDevice statusBarHeight] //状态栏高度
  169. #define WINDOW [UIApplication sharedApplication].delegate.window
  170. #pragma mark - Image
  171. #define kImageMake(name) [UIImage imageNamed:name]
  172. #pragma mark - Font
  173. #define SYSFONT(size) [UIFont systemFontOfSize:size]
  174. #define SYSMFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightMedium]
  175. #define SYSBFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightBold]
  176. #define SYSHFONT(size) [UIFont systemFontOfSize:size weight:UIFontWeightHeavy]
  177. /* URL*/
  178. #define getURL(x) [NSURL URLWithString:x]
  179. #pragma mark weak
  180. #define weakSelf(var) __weak typeof(var) weak##var = var;
  181. #endif /* config_h */