FIRDynamicLinks+FirstParty.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright 2018 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FirebaseDynamicLinks/Sources/Public/FirebaseDynamicLinks/FIRDynamicLinks.h" // IWYU pragma: export
  17. #import "FirebaseDynamicLinks/Sources/FIRDynamicLink+Private.h"
  18. @class UIViewController;
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface FIRDynamicLinks (FirstParty)
  21. /**
  22. * @method setUpWithLaunchOptions::apiKey:clientID:urlScheme:userDefaults:
  23. * @abstract Set up Dynamic Links.
  24. * @param launchOptions launchOptions from |application:didFinishLaunchingWithOptions:|. If nil, the
  25. * deep link may appear twice on iOS 9 if a user clicks on a link before opening the app.
  26. * @param apiKey API key for API access.
  27. * @param clientID client ID for API access.
  28. * @param urlScheme A custom url scheme used by the application. If nil, bundle id will be used.
  29. * @param userDefaults The defaults from a user’s defaults database. If nil, standard
  30. * NSUserDefaults will be used.
  31. * @return whether the Dynamic Links was set up successfully.
  32. */
  33. - (BOOL)setUpWithLaunchOptions:(nullable NSDictionary *)launchOptions
  34. apiKey:(NSString *)apiKey
  35. clientID:(NSString *)clientID
  36. urlScheme:(nullable NSString *)urlScheme
  37. userDefaults:(nullable NSUserDefaults *)userDefaults
  38. DEPRECATED_MSG_ATTRIBUTE(
  39. "Use [FIRDynamicLinks setUpWithLaunchOptions::apiKey:urlScheme:userDefaults:] instead.");
  40. /**
  41. * @method setUpWithLaunchOptions::apiKey:urlScheme:userDefaults:
  42. * @abstract Set up Dynamic Links.
  43. * @param launchOptions launchOptions from |application:didFinishLaunchingWithOptions:|. If nil, the
  44. * deep link may appear twice on iOS 9 if a user clicks on a link before opening the app.
  45. * @param apiKey API key for API access.
  46. * @param urlScheme A custom url scheme used by the application. If nil, bundle id will be used.
  47. * @param userDefaults The defaults from a user’s defaults database. If nil, standard
  48. * NSUserDefaults will be used.
  49. * @return whether the Dynamic Links was set up successfully.
  50. */
  51. - (BOOL)setUpWithLaunchOptions:(nullable NSDictionary *)launchOptions
  52. apiKey:(NSString *)apiKey
  53. urlScheme:(nullable NSString *)urlScheme
  54. userDefaults:(nullable NSUserDefaults *)userDefaults;
  55. /**
  56. * @method checkForPendingDynamicLink
  57. * @abstract check for a pending Dynamic Link. This method should be called from your
  58. * |UIApplicationDelegate|'s |application:didFinishLaunchingWithOptions:|. If a Dynamic Link is
  59. * found, you'll receive an URL in |application:openURL:options:| on iOS9 or later, and
  60. * |application:openURL:sourceApplication:annotation| on iOS 8 and earlier. From there you could
  61. * get a |GINDeepLink| object by calling |dynamicLinkFromCustomSchemeURL:|. If no Dynamic Link
  62. * is found, you will receive callback with "dismiss link". For "dismiss link" the
  63. * FIRDynamicLink.url property is nil.
  64. * For new integrations prefer to use method
  65. * retrievePendingDynamicLinkWithRetrievalProcessType:retrievalOptions:delegate: . This method
  66. * will be the only way to use FDL in near future.
  67. */
  68. - (void)checkForPendingDynamicLink;
  69. /**
  70. @method checkForPendingDynamicLinkUsingExperimentalRetrievalProcess
  71. @abstract The same as checkForPendingDynamicLink. Will be using experimental retrieval process.
  72. */
  73. - (void)checkForPendingDynamicLinkUsingExperimentalRetrievalProcess;
  74. /**
  75. * @method sharedInstance
  76. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  77. */
  78. + (instancetype)
  79. sharedInstance DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinks] instead.");
  80. /**
  81. * @method checkForPendingDeepLink
  82. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  83. */
  84. - (void)checkForPendingDeepLink DEPRECATED_MSG_ATTRIBUTE(
  85. "Use [FIRDynamicLinks checkForPendingDynamicLink] instead.");
  86. /**
  87. * @method deepLinkFromCustomSchemeURL:
  88. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  89. */
  90. - (nullable FIRDynamicLink *)deepLinkFromCustomSchemeURL:(NSURL *)url
  91. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinkFromCustomSchemeURL:] instead.");
  92. /**
  93. * @method deepLinkFromUniversalLinkURL:
  94. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  95. */
  96. - (nullable FIRDynamicLink *)deepLinkFromUniversalLinkURL:(NSURL *)url
  97. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinkFromUniversalLinkURL:] instead.");
  98. /**
  99. * @method shouldHandleDeepLinkFromCustomSchemeURL:
  100. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  101. */
  102. - (BOOL)shouldHandleDeepLinkFromCustomSchemeURL:(NSURL *)url
  103. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks shouldHandleDynamicLinkFromCustomSchemeURL:]"
  104. " instead.");
  105. @end
  106. NS_ASSUME_NONNULL_END