CSJLinkActionUtility.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // CSJLinkActionUtility.h
  3. // CSJAdSDK
  4. //
  5. // Created by bytedance on 2020/10/11.
  6. // Copyright © 2020 bytedance. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface CSJLinkActionUtility : NSObject
  12. /**
  13. This is a simplified version of @c [CSJLinkActionUtility bu_openURL:options:completion:], which provides empty @c options
  14. dictionary and nil @c completion.
  15. @param url A URL.
  16. */
  17. + (void)csj_openURL:(NSURL*)url;
  18. /**
  19. This is a wrapper method that picks the correct version of @c [UIApplication openURL:] (versus
  20. @c [UIApplication openURL:options:completionHandler:]) base the iOS target.
  21. @param url A URL.
  22. @param options A dictionary of options to use when opening the URL.
  23. @param completion The block to execute with the results.
  24. */
  25. + (void)csj_openURL:(NSURL*)url
  26. options:(NSDictionary<UIApplicationOpenExternalURLOptionsKey, id> *)options
  27. completion:(void (^ __nullable)(BOOL success))completion;
  28. /**
  29. Make sure that LSApplicationQueriesSchemes and Scheme are configured in Info.plist
  30. This is a simplified version of @c [UIApplication canOpenURL:]
  31. @param url A URL
  32. */
  33. + (BOOL)csj_canOpenURL:(NSURL *)url;
  34. /**
  35. * Will open URL Notification
  36. */
  37. + (void)csj_postWillOpenURLNotification;
  38. /**
  39. Did open URL Notification
  40. @param success Open URL if successs
  41. */
  42. + (void)csj_postDidOpenURLNotificationWith:(BOOL)success;
  43. @end
  44. NS_ASSUME_NONNULL_END