FIRDynamicLinks+FirstParty.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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/FIRDynamicLinks.h"
  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. /**
  39. * @method checkForPendingDynamicLink
  40. * @abstract check for a pending Dynamic Link. This method should be called from your
  41. * |UIApplicationDelegate|'s |application:didFinishLaunchingWithOptions:|. If a Dynamic Link is
  42. * found, you'll receive an URL in |application:openURL:options:| on iOS9 or later, and
  43. * |application:openURL:sourceApplication:annotation| on iOS 8 and earlier. From there you could
  44. * get a |GINDeepLink| object by calling |dynamicLinkFromCustomSchemeURL:|. If no Dynamic Link
  45. * is found, you will receive callback with "dismiss link". For "dismiss link" the
  46. * FIRDynamicLink.url property is nil.
  47. * For new integrations prefer to use method
  48. * retrievePendingDynamicLinkWithRetrievalProcessType:retrievalOptions:delegate: . This method
  49. * will be the only way to use FDL in near future.
  50. */
  51. - (void)checkForPendingDynamicLink;
  52. /**
  53. @method checkForPendingDynamicLinkUsingExperimentalRetrievalProcess
  54. @abstract The same as checkForPendingDynamicLink. Will be using experimental retrieval process.
  55. */
  56. - (void)checkForPendingDynamicLinkUsingExperimentalRetrievalProcess;
  57. /**
  58. * @method sharedInstance
  59. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  60. */
  61. + (instancetype)
  62. sharedInstance DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinks] instead.");
  63. /**
  64. * @method checkForPendingDeepLink
  65. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  66. */
  67. - (void)checkForPendingDeepLink DEPRECATED_MSG_ATTRIBUTE(
  68. "Use [FIRDynamicLinks checkForPendingDynamicLink] instead.");
  69. /**
  70. * @method deepLinkFromCustomSchemeURL:
  71. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  72. */
  73. - (nullable FIRDynamicLink *)deepLinkFromCustomSchemeURL:(NSURL *)url
  74. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinkFromCustomSchemeURL:] instead.");
  75. /**
  76. * @method deepLinkFromUniversalLinkURL:
  77. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  78. */
  79. - (nullable FIRDynamicLink *)deepLinkFromUniversalLinkURL:(NSURL *)url
  80. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks dynamicLinkFromUniversalLinkURL:] instead.");
  81. /**
  82. * @method shouldHandleDeepLinkFromCustomSchemeURL:
  83. * @abstract Method for compatibility with old interface of the GINDurableDeepLinkService
  84. */
  85. - (BOOL)shouldHandleDeepLinkFromCustomSchemeURL:(NSURL *)url
  86. DEPRECATED_MSG_ATTRIBUTE("Use [FIRDynamicLinks shouldHandleDynamicLinkFromCustomSchemeURL:]"
  87. " instead.");
  88. @end
  89. NS_ASSUME_NONNULL_END