AntiAddictionService-Swift.h 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675
  1. #if TARGET_OS_SIMULATOR
  2. #if 0
  3. #elif defined(__x86_64__) && __x86_64__
  4. // Generated by Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
  5. #ifndef ANTIADDICTIONSERVICE_SWIFT_H
  6. #define ANTIADDICTIONSERVICE_SWIFT_H
  7. #pragma clang diagnostic push
  8. #pragma clang diagnostic ignored "-Wgcc-compat"
  9. #if !defined(__has_include)
  10. # define __has_include(x) 0
  11. #endif
  12. #if !defined(__has_attribute)
  13. # define __has_attribute(x) 0
  14. #endif
  15. #if !defined(__has_feature)
  16. # define __has_feature(x) 0
  17. #endif
  18. #if !defined(__has_warning)
  19. # define __has_warning(x) 0
  20. #endif
  21. #if __has_include(<swift/objc-prologue.h>)
  22. # include <swift/objc-prologue.h>
  23. #endif
  24. #pragma clang diagnostic ignored "-Wauto-import"
  25. #include <Foundation/Foundation.h>
  26. #include <stdint.h>
  27. #include <stddef.h>
  28. #include <stdbool.h>
  29. #if !defined(SWIFT_TYPEDEFS)
  30. # define SWIFT_TYPEDEFS 1
  31. # if __has_include(<uchar.h>)
  32. # include <uchar.h>
  33. # elif !defined(__cplusplus)
  34. typedef uint_least16_t char16_t;
  35. typedef uint_least32_t char32_t;
  36. # endif
  37. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  38. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  39. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  40. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  41. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  42. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  43. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  44. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  45. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  46. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  47. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  48. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  49. #endif
  50. #if !defined(SWIFT_PASTE)
  51. # define SWIFT_PASTE_HELPER(x, y) x##y
  52. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  53. #endif
  54. #if !defined(SWIFT_METATYPE)
  55. # define SWIFT_METATYPE(X) Class
  56. #endif
  57. #if !defined(SWIFT_CLASS_PROPERTY)
  58. # if __has_feature(objc_class_property)
  59. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  60. # else
  61. # define SWIFT_CLASS_PROPERTY(...)
  62. # endif
  63. #endif
  64. #if __has_attribute(objc_runtime_name)
  65. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  66. #else
  67. # define SWIFT_RUNTIME_NAME(X)
  68. #endif
  69. #if __has_attribute(swift_name)
  70. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  71. #else
  72. # define SWIFT_COMPILE_NAME(X)
  73. #endif
  74. #if __has_attribute(objc_method_family)
  75. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  76. #else
  77. # define SWIFT_METHOD_FAMILY(X)
  78. #endif
  79. #if __has_attribute(noescape)
  80. # define SWIFT_NOESCAPE __attribute__((noescape))
  81. #else
  82. # define SWIFT_NOESCAPE
  83. #endif
  84. #if __has_attribute(ns_consumed)
  85. # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
  86. #else
  87. # define SWIFT_RELEASES_ARGUMENT
  88. #endif
  89. #if __has_attribute(warn_unused_result)
  90. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  91. #else
  92. # define SWIFT_WARN_UNUSED_RESULT
  93. #endif
  94. #if __has_attribute(noreturn)
  95. # define SWIFT_NORETURN __attribute__((noreturn))
  96. #else
  97. # define SWIFT_NORETURN
  98. #endif
  99. #if !defined(SWIFT_CLASS_EXTRA)
  100. # define SWIFT_CLASS_EXTRA
  101. #endif
  102. #if !defined(SWIFT_PROTOCOL_EXTRA)
  103. # define SWIFT_PROTOCOL_EXTRA
  104. #endif
  105. #if !defined(SWIFT_ENUM_EXTRA)
  106. # define SWIFT_ENUM_EXTRA
  107. #endif
  108. #if !defined(SWIFT_CLASS)
  109. # if __has_attribute(objc_subclassing_restricted)
  110. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  111. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  112. # else
  113. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  114. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  115. # endif
  116. #endif
  117. #if !defined(SWIFT_RESILIENT_CLASS)
  118. # if __has_attribute(objc_class_stub)
  119. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
  120. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
  121. # else
  122. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
  123. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
  124. # endif
  125. #endif
  126. #if !defined(SWIFT_PROTOCOL)
  127. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  128. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  129. #endif
  130. #if !defined(SWIFT_EXTENSION)
  131. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  132. #endif
  133. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  134. # if __has_attribute(objc_designated_initializer)
  135. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  136. # else
  137. # define OBJC_DESIGNATED_INITIALIZER
  138. # endif
  139. #endif
  140. #if !defined(SWIFT_ENUM_ATTR)
  141. # if defined(__has_attribute) && __has_attribute(enum_extensibility)
  142. # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  143. # else
  144. # define SWIFT_ENUM_ATTR(_extensibility)
  145. # endif
  146. #endif
  147. #if !defined(SWIFT_ENUM)
  148. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  149. # if __has_feature(generalized_swift_name)
  150. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  151. # else
  152. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  153. # endif
  154. #endif
  155. #if !defined(SWIFT_UNAVAILABLE)
  156. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  157. #endif
  158. #if !defined(SWIFT_UNAVAILABLE_MSG)
  159. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  160. #endif
  161. #if !defined(SWIFT_AVAILABILITY)
  162. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  163. #endif
  164. #if !defined(SWIFT_WEAK_IMPORT)
  165. # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
  166. #endif
  167. #if !defined(SWIFT_DEPRECATED)
  168. # define SWIFT_DEPRECATED __attribute__((deprecated))
  169. #endif
  170. #if !defined(SWIFT_DEPRECATED_MSG)
  171. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  172. #endif
  173. #if __has_feature(attribute_diagnose_if_objc)
  174. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  175. #else
  176. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  177. #endif
  178. #if !defined(IBSegueAction)
  179. # define IBSegueAction
  180. #endif
  181. #if __has_feature(modules)
  182. #if __has_warning("-Watimport-in-framework-header")
  183. #pragma clang diagnostic ignored "-Watimport-in-framework-header"
  184. #endif
  185. @import Foundation;
  186. @import ObjectiveC;
  187. #endif
  188. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  189. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  190. #if __has_warning("-Wpragma-clang-attribute")
  191. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  192. #endif
  193. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  194. #pragma clang diagnostic ignored "-Wnullability"
  195. #if __has_attribute(external_source_symbol)
  196. # pragma push_macro("any")
  197. # undef any
  198. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AntiAddictionService",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  199. # pragma pop_macro("any")
  200. #endif
  201. @class NSNumber;
  202. @class NSString;
  203. SWIFT_CLASS("_TtC20AntiAddictionService26AntiAddictionConfiguration")
  204. @interface AntiAddictionConfiguration : NSObject
  205. @property (nonatomic) BOOL enableLog;
  206. @property (nonatomic) BOOL needUploadUserAction;
  207. @property (nonatomic) BOOL isServerError;
  208. - (BOOL)getShouldStandAloneWithResultBlock:(void (^ _Nullable)(BOOL))resultBlock;
  209. /// 游戏标识,多端统一用
  210. @property (nonatomic, copy) NSString * _Nullable gameIdentifier;
  211. ///
  212. @property (nonatomic, readonly, copy) NSString * _Nonnull bundleId;
  213. /// AAKit 在线时长限制开关,默认值为 true
  214. @property (nonatomic) BOOL useSdkOnlineTimeLimit;
  215. /// AAKit 支付限制开关,默认值为 true
  216. @property (nonatomic) BOOL useSdkPaymentLimit;
  217. /// AAKit 是否显示切换账号,默认值为true
  218. @property (nonatomic) BOOL showSwitchAccount;
  219. /// 未成年人非节假日每日总时长 单位秒
  220. @property (nonatomic) NSInteger minorCommonDayTotalTime;
  221. /// 未成年人节假日每日总时长 单位秒
  222. @property (nonatomic) NSInteger minorHolidayTotalTime;
  223. /// 游客每日总时长(无节假日区分)单位秒
  224. @property (nonatomic) NSInteger guestTotalTime;
  225. /// 第一次提醒剩余游戏时间时的剩余时长 单位秒
  226. @property (nonatomic) NSInteger firstAlertTipRemainTime;
  227. /// 展示倒计时浮窗时的剩余时长 单位秒
  228. @property (nonatomic) NSInteger countdownAlertTipRemainTime;
  229. /// 宵禁开始时间(整数,小时,24小时进制,默认22)
  230. @property (nonatomic) NSInteger curfewHourStart;
  231. /// 宵禁结束时间(整数,小时,24小时进制,默认8)
  232. @property (nonatomic) NSInteger curfewHourEnd;
  233. /// 宵禁开始时间(字符串,格式为<code>小时:分钟</code>,24小时进制,默认<code>22:00</code>)方便配置具体到分钟
  234. @property (nonatomic, copy) NSString * _Nonnull nightStrictStart;
  235. /// 宵禁结束时间(整数,格式为<code>小时:分钟</code>,24小时进制,默认8)方便配置具体到分钟
  236. @property (nonatomic, copy) NSString * _Nonnull nightStrictEnd;
  237. /// 8-15岁单笔付费额度限制,单位分(默认5000分)
  238. @property (nonatomic) NSInteger singlePaymentAmountLimitJunior;
  239. /// 8-15岁每月总付费额度限制,单位分(默认20000分)
  240. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitJunior;
  241. /// 16-17岁单笔付费额度限制,单位分(默认10000分)
  242. @property (nonatomic) NSInteger singlePaymentAmountLimitSenior;
  243. /// 16-17岁每月总付费额度限制,单位分(默认40000分)
  244. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitSenior;
  245. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull holiday;
  246. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  247. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  248. @end
  249. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAgeLimit, open) {
  250. AntiAddictionRealNameAgeLimitUnrealname = -1,
  251. AntiAddictionRealNameAgeLimitChild = 0,
  252. AntiAddictionRealNameAgeLimitTeen = 8,
  253. AntiAddictionRealNameAgeLimitYoung = 16,
  254. AntiAddictionRealNameAgeLimitAdult = 18,
  255. };
  256. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAuthState, open) {
  257. AntiAddictionRealNameAuthStateSuccess = 0,
  258. AntiAddictionRealNameAuthStateVerifying = 1,
  259. AntiAddictionRealNameAuthStateFail = 2,
  260. };
  261. @protocol AntiAddictionServiceCallback;
  262. SWIFT_CLASS_NAMED("AntiAddictionService")
  263. @interface AntiAddictionService : NSObject
  264. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull LocalTokenString;)
  265. + (NSString * _Nonnull)LocalTokenString SWIFT_WARN_UNUSED_RESULT;
  266. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) AntiAddictionConfiguration * _Nonnull configuration;)
  267. + (AntiAddictionConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
  268. + (void)setConfiguration:(AntiAddictionConfiguration * _Nonnull)value;
  269. + (NSString * _Nonnull)getSDKVersion SWIFT_WARN_UNUSED_RESULT;
  270. + (void)enableLogWithEnable:(BOOL)enable;
  271. /// AAKit 配置方法
  272. /// \param useSdkRealName 实名登记开关,默认值为 true
  273. ///
  274. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  275. ///
  276. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  277. ///
  278. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit;
  279. /// AAKit 配置方法
  280. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  281. ///
  282. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  283. ///
  284. /// \param showSwitchAccount 是否显示切换账号按钮,
  285. ///
  286. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit :(BOOL)showSwitchAccount;
  287. + (void)getConfig:(NSString * _Nonnull)clinentId completionHandler:(void (^ _Nullable)(BOOL))completionHandler;
  288. /// 初始化 SDK
  289. /// \param delegate 接收回调代理
  290. ///
  291. /// \param gameIdentifier 游戏唯一标识符
  292. ///
  293. + (void)init:(id <AntiAddictionServiceCallback> _Nonnull)delegate gameIdentifier:(NSString * _Nullable)gameIdentifier SWIFT_METHOD_FAMILY(none);
  294. + (void)tapTokenLoginWithKid:(NSString * _Nonnull)kid mackey:(NSString * _Nonnull)mackey clientID:(NSString * _Nonnull)clientID successHandler:(void (^ _Nullable)(NSString * _Nonnull))successHandler failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  295. /// 登录用户
  296. /// \param userToken 用户唯一标识符,
  297. ///
  298. /// \param accessToken 实名服务签算JwtToken
  299. ///
  300. /// \param ageLimit 年龄限制
  301. ///
  302. + (void)loginWithUserToken:(NSString * _Nonnull)userToken accessToken:(NSString * _Nonnull)accessToken ageLimit:(enum AntiAddictionRealNameAgeLimit)ageLimit;
  303. /// 进入游戏
  304. + (void)enterGame;
  305. /// 离开游戏
  306. + (void)leaveGame;
  307. /// 退出用户登录
  308. + (void)logout;
  309. /// 用户切换账号
  310. + (void)switchAccount;
  311. /// 获取用户类型
  312. /// \param userId 用户 id
  313. ///
  314. + (NSInteger)getCurrentUserAgeLimite SWIFT_WARN_UNUSED_RESULT;
  315. /// 获取当前防沉迷Token
  316. /// \param userId 用户 id
  317. ///
  318. + (NSString * _Nonnull)currentToken SWIFT_WARN_UNUSED_RESULT;
  319. /// 获取用户剩余时长
  320. + (NSInteger)currentUserRemainingTime SWIFT_WARN_UNUSED_RESULT;
  321. /// 是否是单机模式
  322. + (BOOL)isStandAlone SWIFT_WARN_UNUSED_RESULT;
  323. + (NSString * _Nonnull)getchildNightStrictRemainDesc SWIFT_WARN_UNUSED_RESULT;
  324. /// 查询能否支付,直接返回支付限制相关回调类型 raw value,特殊情况使用
  325. /// \param amount 支付金额,单位分
  326. ///
  327. + (NSInteger)checkCurrentPayLimit:(NSInteger)amount SWIFT_WARN_UNUSED_RESULT;
  328. /// 查询能否支付
  329. /// \param amount 支付金额,单位分
  330. ///
  331. /// \param status true:可以付费 false:限制消费
  332. ///
  333. /// \param title 限制消费时提示标题
  334. ///
  335. /// \param description 限制消费提示国家法规内容
  336. ///
  337. + (void)checkPayLimit:(NSInteger)amount callBack:(void (^ _Nullable)(BOOL, NSString * _Nonnull, NSString * _Nonnull))callBack failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  338. /// 上报消费结果
  339. /// \param amount 支付金额,单位分
  340. ///
  341. + (void)submitPayResult:(NSInteger)amount :(void (^ _Nullable)(BOOL))callBack :(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  342. + (BOOL)isHoliday SWIFT_WARN_UNUSED_RESULT;
  343. /// 生成身份证兑换码(有效期从生成起6个小时整以内)
  344. + (NSString * _Nonnull)generateIDCode SWIFT_WARN_UNUSED_RESULT;
  345. + (void)startTimeStaticWithIsLogin:(BOOL)isLogin;
  346. + (void)stopTimeStatic;
  347. /// 实名认证
  348. /// \param userToken 用户唯一标识,如用户 ID
  349. ///
  350. /// \param name 姓名
  351. ///
  352. /// \param idCard 身份证
  353. ///
  354. /// \param completion 结果回调
  355. ///
  356. + (void)realNameAuthWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code name:(NSString * _Nonnull)name idCard:(NSString * _Nonnull)idCard completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  357. /// 检查实名状态
  358. /// \param userToken 用户唯一标识,如用户 ID
  359. ///
  360. /// \param completion 结果回调
  361. ///
  362. + (void)checkRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  363. /// 检查TapTap实名状态
  364. /// \param userToken 用户唯一标识,如用户 ID
  365. ///
  366. /// \param completion 结果回调
  367. ///
  368. + (void)checkTapTapRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  369. + (NSString * _Nullable)checkPlayTimeResultWithHandler:(void (^ _Nonnull)(NSString * _Nullable))handler SWIFT_WARN_UNUSED_RESULT;
  370. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  371. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  372. @end
  373. SWIFT_PROTOCOL("_TtP20AntiAddictionService28AntiAddictionServiceCallback_")
  374. @protocol AntiAddictionServiceCallback <NSObject>
  375. /// 回调
  376. /// \param code 回调code
  377. ///
  378. /// \param extra 回调信息
  379. ///
  380. - (void)onCallbackWithCode:(NSInteger)code extra:(NSString * _Nullable)extra;
  381. @end
  382. typedef SWIFT_ENUM(NSInteger, AntiAddictionServiceResult, open) {
  383. AntiAddictionServiceResultLoginSuccess = 500,
  384. AntiAddictionServiceResultLogout = 1000,
  385. AntiAddictionServiceResultSwitchAccount = 1001,
  386. AntiAddictionServiceResultPeriodRestrict = 1030,
  387. AntiAddictionServiceResultDurationLimit = 1050,
  388. AntiAddictionServiceResultOpenAlertTip = 1095,
  389. AntiAddictionServiceResultPayLimitNone = 1020,
  390. AntiAddictionServiceResultPayLimitReachLimit = 1025,
  391. };
  392. #if __has_attribute(external_source_symbol)
  393. # pragma clang attribute pop
  394. #endif
  395. #pragma clang diagnostic pop
  396. #endif
  397. #elif defined(__i386__) && __i386__
  398. // Generated by Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
  399. #ifndef ANTIADDICTIONSERVICE_SWIFT_H
  400. #define ANTIADDICTIONSERVICE_SWIFT_H
  401. #pragma clang diagnostic push
  402. #pragma clang diagnostic ignored "-Wgcc-compat"
  403. #if !defined(__has_include)
  404. # define __has_include(x) 0
  405. #endif
  406. #if !defined(__has_attribute)
  407. # define __has_attribute(x) 0
  408. #endif
  409. #if !defined(__has_feature)
  410. # define __has_feature(x) 0
  411. #endif
  412. #if !defined(__has_warning)
  413. # define __has_warning(x) 0
  414. #endif
  415. #if __has_include(<swift/objc-prologue.h>)
  416. # include <swift/objc-prologue.h>
  417. #endif
  418. #pragma clang diagnostic ignored "-Wauto-import"
  419. #include <Foundation/Foundation.h>
  420. #include <stdint.h>
  421. #include <stddef.h>
  422. #include <stdbool.h>
  423. #if !defined(SWIFT_TYPEDEFS)
  424. # define SWIFT_TYPEDEFS 1
  425. # if __has_include(<uchar.h>)
  426. # include <uchar.h>
  427. # elif !defined(__cplusplus)
  428. typedef uint_least16_t char16_t;
  429. typedef uint_least32_t char32_t;
  430. # endif
  431. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  432. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  433. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  434. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  435. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  436. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  437. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  438. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  439. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  440. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  441. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  442. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  443. #endif
  444. #if !defined(SWIFT_PASTE)
  445. # define SWIFT_PASTE_HELPER(x, y) x##y
  446. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  447. #endif
  448. #if !defined(SWIFT_METATYPE)
  449. # define SWIFT_METATYPE(X) Class
  450. #endif
  451. #if !defined(SWIFT_CLASS_PROPERTY)
  452. # if __has_feature(objc_class_property)
  453. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  454. # else
  455. # define SWIFT_CLASS_PROPERTY(...)
  456. # endif
  457. #endif
  458. #if __has_attribute(objc_runtime_name)
  459. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  460. #else
  461. # define SWIFT_RUNTIME_NAME(X)
  462. #endif
  463. #if __has_attribute(swift_name)
  464. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  465. #else
  466. # define SWIFT_COMPILE_NAME(X)
  467. #endif
  468. #if __has_attribute(objc_method_family)
  469. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  470. #else
  471. # define SWIFT_METHOD_FAMILY(X)
  472. #endif
  473. #if __has_attribute(noescape)
  474. # define SWIFT_NOESCAPE __attribute__((noescape))
  475. #else
  476. # define SWIFT_NOESCAPE
  477. #endif
  478. #if __has_attribute(ns_consumed)
  479. # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
  480. #else
  481. # define SWIFT_RELEASES_ARGUMENT
  482. #endif
  483. #if __has_attribute(warn_unused_result)
  484. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  485. #else
  486. # define SWIFT_WARN_UNUSED_RESULT
  487. #endif
  488. #if __has_attribute(noreturn)
  489. # define SWIFT_NORETURN __attribute__((noreturn))
  490. #else
  491. # define SWIFT_NORETURN
  492. #endif
  493. #if !defined(SWIFT_CLASS_EXTRA)
  494. # define SWIFT_CLASS_EXTRA
  495. #endif
  496. #if !defined(SWIFT_PROTOCOL_EXTRA)
  497. # define SWIFT_PROTOCOL_EXTRA
  498. #endif
  499. #if !defined(SWIFT_ENUM_EXTRA)
  500. # define SWIFT_ENUM_EXTRA
  501. #endif
  502. #if !defined(SWIFT_CLASS)
  503. # if __has_attribute(objc_subclassing_restricted)
  504. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  505. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  506. # else
  507. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  508. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  509. # endif
  510. #endif
  511. #if !defined(SWIFT_RESILIENT_CLASS)
  512. # if __has_attribute(objc_class_stub)
  513. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
  514. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
  515. # else
  516. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
  517. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
  518. # endif
  519. #endif
  520. #if !defined(SWIFT_PROTOCOL)
  521. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  522. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  523. #endif
  524. #if !defined(SWIFT_EXTENSION)
  525. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  526. #endif
  527. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  528. # if __has_attribute(objc_designated_initializer)
  529. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  530. # else
  531. # define OBJC_DESIGNATED_INITIALIZER
  532. # endif
  533. #endif
  534. #if !defined(SWIFT_ENUM_ATTR)
  535. # if defined(__has_attribute) && __has_attribute(enum_extensibility)
  536. # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  537. # else
  538. # define SWIFT_ENUM_ATTR(_extensibility)
  539. # endif
  540. #endif
  541. #if !defined(SWIFT_ENUM)
  542. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  543. # if __has_feature(generalized_swift_name)
  544. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  545. # else
  546. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  547. # endif
  548. #endif
  549. #if !defined(SWIFT_UNAVAILABLE)
  550. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  551. #endif
  552. #if !defined(SWIFT_UNAVAILABLE_MSG)
  553. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  554. #endif
  555. #if !defined(SWIFT_AVAILABILITY)
  556. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  557. #endif
  558. #if !defined(SWIFT_WEAK_IMPORT)
  559. # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
  560. #endif
  561. #if !defined(SWIFT_DEPRECATED)
  562. # define SWIFT_DEPRECATED __attribute__((deprecated))
  563. #endif
  564. #if !defined(SWIFT_DEPRECATED_MSG)
  565. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  566. #endif
  567. #if __has_feature(attribute_diagnose_if_objc)
  568. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  569. #else
  570. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  571. #endif
  572. #if !defined(IBSegueAction)
  573. # define IBSegueAction
  574. #endif
  575. #if __has_feature(modules)
  576. #if __has_warning("-Watimport-in-framework-header")
  577. #pragma clang diagnostic ignored "-Watimport-in-framework-header"
  578. #endif
  579. @import Foundation;
  580. @import ObjectiveC;
  581. #endif
  582. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  583. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  584. #if __has_warning("-Wpragma-clang-attribute")
  585. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  586. #endif
  587. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  588. #pragma clang diagnostic ignored "-Wnullability"
  589. #if __has_attribute(external_source_symbol)
  590. # pragma push_macro("any")
  591. # undef any
  592. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AntiAddictionService",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  593. # pragma pop_macro("any")
  594. #endif
  595. @class NSNumber;
  596. @class NSString;
  597. SWIFT_CLASS("_TtC20AntiAddictionService26AntiAddictionConfiguration")
  598. @interface AntiAddictionConfiguration : NSObject
  599. @property (nonatomic) BOOL enableLog;
  600. @property (nonatomic) BOOL needUploadUserAction;
  601. @property (nonatomic) BOOL isServerError;
  602. - (BOOL)getShouldStandAloneWithResultBlock:(void (^ _Nullable)(BOOL))resultBlock;
  603. /// 游戏标识,多端统一用
  604. @property (nonatomic, copy) NSString * _Nullable gameIdentifier;
  605. ///
  606. @property (nonatomic, readonly, copy) NSString * _Nonnull bundleId;
  607. /// AAKit 在线时长限制开关,默认值为 true
  608. @property (nonatomic) BOOL useSdkOnlineTimeLimit;
  609. /// AAKit 支付限制开关,默认值为 true
  610. @property (nonatomic) BOOL useSdkPaymentLimit;
  611. /// AAKit 是否显示切换账号,默认值为true
  612. @property (nonatomic) BOOL showSwitchAccount;
  613. /// 未成年人非节假日每日总时长 单位秒
  614. @property (nonatomic) NSInteger minorCommonDayTotalTime;
  615. /// 未成年人节假日每日总时长 单位秒
  616. @property (nonatomic) NSInteger minorHolidayTotalTime;
  617. /// 游客每日总时长(无节假日区分)单位秒
  618. @property (nonatomic) NSInteger guestTotalTime;
  619. /// 第一次提醒剩余游戏时间时的剩余时长 单位秒
  620. @property (nonatomic) NSInteger firstAlertTipRemainTime;
  621. /// 展示倒计时浮窗时的剩余时长 单位秒
  622. @property (nonatomic) NSInteger countdownAlertTipRemainTime;
  623. /// 宵禁开始时间(整数,小时,24小时进制,默认22)
  624. @property (nonatomic) NSInteger curfewHourStart;
  625. /// 宵禁结束时间(整数,小时,24小时进制,默认8)
  626. @property (nonatomic) NSInteger curfewHourEnd;
  627. /// 宵禁开始时间(字符串,格式为<code>小时:分钟</code>,24小时进制,默认<code>22:00</code>)方便配置具体到分钟
  628. @property (nonatomic, copy) NSString * _Nonnull nightStrictStart;
  629. /// 宵禁结束时间(整数,格式为<code>小时:分钟</code>,24小时进制,默认8)方便配置具体到分钟
  630. @property (nonatomic, copy) NSString * _Nonnull nightStrictEnd;
  631. /// 8-15岁单笔付费额度限制,单位分(默认5000分)
  632. @property (nonatomic) NSInteger singlePaymentAmountLimitJunior;
  633. /// 8-15岁每月总付费额度限制,单位分(默认20000分)
  634. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitJunior;
  635. /// 16-17岁单笔付费额度限制,单位分(默认10000分)
  636. @property (nonatomic) NSInteger singlePaymentAmountLimitSenior;
  637. /// 16-17岁每月总付费额度限制,单位分(默认40000分)
  638. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitSenior;
  639. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull holiday;
  640. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  641. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  642. @end
  643. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAgeLimit, open) {
  644. AntiAddictionRealNameAgeLimitUnrealname = -1,
  645. AntiAddictionRealNameAgeLimitChild = 0,
  646. AntiAddictionRealNameAgeLimitTeen = 8,
  647. AntiAddictionRealNameAgeLimitYoung = 16,
  648. AntiAddictionRealNameAgeLimitAdult = 18,
  649. };
  650. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAuthState, open) {
  651. AntiAddictionRealNameAuthStateSuccess = 0,
  652. AntiAddictionRealNameAuthStateVerifying = 1,
  653. AntiAddictionRealNameAuthStateFail = 2,
  654. };
  655. @protocol AntiAddictionServiceCallback;
  656. SWIFT_CLASS_NAMED("AntiAddictionService")
  657. @interface AntiAddictionService : NSObject
  658. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull LocalTokenString;)
  659. + (NSString * _Nonnull)LocalTokenString SWIFT_WARN_UNUSED_RESULT;
  660. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) AntiAddictionConfiguration * _Nonnull configuration;)
  661. + (AntiAddictionConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
  662. + (void)setConfiguration:(AntiAddictionConfiguration * _Nonnull)value;
  663. + (NSString * _Nonnull)getSDKVersion SWIFT_WARN_UNUSED_RESULT;
  664. + (void)enableLogWithEnable:(BOOL)enable;
  665. /// AAKit 配置方法
  666. /// \param useSdkRealName 实名登记开关,默认值为 true
  667. ///
  668. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  669. ///
  670. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  671. ///
  672. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit;
  673. /// AAKit 配置方法
  674. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  675. ///
  676. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  677. ///
  678. /// \param showSwitchAccount 是否显示切换账号按钮,
  679. ///
  680. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit :(BOOL)showSwitchAccount;
  681. + (void)getConfig:(NSString * _Nonnull)clinentId completionHandler:(void (^ _Nullable)(BOOL))completionHandler;
  682. /// 初始化 SDK
  683. /// \param delegate 接收回调代理
  684. ///
  685. /// \param gameIdentifier 游戏唯一标识符
  686. ///
  687. + (void)init:(id <AntiAddictionServiceCallback> _Nonnull)delegate gameIdentifier:(NSString * _Nullable)gameIdentifier SWIFT_METHOD_FAMILY(none);
  688. + (void)tapTokenLoginWithKid:(NSString * _Nonnull)kid mackey:(NSString * _Nonnull)mackey clientID:(NSString * _Nonnull)clientID successHandler:(void (^ _Nullable)(NSString * _Nonnull))successHandler failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  689. /// 登录用户
  690. /// \param userToken 用户唯一标识符,
  691. ///
  692. /// \param accessToken 实名服务签算JwtToken
  693. ///
  694. /// \param ageLimit 年龄限制
  695. ///
  696. + (void)loginWithUserToken:(NSString * _Nonnull)userToken accessToken:(NSString * _Nonnull)accessToken ageLimit:(enum AntiAddictionRealNameAgeLimit)ageLimit;
  697. /// 进入游戏
  698. + (void)enterGame;
  699. /// 离开游戏
  700. + (void)leaveGame;
  701. /// 退出用户登录
  702. + (void)logout;
  703. /// 用户切换账号
  704. + (void)switchAccount;
  705. /// 获取用户类型
  706. /// \param userId 用户 id
  707. ///
  708. + (NSInteger)getCurrentUserAgeLimite SWIFT_WARN_UNUSED_RESULT;
  709. /// 获取当前防沉迷Token
  710. /// \param userId 用户 id
  711. ///
  712. + (NSString * _Nonnull)currentToken SWIFT_WARN_UNUSED_RESULT;
  713. /// 获取用户剩余时长
  714. + (NSInteger)currentUserRemainingTime SWIFT_WARN_UNUSED_RESULT;
  715. /// 是否是单机模式
  716. + (BOOL)isStandAlone SWIFT_WARN_UNUSED_RESULT;
  717. + (NSString * _Nonnull)getchildNightStrictRemainDesc SWIFT_WARN_UNUSED_RESULT;
  718. /// 查询能否支付,直接返回支付限制相关回调类型 raw value,特殊情况使用
  719. /// \param amount 支付金额,单位分
  720. ///
  721. + (NSInteger)checkCurrentPayLimit:(NSInteger)amount SWIFT_WARN_UNUSED_RESULT;
  722. /// 查询能否支付
  723. /// \param amount 支付金额,单位分
  724. ///
  725. /// \param status true:可以付费 false:限制消费
  726. ///
  727. /// \param title 限制消费时提示标题
  728. ///
  729. /// \param description 限制消费提示国家法规内容
  730. ///
  731. + (void)checkPayLimit:(NSInteger)amount callBack:(void (^ _Nullable)(BOOL, NSString * _Nonnull, NSString * _Nonnull))callBack failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  732. /// 上报消费结果
  733. /// \param amount 支付金额,单位分
  734. ///
  735. + (void)submitPayResult:(NSInteger)amount :(void (^ _Nullable)(BOOL))callBack :(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  736. + (BOOL)isHoliday SWIFT_WARN_UNUSED_RESULT;
  737. /// 生成身份证兑换码(有效期从生成起6个小时整以内)
  738. + (NSString * _Nonnull)generateIDCode SWIFT_WARN_UNUSED_RESULT;
  739. + (void)startTimeStaticWithIsLogin:(BOOL)isLogin;
  740. + (void)stopTimeStatic;
  741. /// 实名认证
  742. /// \param userToken 用户唯一标识,如用户 ID
  743. ///
  744. /// \param name 姓名
  745. ///
  746. /// \param idCard 身份证
  747. ///
  748. /// \param completion 结果回调
  749. ///
  750. + (void)realNameAuthWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code name:(NSString * _Nonnull)name idCard:(NSString * _Nonnull)idCard completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  751. /// 检查实名状态
  752. /// \param userToken 用户唯一标识,如用户 ID
  753. ///
  754. /// \param completion 结果回调
  755. ///
  756. + (void)checkRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  757. /// 检查TapTap实名状态
  758. /// \param userToken 用户唯一标识,如用户 ID
  759. ///
  760. /// \param completion 结果回调
  761. ///
  762. + (void)checkTapTapRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  763. + (NSString * _Nullable)checkPlayTimeResultWithHandler:(void (^ _Nonnull)(NSString * _Nullable))handler SWIFT_WARN_UNUSED_RESULT;
  764. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  765. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  766. @end
  767. SWIFT_PROTOCOL("_TtP20AntiAddictionService28AntiAddictionServiceCallback_")
  768. @protocol AntiAddictionServiceCallback <NSObject>
  769. /// 回调
  770. /// \param code 回调code
  771. ///
  772. /// \param extra 回调信息
  773. ///
  774. - (void)onCallbackWithCode:(NSInteger)code extra:(NSString * _Nullable)extra;
  775. @end
  776. typedef SWIFT_ENUM(NSInteger, AntiAddictionServiceResult, open) {
  777. AntiAddictionServiceResultLoginSuccess = 500,
  778. AntiAddictionServiceResultLogout = 1000,
  779. AntiAddictionServiceResultSwitchAccount = 1001,
  780. AntiAddictionServiceResultPeriodRestrict = 1030,
  781. AntiAddictionServiceResultDurationLimit = 1050,
  782. AntiAddictionServiceResultOpenAlertTip = 1095,
  783. AntiAddictionServiceResultPayLimitNone = 1020,
  784. AntiAddictionServiceResultPayLimitReachLimit = 1025,
  785. };
  786. #if __has_attribute(external_source_symbol)
  787. # pragma clang attribute pop
  788. #endif
  789. #pragma clang diagnostic pop
  790. #endif
  791. #endif
  792. #else
  793. #if 0
  794. #elif defined(__arm64__) && __arm64__
  795. // Generated by Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
  796. #ifndef ANTIADDICTIONSERVICE_SWIFT_H
  797. #define ANTIADDICTIONSERVICE_SWIFT_H
  798. #pragma clang diagnostic push
  799. #pragma clang diagnostic ignored "-Wgcc-compat"
  800. #if !defined(__has_include)
  801. # define __has_include(x) 0
  802. #endif
  803. #if !defined(__has_attribute)
  804. # define __has_attribute(x) 0
  805. #endif
  806. #if !defined(__has_feature)
  807. # define __has_feature(x) 0
  808. #endif
  809. #if !defined(__has_warning)
  810. # define __has_warning(x) 0
  811. #endif
  812. #if __has_include(<swift/objc-prologue.h>)
  813. # include <swift/objc-prologue.h>
  814. #endif
  815. #pragma clang diagnostic ignored "-Wauto-import"
  816. #include <Foundation/Foundation.h>
  817. #include <stdint.h>
  818. #include <stddef.h>
  819. #include <stdbool.h>
  820. #if !defined(SWIFT_TYPEDEFS)
  821. # define SWIFT_TYPEDEFS 1
  822. # if __has_include(<uchar.h>)
  823. # include <uchar.h>
  824. # elif !defined(__cplusplus)
  825. typedef uint_least16_t char16_t;
  826. typedef uint_least32_t char32_t;
  827. # endif
  828. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  829. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  830. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  831. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  832. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  833. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  834. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  835. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  836. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  837. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  838. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  839. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  840. #endif
  841. #if !defined(SWIFT_PASTE)
  842. # define SWIFT_PASTE_HELPER(x, y) x##y
  843. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  844. #endif
  845. #if !defined(SWIFT_METATYPE)
  846. # define SWIFT_METATYPE(X) Class
  847. #endif
  848. #if !defined(SWIFT_CLASS_PROPERTY)
  849. # if __has_feature(objc_class_property)
  850. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  851. # else
  852. # define SWIFT_CLASS_PROPERTY(...)
  853. # endif
  854. #endif
  855. #if __has_attribute(objc_runtime_name)
  856. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  857. #else
  858. # define SWIFT_RUNTIME_NAME(X)
  859. #endif
  860. #if __has_attribute(swift_name)
  861. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  862. #else
  863. # define SWIFT_COMPILE_NAME(X)
  864. #endif
  865. #if __has_attribute(objc_method_family)
  866. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  867. #else
  868. # define SWIFT_METHOD_FAMILY(X)
  869. #endif
  870. #if __has_attribute(noescape)
  871. # define SWIFT_NOESCAPE __attribute__((noescape))
  872. #else
  873. # define SWIFT_NOESCAPE
  874. #endif
  875. #if __has_attribute(ns_consumed)
  876. # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
  877. #else
  878. # define SWIFT_RELEASES_ARGUMENT
  879. #endif
  880. #if __has_attribute(warn_unused_result)
  881. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  882. #else
  883. # define SWIFT_WARN_UNUSED_RESULT
  884. #endif
  885. #if __has_attribute(noreturn)
  886. # define SWIFT_NORETURN __attribute__((noreturn))
  887. #else
  888. # define SWIFT_NORETURN
  889. #endif
  890. #if !defined(SWIFT_CLASS_EXTRA)
  891. # define SWIFT_CLASS_EXTRA
  892. #endif
  893. #if !defined(SWIFT_PROTOCOL_EXTRA)
  894. # define SWIFT_PROTOCOL_EXTRA
  895. #endif
  896. #if !defined(SWIFT_ENUM_EXTRA)
  897. # define SWIFT_ENUM_EXTRA
  898. #endif
  899. #if !defined(SWIFT_CLASS)
  900. # if __has_attribute(objc_subclassing_restricted)
  901. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  902. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  903. # else
  904. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  905. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  906. # endif
  907. #endif
  908. #if !defined(SWIFT_RESILIENT_CLASS)
  909. # if __has_attribute(objc_class_stub)
  910. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
  911. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
  912. # else
  913. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
  914. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
  915. # endif
  916. #endif
  917. #if !defined(SWIFT_PROTOCOL)
  918. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  919. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  920. #endif
  921. #if !defined(SWIFT_EXTENSION)
  922. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  923. #endif
  924. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  925. # if __has_attribute(objc_designated_initializer)
  926. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  927. # else
  928. # define OBJC_DESIGNATED_INITIALIZER
  929. # endif
  930. #endif
  931. #if !defined(SWIFT_ENUM_ATTR)
  932. # if defined(__has_attribute) && __has_attribute(enum_extensibility)
  933. # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  934. # else
  935. # define SWIFT_ENUM_ATTR(_extensibility)
  936. # endif
  937. #endif
  938. #if !defined(SWIFT_ENUM)
  939. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  940. # if __has_feature(generalized_swift_name)
  941. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  942. # else
  943. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  944. # endif
  945. #endif
  946. #if !defined(SWIFT_UNAVAILABLE)
  947. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  948. #endif
  949. #if !defined(SWIFT_UNAVAILABLE_MSG)
  950. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  951. #endif
  952. #if !defined(SWIFT_AVAILABILITY)
  953. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  954. #endif
  955. #if !defined(SWIFT_WEAK_IMPORT)
  956. # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
  957. #endif
  958. #if !defined(SWIFT_DEPRECATED)
  959. # define SWIFT_DEPRECATED __attribute__((deprecated))
  960. #endif
  961. #if !defined(SWIFT_DEPRECATED_MSG)
  962. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  963. #endif
  964. #if __has_feature(attribute_diagnose_if_objc)
  965. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  966. #else
  967. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  968. #endif
  969. #if !defined(IBSegueAction)
  970. # define IBSegueAction
  971. #endif
  972. #if __has_feature(modules)
  973. #if __has_warning("-Watimport-in-framework-header")
  974. #pragma clang diagnostic ignored "-Watimport-in-framework-header"
  975. #endif
  976. @import Foundation;
  977. @import ObjectiveC;
  978. #endif
  979. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  980. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  981. #if __has_warning("-Wpragma-clang-attribute")
  982. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  983. #endif
  984. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  985. #pragma clang diagnostic ignored "-Wnullability"
  986. #if __has_attribute(external_source_symbol)
  987. # pragma push_macro("any")
  988. # undef any
  989. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AntiAddictionService",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  990. # pragma pop_macro("any")
  991. #endif
  992. @class NSNumber;
  993. @class NSString;
  994. SWIFT_CLASS("_TtC20AntiAddictionService26AntiAddictionConfiguration")
  995. @interface AntiAddictionConfiguration : NSObject
  996. @property (nonatomic) BOOL enableLog;
  997. @property (nonatomic) BOOL needUploadUserAction;
  998. @property (nonatomic) BOOL isServerError;
  999. - (BOOL)getShouldStandAloneWithResultBlock:(void (^ _Nullable)(BOOL))resultBlock;
  1000. /// 游戏标识,多端统一用
  1001. @property (nonatomic, copy) NSString * _Nullable gameIdentifier;
  1002. ///
  1003. @property (nonatomic, readonly, copy) NSString * _Nonnull bundleId;
  1004. /// AAKit 在线时长限制开关,默认值为 true
  1005. @property (nonatomic) BOOL useSdkOnlineTimeLimit;
  1006. /// AAKit 支付限制开关,默认值为 true
  1007. @property (nonatomic) BOOL useSdkPaymentLimit;
  1008. /// AAKit 是否显示切换账号,默认值为true
  1009. @property (nonatomic) BOOL showSwitchAccount;
  1010. /// 未成年人非节假日每日总时长 单位秒
  1011. @property (nonatomic) NSInteger minorCommonDayTotalTime;
  1012. /// 未成年人节假日每日总时长 单位秒
  1013. @property (nonatomic) NSInteger minorHolidayTotalTime;
  1014. /// 游客每日总时长(无节假日区分)单位秒
  1015. @property (nonatomic) NSInteger guestTotalTime;
  1016. /// 第一次提醒剩余游戏时间时的剩余时长 单位秒
  1017. @property (nonatomic) NSInteger firstAlertTipRemainTime;
  1018. /// 展示倒计时浮窗时的剩余时长 单位秒
  1019. @property (nonatomic) NSInteger countdownAlertTipRemainTime;
  1020. /// 宵禁开始时间(整数,小时,24小时进制,默认22)
  1021. @property (nonatomic) NSInteger curfewHourStart;
  1022. /// 宵禁结束时间(整数,小时,24小时进制,默认8)
  1023. @property (nonatomic) NSInteger curfewHourEnd;
  1024. /// 宵禁开始时间(字符串,格式为<code>小时:分钟</code>,24小时进制,默认<code>22:00</code>)方便配置具体到分钟
  1025. @property (nonatomic, copy) NSString * _Nonnull nightStrictStart;
  1026. /// 宵禁结束时间(整数,格式为<code>小时:分钟</code>,24小时进制,默认8)方便配置具体到分钟
  1027. @property (nonatomic, copy) NSString * _Nonnull nightStrictEnd;
  1028. /// 8-15岁单笔付费额度限制,单位分(默认5000分)
  1029. @property (nonatomic) NSInteger singlePaymentAmountLimitJunior;
  1030. /// 8-15岁每月总付费额度限制,单位分(默认20000分)
  1031. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitJunior;
  1032. /// 16-17岁单笔付费额度限制,单位分(默认10000分)
  1033. @property (nonatomic) NSInteger singlePaymentAmountLimitSenior;
  1034. /// 16-17岁每月总付费额度限制,单位分(默认40000分)
  1035. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitSenior;
  1036. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull holiday;
  1037. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  1038. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  1039. @end
  1040. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAgeLimit, open) {
  1041. AntiAddictionRealNameAgeLimitUnrealname = -1,
  1042. AntiAddictionRealNameAgeLimitChild = 0,
  1043. AntiAddictionRealNameAgeLimitTeen = 8,
  1044. AntiAddictionRealNameAgeLimitYoung = 16,
  1045. AntiAddictionRealNameAgeLimitAdult = 18,
  1046. };
  1047. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAuthState, open) {
  1048. AntiAddictionRealNameAuthStateSuccess = 0,
  1049. AntiAddictionRealNameAuthStateVerifying = 1,
  1050. AntiAddictionRealNameAuthStateFail = 2,
  1051. };
  1052. @protocol AntiAddictionServiceCallback;
  1053. SWIFT_CLASS_NAMED("AntiAddictionService")
  1054. @interface AntiAddictionService : NSObject
  1055. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull LocalTokenString;)
  1056. + (NSString * _Nonnull)LocalTokenString SWIFT_WARN_UNUSED_RESULT;
  1057. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) AntiAddictionConfiguration * _Nonnull configuration;)
  1058. + (AntiAddictionConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
  1059. + (void)setConfiguration:(AntiAddictionConfiguration * _Nonnull)value;
  1060. + (NSString * _Nonnull)getSDKVersion SWIFT_WARN_UNUSED_RESULT;
  1061. + (void)enableLogWithEnable:(BOOL)enable;
  1062. /// AAKit 配置方法
  1063. /// \param useSdkRealName 实名登记开关,默认值为 true
  1064. ///
  1065. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  1066. ///
  1067. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  1068. ///
  1069. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit;
  1070. /// AAKit 配置方法
  1071. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  1072. ///
  1073. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  1074. ///
  1075. /// \param showSwitchAccount 是否显示切换账号按钮,
  1076. ///
  1077. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit :(BOOL)showSwitchAccount;
  1078. + (void)getConfig:(NSString * _Nonnull)clinentId completionHandler:(void (^ _Nullable)(BOOL))completionHandler;
  1079. /// 初始化 SDK
  1080. /// \param delegate 接收回调代理
  1081. ///
  1082. /// \param gameIdentifier 游戏唯一标识符
  1083. ///
  1084. + (void)init:(id <AntiAddictionServiceCallback> _Nonnull)delegate gameIdentifier:(NSString * _Nullable)gameIdentifier SWIFT_METHOD_FAMILY(none);
  1085. + (void)tapTokenLoginWithKid:(NSString * _Nonnull)kid mackey:(NSString * _Nonnull)mackey clientID:(NSString * _Nonnull)clientID successHandler:(void (^ _Nullable)(NSString * _Nonnull))successHandler failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1086. /// 登录用户
  1087. /// \param userToken 用户唯一标识符,
  1088. ///
  1089. /// \param accessToken 实名服务签算JwtToken
  1090. ///
  1091. /// \param ageLimit 年龄限制
  1092. ///
  1093. + (void)loginWithUserToken:(NSString * _Nonnull)userToken accessToken:(NSString * _Nonnull)accessToken ageLimit:(enum AntiAddictionRealNameAgeLimit)ageLimit;
  1094. /// 进入游戏
  1095. + (void)enterGame;
  1096. /// 离开游戏
  1097. + (void)leaveGame;
  1098. /// 退出用户登录
  1099. + (void)logout;
  1100. /// 用户切换账号
  1101. + (void)switchAccount;
  1102. /// 获取用户类型
  1103. /// \param userId 用户 id
  1104. ///
  1105. + (NSInteger)getCurrentUserAgeLimite SWIFT_WARN_UNUSED_RESULT;
  1106. /// 获取当前防沉迷Token
  1107. /// \param userId 用户 id
  1108. ///
  1109. + (NSString * _Nonnull)currentToken SWIFT_WARN_UNUSED_RESULT;
  1110. /// 获取用户剩余时长
  1111. + (NSInteger)currentUserRemainingTime SWIFT_WARN_UNUSED_RESULT;
  1112. /// 是否是单机模式
  1113. + (BOOL)isStandAlone SWIFT_WARN_UNUSED_RESULT;
  1114. + (NSString * _Nonnull)getchildNightStrictRemainDesc SWIFT_WARN_UNUSED_RESULT;
  1115. /// 查询能否支付,直接返回支付限制相关回调类型 raw value,特殊情况使用
  1116. /// \param amount 支付金额,单位分
  1117. ///
  1118. + (NSInteger)checkCurrentPayLimit:(NSInteger)amount SWIFT_WARN_UNUSED_RESULT;
  1119. /// 查询能否支付
  1120. /// \param amount 支付金额,单位分
  1121. ///
  1122. /// \param status true:可以付费 false:限制消费
  1123. ///
  1124. /// \param title 限制消费时提示标题
  1125. ///
  1126. /// \param description 限制消费提示国家法规内容
  1127. ///
  1128. + (void)checkPayLimit:(NSInteger)amount callBack:(void (^ _Nullable)(BOOL, NSString * _Nonnull, NSString * _Nonnull))callBack failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1129. /// 上报消费结果
  1130. /// \param amount 支付金额,单位分
  1131. ///
  1132. + (void)submitPayResult:(NSInteger)amount :(void (^ _Nullable)(BOOL))callBack :(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1133. + (BOOL)isHoliday SWIFT_WARN_UNUSED_RESULT;
  1134. /// 生成身份证兑换码(有效期从生成起6个小时整以内)
  1135. + (NSString * _Nonnull)generateIDCode SWIFT_WARN_UNUSED_RESULT;
  1136. + (void)startTimeStaticWithIsLogin:(BOOL)isLogin;
  1137. + (void)stopTimeStatic;
  1138. /// 实名认证
  1139. /// \param userToken 用户唯一标识,如用户 ID
  1140. ///
  1141. /// \param name 姓名
  1142. ///
  1143. /// \param idCard 身份证
  1144. ///
  1145. /// \param completion 结果回调
  1146. ///
  1147. + (void)realNameAuthWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code name:(NSString * _Nonnull)name idCard:(NSString * _Nonnull)idCard completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1148. /// 检查实名状态
  1149. /// \param userToken 用户唯一标识,如用户 ID
  1150. ///
  1151. /// \param completion 结果回调
  1152. ///
  1153. + (void)checkRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1154. /// 检查TapTap实名状态
  1155. /// \param userToken 用户唯一标识,如用户 ID
  1156. ///
  1157. /// \param completion 结果回调
  1158. ///
  1159. + (void)checkTapTapRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1160. + (NSString * _Nullable)checkPlayTimeResultWithHandler:(void (^ _Nonnull)(NSString * _Nullable))handler SWIFT_WARN_UNUSED_RESULT;
  1161. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  1162. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  1163. @end
  1164. SWIFT_PROTOCOL("_TtP20AntiAddictionService28AntiAddictionServiceCallback_")
  1165. @protocol AntiAddictionServiceCallback <NSObject>
  1166. /// 回调
  1167. /// \param code 回调code
  1168. ///
  1169. /// \param extra 回调信息
  1170. ///
  1171. - (void)onCallbackWithCode:(NSInteger)code extra:(NSString * _Nullable)extra;
  1172. @end
  1173. typedef SWIFT_ENUM(NSInteger, AntiAddictionServiceResult, open) {
  1174. AntiAddictionServiceResultLoginSuccess = 500,
  1175. AntiAddictionServiceResultLogout = 1000,
  1176. AntiAddictionServiceResultSwitchAccount = 1001,
  1177. AntiAddictionServiceResultPeriodRestrict = 1030,
  1178. AntiAddictionServiceResultDurationLimit = 1050,
  1179. AntiAddictionServiceResultOpenAlertTip = 1095,
  1180. AntiAddictionServiceResultPayLimitNone = 1020,
  1181. AntiAddictionServiceResultPayLimitReachLimit = 1025,
  1182. };
  1183. #if __has_attribute(external_source_symbol)
  1184. # pragma clang attribute pop
  1185. #endif
  1186. #pragma clang diagnostic pop
  1187. #endif
  1188. #elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
  1189. // Generated by Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)
  1190. #ifndef ANTIADDICTIONSERVICE_SWIFT_H
  1191. #define ANTIADDICTIONSERVICE_SWIFT_H
  1192. #pragma clang diagnostic push
  1193. #pragma clang diagnostic ignored "-Wgcc-compat"
  1194. #if !defined(__has_include)
  1195. # define __has_include(x) 0
  1196. #endif
  1197. #if !defined(__has_attribute)
  1198. # define __has_attribute(x) 0
  1199. #endif
  1200. #if !defined(__has_feature)
  1201. # define __has_feature(x) 0
  1202. #endif
  1203. #if !defined(__has_warning)
  1204. # define __has_warning(x) 0
  1205. #endif
  1206. #if __has_include(<swift/objc-prologue.h>)
  1207. # include <swift/objc-prologue.h>
  1208. #endif
  1209. #pragma clang diagnostic ignored "-Wauto-import"
  1210. #include <Foundation/Foundation.h>
  1211. #include <stdint.h>
  1212. #include <stddef.h>
  1213. #include <stdbool.h>
  1214. #if !defined(SWIFT_TYPEDEFS)
  1215. # define SWIFT_TYPEDEFS 1
  1216. # if __has_include(<uchar.h>)
  1217. # include <uchar.h>
  1218. # elif !defined(__cplusplus)
  1219. typedef uint_least16_t char16_t;
  1220. typedef uint_least32_t char32_t;
  1221. # endif
  1222. typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
  1223. typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
  1224. typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
  1225. typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
  1226. typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
  1227. typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
  1228. typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
  1229. typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
  1230. typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
  1231. typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
  1232. typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
  1233. typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
  1234. #endif
  1235. #if !defined(SWIFT_PASTE)
  1236. # define SWIFT_PASTE_HELPER(x, y) x##y
  1237. # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
  1238. #endif
  1239. #if !defined(SWIFT_METATYPE)
  1240. # define SWIFT_METATYPE(X) Class
  1241. #endif
  1242. #if !defined(SWIFT_CLASS_PROPERTY)
  1243. # if __has_feature(objc_class_property)
  1244. # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
  1245. # else
  1246. # define SWIFT_CLASS_PROPERTY(...)
  1247. # endif
  1248. #endif
  1249. #if __has_attribute(objc_runtime_name)
  1250. # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
  1251. #else
  1252. # define SWIFT_RUNTIME_NAME(X)
  1253. #endif
  1254. #if __has_attribute(swift_name)
  1255. # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
  1256. #else
  1257. # define SWIFT_COMPILE_NAME(X)
  1258. #endif
  1259. #if __has_attribute(objc_method_family)
  1260. # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
  1261. #else
  1262. # define SWIFT_METHOD_FAMILY(X)
  1263. #endif
  1264. #if __has_attribute(noescape)
  1265. # define SWIFT_NOESCAPE __attribute__((noescape))
  1266. #else
  1267. # define SWIFT_NOESCAPE
  1268. #endif
  1269. #if __has_attribute(ns_consumed)
  1270. # define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
  1271. #else
  1272. # define SWIFT_RELEASES_ARGUMENT
  1273. #endif
  1274. #if __has_attribute(warn_unused_result)
  1275. # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
  1276. #else
  1277. # define SWIFT_WARN_UNUSED_RESULT
  1278. #endif
  1279. #if __has_attribute(noreturn)
  1280. # define SWIFT_NORETURN __attribute__((noreturn))
  1281. #else
  1282. # define SWIFT_NORETURN
  1283. #endif
  1284. #if !defined(SWIFT_CLASS_EXTRA)
  1285. # define SWIFT_CLASS_EXTRA
  1286. #endif
  1287. #if !defined(SWIFT_PROTOCOL_EXTRA)
  1288. # define SWIFT_PROTOCOL_EXTRA
  1289. #endif
  1290. #if !defined(SWIFT_ENUM_EXTRA)
  1291. # define SWIFT_ENUM_EXTRA
  1292. #endif
  1293. #if !defined(SWIFT_CLASS)
  1294. # if __has_attribute(objc_subclassing_restricted)
  1295. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
  1296. # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  1297. # else
  1298. # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  1299. # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
  1300. # endif
  1301. #endif
  1302. #if !defined(SWIFT_RESILIENT_CLASS)
  1303. # if __has_attribute(objc_class_stub)
  1304. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
  1305. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
  1306. # else
  1307. # define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
  1308. # define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
  1309. # endif
  1310. #endif
  1311. #if !defined(SWIFT_PROTOCOL)
  1312. # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  1313. # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
  1314. #endif
  1315. #if !defined(SWIFT_EXTENSION)
  1316. # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
  1317. #endif
  1318. #if !defined(OBJC_DESIGNATED_INITIALIZER)
  1319. # if __has_attribute(objc_designated_initializer)
  1320. # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  1321. # else
  1322. # define OBJC_DESIGNATED_INITIALIZER
  1323. # endif
  1324. #endif
  1325. #if !defined(SWIFT_ENUM_ATTR)
  1326. # if defined(__has_attribute) && __has_attribute(enum_extensibility)
  1327. # define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
  1328. # else
  1329. # define SWIFT_ENUM_ATTR(_extensibility)
  1330. # endif
  1331. #endif
  1332. #if !defined(SWIFT_ENUM)
  1333. # define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  1334. # if __has_feature(generalized_swift_name)
  1335. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
  1336. # else
  1337. # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
  1338. # endif
  1339. #endif
  1340. #if !defined(SWIFT_UNAVAILABLE)
  1341. # define SWIFT_UNAVAILABLE __attribute__((unavailable))
  1342. #endif
  1343. #if !defined(SWIFT_UNAVAILABLE_MSG)
  1344. # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
  1345. #endif
  1346. #if !defined(SWIFT_AVAILABILITY)
  1347. # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
  1348. #endif
  1349. #if !defined(SWIFT_WEAK_IMPORT)
  1350. # define SWIFT_WEAK_IMPORT __attribute__((weak_import))
  1351. #endif
  1352. #if !defined(SWIFT_DEPRECATED)
  1353. # define SWIFT_DEPRECATED __attribute__((deprecated))
  1354. #endif
  1355. #if !defined(SWIFT_DEPRECATED_MSG)
  1356. # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
  1357. #endif
  1358. #if __has_feature(attribute_diagnose_if_objc)
  1359. # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
  1360. #else
  1361. # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
  1362. #endif
  1363. #if !defined(IBSegueAction)
  1364. # define IBSegueAction
  1365. #endif
  1366. #if __has_feature(modules)
  1367. #if __has_warning("-Watimport-in-framework-header")
  1368. #pragma clang diagnostic ignored "-Watimport-in-framework-header"
  1369. #endif
  1370. @import Foundation;
  1371. @import ObjectiveC;
  1372. #endif
  1373. #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
  1374. #pragma clang diagnostic ignored "-Wduplicate-method-arg"
  1375. #if __has_warning("-Wpragma-clang-attribute")
  1376. # pragma clang diagnostic ignored "-Wpragma-clang-attribute"
  1377. #endif
  1378. #pragma clang diagnostic ignored "-Wunknown-pragmas"
  1379. #pragma clang diagnostic ignored "-Wnullability"
  1380. #if __has_attribute(external_source_symbol)
  1381. # pragma push_macro("any")
  1382. # undef any
  1383. # pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="AntiAddictionService",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
  1384. # pragma pop_macro("any")
  1385. #endif
  1386. @class NSNumber;
  1387. @class NSString;
  1388. SWIFT_CLASS("_TtC20AntiAddictionService26AntiAddictionConfiguration")
  1389. @interface AntiAddictionConfiguration : NSObject
  1390. @property (nonatomic) BOOL enableLog;
  1391. @property (nonatomic) BOOL needUploadUserAction;
  1392. @property (nonatomic) BOOL isServerError;
  1393. - (BOOL)getShouldStandAloneWithResultBlock:(void (^ _Nullable)(BOOL))resultBlock;
  1394. /// 游戏标识,多端统一用
  1395. @property (nonatomic, copy) NSString * _Nullable gameIdentifier;
  1396. ///
  1397. @property (nonatomic, readonly, copy) NSString * _Nonnull bundleId;
  1398. /// AAKit 在线时长限制开关,默认值为 true
  1399. @property (nonatomic) BOOL useSdkOnlineTimeLimit;
  1400. /// AAKit 支付限制开关,默认值为 true
  1401. @property (nonatomic) BOOL useSdkPaymentLimit;
  1402. /// AAKit 是否显示切换账号,默认值为true
  1403. @property (nonatomic) BOOL showSwitchAccount;
  1404. /// 未成年人非节假日每日总时长 单位秒
  1405. @property (nonatomic) NSInteger minorCommonDayTotalTime;
  1406. /// 未成年人节假日每日总时长 单位秒
  1407. @property (nonatomic) NSInteger minorHolidayTotalTime;
  1408. /// 游客每日总时长(无节假日区分)单位秒
  1409. @property (nonatomic) NSInteger guestTotalTime;
  1410. /// 第一次提醒剩余游戏时间时的剩余时长 单位秒
  1411. @property (nonatomic) NSInteger firstAlertTipRemainTime;
  1412. /// 展示倒计时浮窗时的剩余时长 单位秒
  1413. @property (nonatomic) NSInteger countdownAlertTipRemainTime;
  1414. /// 宵禁开始时间(整数,小时,24小时进制,默认22)
  1415. @property (nonatomic) NSInteger curfewHourStart;
  1416. /// 宵禁结束时间(整数,小时,24小时进制,默认8)
  1417. @property (nonatomic) NSInteger curfewHourEnd;
  1418. /// 宵禁开始时间(字符串,格式为<code>小时:分钟</code>,24小时进制,默认<code>22:00</code>)方便配置具体到分钟
  1419. @property (nonatomic, copy) NSString * _Nonnull nightStrictStart;
  1420. /// 宵禁结束时间(整数,格式为<code>小时:分钟</code>,24小时进制,默认8)方便配置具体到分钟
  1421. @property (nonatomic, copy) NSString * _Nonnull nightStrictEnd;
  1422. /// 8-15岁单笔付费额度限制,单位分(默认5000分)
  1423. @property (nonatomic) NSInteger singlePaymentAmountLimitJunior;
  1424. /// 8-15岁每月总付费额度限制,单位分(默认20000分)
  1425. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitJunior;
  1426. /// 16-17岁单笔付费额度限制,单位分(默认10000分)
  1427. @property (nonatomic) NSInteger singlePaymentAmountLimitSenior;
  1428. /// 16-17岁每月总付费额度限制,单位分(默认40000分)
  1429. @property (nonatomic) NSInteger mouthTotalPaymentAmountLimitSenior;
  1430. @property (nonatomic, copy) NSArray<NSString *> * _Nonnull holiday;
  1431. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  1432. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  1433. @end
  1434. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAgeLimit, open) {
  1435. AntiAddictionRealNameAgeLimitUnrealname = -1,
  1436. AntiAddictionRealNameAgeLimitChild = 0,
  1437. AntiAddictionRealNameAgeLimitTeen = 8,
  1438. AntiAddictionRealNameAgeLimitYoung = 16,
  1439. AntiAddictionRealNameAgeLimitAdult = 18,
  1440. };
  1441. typedef SWIFT_ENUM(NSInteger, AntiAddictionRealNameAuthState, open) {
  1442. AntiAddictionRealNameAuthStateSuccess = 0,
  1443. AntiAddictionRealNameAuthStateVerifying = 1,
  1444. AntiAddictionRealNameAuthStateFail = 2,
  1445. };
  1446. @protocol AntiAddictionServiceCallback;
  1447. SWIFT_CLASS_NAMED("AntiAddictionService")
  1448. @interface AntiAddictionService : NSObject
  1449. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull LocalTokenString;)
  1450. + (NSString * _Nonnull)LocalTokenString SWIFT_WARN_UNUSED_RESULT;
  1451. SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) AntiAddictionConfiguration * _Nonnull configuration;)
  1452. + (AntiAddictionConfiguration * _Nonnull)configuration SWIFT_WARN_UNUSED_RESULT;
  1453. + (void)setConfiguration:(AntiAddictionConfiguration * _Nonnull)value;
  1454. + (NSString * _Nonnull)getSDKVersion SWIFT_WARN_UNUSED_RESULT;
  1455. + (void)enableLogWithEnable:(BOOL)enable;
  1456. /// AAKit 配置方法
  1457. /// \param useSdkRealName 实名登记开关,默认值为 true
  1458. ///
  1459. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  1460. ///
  1461. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  1462. ///
  1463. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit;
  1464. /// AAKit 配置方法
  1465. /// \param useSdkPaymentLimit 支付限制开关,默认值为 true
  1466. ///
  1467. /// \param useSdkOnlineTimeLimit 在线时长限制开关,默认值为 true
  1468. ///
  1469. /// \param showSwitchAccount 是否显示切换账号按钮,
  1470. ///
  1471. + (void)setFunctionConfig:(BOOL)useSdkPaymentLimit :(BOOL)useSdkOnlineTimeLimit :(BOOL)showSwitchAccount;
  1472. + (void)getConfig:(NSString * _Nonnull)clinentId completionHandler:(void (^ _Nullable)(BOOL))completionHandler;
  1473. /// 初始化 SDK
  1474. /// \param delegate 接收回调代理
  1475. ///
  1476. /// \param gameIdentifier 游戏唯一标识符
  1477. ///
  1478. + (void)init:(id <AntiAddictionServiceCallback> _Nonnull)delegate gameIdentifier:(NSString * _Nullable)gameIdentifier SWIFT_METHOD_FAMILY(none);
  1479. + (void)tapTokenLoginWithKid:(NSString * _Nonnull)kid mackey:(NSString * _Nonnull)mackey clientID:(NSString * _Nonnull)clientID successHandler:(void (^ _Nullable)(NSString * _Nonnull))successHandler failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1480. /// 登录用户
  1481. /// \param userToken 用户唯一标识符,
  1482. ///
  1483. /// \param accessToken 实名服务签算JwtToken
  1484. ///
  1485. /// \param ageLimit 年龄限制
  1486. ///
  1487. + (void)loginWithUserToken:(NSString * _Nonnull)userToken accessToken:(NSString * _Nonnull)accessToken ageLimit:(enum AntiAddictionRealNameAgeLimit)ageLimit;
  1488. /// 进入游戏
  1489. + (void)enterGame;
  1490. /// 离开游戏
  1491. + (void)leaveGame;
  1492. /// 退出用户登录
  1493. + (void)logout;
  1494. /// 用户切换账号
  1495. + (void)switchAccount;
  1496. /// 获取用户类型
  1497. /// \param userId 用户 id
  1498. ///
  1499. + (NSInteger)getCurrentUserAgeLimite SWIFT_WARN_UNUSED_RESULT;
  1500. /// 获取当前防沉迷Token
  1501. /// \param userId 用户 id
  1502. ///
  1503. + (NSString * _Nonnull)currentToken SWIFT_WARN_UNUSED_RESULT;
  1504. /// 获取用户剩余时长
  1505. + (NSInteger)currentUserRemainingTime SWIFT_WARN_UNUSED_RESULT;
  1506. /// 是否是单机模式
  1507. + (BOOL)isStandAlone SWIFT_WARN_UNUSED_RESULT;
  1508. + (NSString * _Nonnull)getchildNightStrictRemainDesc SWIFT_WARN_UNUSED_RESULT;
  1509. /// 查询能否支付,直接返回支付限制相关回调类型 raw value,特殊情况使用
  1510. /// \param amount 支付金额,单位分
  1511. ///
  1512. + (NSInteger)checkCurrentPayLimit:(NSInteger)amount SWIFT_WARN_UNUSED_RESULT;
  1513. /// 查询能否支付
  1514. /// \param amount 支付金额,单位分
  1515. ///
  1516. /// \param status true:可以付费 false:限制消费
  1517. ///
  1518. /// \param title 限制消费时提示标题
  1519. ///
  1520. /// \param description 限制消费提示国家法规内容
  1521. ///
  1522. + (void)checkPayLimit:(NSInteger)amount callBack:(void (^ _Nullable)(BOOL, NSString * _Nonnull, NSString * _Nonnull))callBack failureHandler:(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1523. /// 上报消费结果
  1524. /// \param amount 支付金额,单位分
  1525. ///
  1526. + (void)submitPayResult:(NSInteger)amount :(void (^ _Nullable)(BOOL))callBack :(void (^ _Nullable)(NSString * _Nonnull))failureHandler;
  1527. + (BOOL)isHoliday SWIFT_WARN_UNUSED_RESULT;
  1528. /// 生成身份证兑换码(有效期从生成起6个小时整以内)
  1529. + (NSString * _Nonnull)generateIDCode SWIFT_WARN_UNUSED_RESULT;
  1530. + (void)startTimeStaticWithIsLogin:(BOOL)isLogin;
  1531. + (void)stopTimeStatic;
  1532. /// 实名认证
  1533. /// \param userToken 用户唯一标识,如用户 ID
  1534. ///
  1535. /// \param name 姓名
  1536. ///
  1537. /// \param idCard 身份证
  1538. ///
  1539. /// \param completion 结果回调
  1540. ///
  1541. + (void)realNameAuthWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code name:(NSString * _Nonnull)name idCard:(NSString * _Nonnull)idCard completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1542. /// 检查实名状态
  1543. /// \param userToken 用户唯一标识,如用户 ID
  1544. ///
  1545. /// \param completion 结果回调
  1546. ///
  1547. + (void)checkRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1548. /// 检查TapTap实名状态
  1549. /// \param userToken 用户唯一标识,如用户 ID
  1550. ///
  1551. /// \param completion 结果回调
  1552. ///
  1553. + (void)checkTapTapRealnameStateWithClientId:(NSString * _Nonnull)clientId userId:(NSString * _Nonnull)userId code:(NSString * _Nonnull)code completion:(void (^ _Nonnull)(enum AntiAddictionRealNameAuthState, NSString * _Nonnull, enum AntiAddictionRealNameAgeLimit))completion failureHandler:(void (^ _Nonnull)(NSString * _Nonnull))failureHandler;
  1554. + (NSString * _Nullable)checkPlayTimeResultWithHandler:(void (^ _Nonnull)(NSString * _Nullable))handler SWIFT_WARN_UNUSED_RESULT;
  1555. - (nonnull instancetype)init SWIFT_UNAVAILABLE;
  1556. + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
  1557. @end
  1558. SWIFT_PROTOCOL("_TtP20AntiAddictionService28AntiAddictionServiceCallback_")
  1559. @protocol AntiAddictionServiceCallback <NSObject>
  1560. /// 回调
  1561. /// \param code 回调code
  1562. ///
  1563. /// \param extra 回调信息
  1564. ///
  1565. - (void)onCallbackWithCode:(NSInteger)code extra:(NSString * _Nullable)extra;
  1566. @end
  1567. typedef SWIFT_ENUM(NSInteger, AntiAddictionServiceResult, open) {
  1568. AntiAddictionServiceResultLoginSuccess = 500,
  1569. AntiAddictionServiceResultLogout = 1000,
  1570. AntiAddictionServiceResultSwitchAccount = 1001,
  1571. AntiAddictionServiceResultPeriodRestrict = 1030,
  1572. AntiAddictionServiceResultDurationLimit = 1050,
  1573. AntiAddictionServiceResultOpenAlertTip = 1095,
  1574. AntiAddictionServiceResultPayLimitNone = 1020,
  1575. AntiAddictionServiceResultPayLimitReachLimit = 1025,
  1576. };
  1577. #if __has_attribute(external_source_symbol)
  1578. # pragma clang attribute pop
  1579. #endif
  1580. #pragma clang diagnostic pop
  1581. #endif
  1582. #endif
  1583. #endif