DouyinOpenSDKApplicationDelegate.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // BDOpenPlatformApplicationDelegate.h
  3. //
  4. // Created by ByteDance on 2019/7/8.
  5. // Copyright (c) 2018年 ByteDance Ltd. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. @protocol DouyinOpenSDKLogDelegate <NSObject>
  10. /**
  11. * @brief Open Platform internal log in level ERROR or Warning will callback in this method.
  12. * You need to register log delgate in BDOpenPlatformApplicationDelegate
  13. *
  14. * @param logInfo Open Platform internal log info.
  15. *
  16. */
  17. - (void)onLog:(NSString *)logInfo;
  18. @end
  19. @interface DouyinOpenSDKApplicationDelegate : NSObject
  20. @property (nonatomic, copy, readonly) NSString *currentVersion; //!< Open Platform SDK currtent version
  21. @property (nonatomic, weak) id<DouyinOpenSDKLogDelegate> logDelegate;//!< Open Platform internal log delegate
  22. + (instancetype) sharedInstance;
  23. /**
  24. * @brief iTunes Url to download app.
  25. *
  26. * @return iTunes iTunes Url if international it will return empty string
  27. */
  28. - (NSString *)iTunesUrl;
  29. /**
  30. * @brief Call when you application delegate receive UIApplication didFinishLaunchingWithOptions
  31. *
  32. * @param application Your singleton app object.
  33. * @param launchOptions A dictionary indicating the reason the app was launched (if any). The contents of this dictionary may be empty in situations where the user launched the app directly. For information about the possible keys in this dictionary and how to handle them, see Launch Options Keys.
  34. *
  35. */
  36. - (void)application:(UIApplication *)application didFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions;
  37. /**
  38. * @brief Call when you application delegate receive OpenURL action
  39. *
  40. * @param application Your singleton app object.
  41. * @param url The URL resource to open. This resource can be a network resource or a file. For information about the Apple-registered URL schemes, see Apple URL Scheme Reference.
  42. * @param sourceApplication you receive in you App Delegate
  43. * @param annotation you receive in you App Delegate
  44. * @return if Open Platform is handle this URL request will return YES
  45. */
  46. - (BOOL)application:(nullable UIApplication *)application openURL:(nonnull NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nonnull id)annotation;
  47. /**
  48. * @brief If you didn't set you ClientKey in Project.info.plisty you can set it manually.
  49. *
  50. * @param appid The ClientKey you got in Open platform.
  51. *
  52. * @return register results if success return YES
  53. */
  54. - (BOOL)registerAppId:(NSString *)appid;
  55. /**
  56. * @brief Get the ClientKey registed.
  57. *
  58. * @return if not registered will return nil
  59. */
  60. - (nullable NSString *)appId;
  61. /**
  62. * @brief The result of target App is installed
  63. *
  64. * @return if installed will return YES
  65. */
  66. - (BOOL)isAppInstalled;
  67. @end
  68. NS_ASSUME_NONNULL_END