洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.9 KiB

8 months ago
  1. //
  2. // APDID.h
  3. // APPSecuritySDK
  4. //
  5. // Created by eric on 2021/2/7.
  6. // Copyright © 2021 Alipay. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ASSTokenResult.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. typedef void(^ASSSecureSdkCallback)(ASSTokenResult* result, NSString* error);
  12. typedef void(^ASSSecureSdkOpenCallback)(NSString* token, int errorCode);
  13. @interface APDID : NSObject
  14. /*
  15. vkeyidapp启动时和收银台页面加载时调用SDK内部会根据时间戳和设备信息进行判断是否需要进行网络请求线
  16. @param params tiduseridenvironment
  17. tid与userid选传vkeyid与其正确关联
  18. app设置中的环境相关联value包括线上
  19. @param callback
  20. Asynchronously initialize vkeyid(apdid), recommend to invoke this API when app launches, and cashier view presents.
  21. Inside SDK we will decide whether to launch network request or not based on timestamp and device info.
  22. No thread requirement.
  23. @param params Initialized parameters, includes 3 key-value pairs: tid, userid,environment
  24. Tid and userid are optional, they can be associated with vkeyid(apdid) if passed in.
  25. If the values for tid and userid are not available, pass in empty NSString(@"").
  26. @param callback Callback block when token is available
  27. */
  28. + (void) initToken:(NSDictionary*)params callback:(ASSSecureSdkCallback)callback;
  29. /*
  30. vkeyid完整信息vkeyidtokenclientkey
  31. appvkeyid会返回客户端随机串clientkeytoken将会返回空
  32. Synchronously get full info of vkeyid(apdid), token and clientkey, no network requests.
  33. If the app is installed for the first time and first network request failed, it would return degradation result: vkeyid would be clientkey which is a client-side generated random string, token would be empty NSString @""
  34. */
  35. + (ASSTokenResult*)getToken DEPRECATED_MSG_ATTRIBUTE("use getTokenResult instead");
  36. /*
  37. vkeyid完整信息vkeyidtokenclientkey
  38. appvkeyid会返回客户端随机串clientkeytoken将会返回空
  39. Synchronously get full info of vkeyid(apdid), token and clientkey, no network requests.
  40. If the app is installed for the first time and first network request failed, it would return degradation result: vkeyid would be clientkey which is a client-side generated random string, token would be empty NSString @""
  41. */
  42. + (ASSTokenResult*)getTokenResult;
  43. + (ASSTokenResult *)getTokenResult:(NSString*)appName appKeyClient:(NSString*)appKeyClient;
  44. //===================lazada api====================//
  45. /*
  46. vkeyidapp启动时和收银台页面加载时调用SDK内部会根据时间戳和设备信息进行判断是否需要进行网络请求线
  47. @param appName
  48. @param appKeyClient
  49. @param callback Token作为参数
  50. */
  51. + (void)initToken:(NSString *)appName appKeyClient:(NSString *)appKeyClient callback:(ASSSecureSdkOpenCallback)callback;
  52. /*
  53. token
  54. @param appName
  55. @param appKeyClient
  56. */
  57. + (NSString *)getResultToken;
  58. /*
  59. token
  60. @param appName
  61. @param appKeyClient
  62. */
  63. + (NSString *)getResultToken:(NSString*)appName appKeyClient:(NSString*)appKeyClient;
  64. //===================TMN api====================//
  65. /*
  66. vkeyidapp启动时和收银台页面加载时调用SDK内部会根据时间戳和设备信息进行判断是否需要进行网络请求线
  67. @param appName
  68. @param appKeyClient
  69. @param sessionId id
  70. @param callback Token作为参数
  71. */
  72. + (void)initToken:(NSString *)appName appKeyClient:(NSString *)appKeyClient sessionId:(NSString *)sessionId callback:(ASSSecureSdkOpenCallback)callback;
  73. //===================ae api====================//
  74. /*
  75. @param params umidtiduseridenvironment
  76. umid必传tid与userid选传vkeyid与其正确关联
  77. app设置中的环境相关联value包括线上
  78. @param callback
  79. */
  80. + (void) updateToken:(NSDictionary*)params callback:(ASSSecureSdkCallback)callback;
  81. @end
  82. NS_ASSUME_NONNULL_END