FIRActionCodeSettings.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2017 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 <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /** @class FIRActionCodeSettings
  19. @brief Used to set and retrieve settings related to the handling action codes.
  20. */
  21. @interface FIRActionCodeSettings : NSObject
  22. /** @property URL
  23. @brief This URL represents the state/Continue URL in the form of a universal link.
  24. @remarks This URL can should be contructed as a universal link that would either directly open
  25. the app where the action code would be handled or continue to the app after the action code
  26. handled by Firebase.
  27. */
  28. @property(nonatomic, copy, nullable) NSURL *URL;
  29. /** @property handleCodeInApp
  30. @brief Indicates whether or not the action code link will open the app directly or after being
  31. redirected from a Firebase owned web widget.
  32. */
  33. @property(assign, nonatomic) BOOL handleCodeInApp;
  34. /** @property iOSBundleID
  35. @brief The iOS bundle ID, if available.
  36. */
  37. @property(copy, nonatomic, readonly, nullable) NSString *iOSBundleID;
  38. /** @property iOSAppStoreID
  39. @brief The iOS app store identifier, if available.
  40. */
  41. @property(nonatomic, copy, readonly, nullable) NSString *iOSAppStoreID;
  42. /** @property androidPackageName
  43. @brief The Android package name, if available.
  44. */
  45. @property(nonatomic, copy, readonly, nullable) NSString *androidPackageName;
  46. /** @property androidMinimumVersion
  47. @brief The minimum Android version supported, if available.
  48. */
  49. @property(nonatomic, copy, readonly, nullable) NSString *androidMinimumVersion;
  50. /** @property androidInstallIfNotAvailable
  51. @brief Indicates whether or not the Android app should be installed if not already available.
  52. */
  53. @property(nonatomic, assign, readonly) BOOL androidInstallIfNotAvailable;
  54. /** @fn setIOSBundleID:appStoreID
  55. @brief Sets the iOS bundle Id and appStoreID.
  56. @param iOSBundleID The iOS bundle ID.
  57. @param appStoreID The app's AppStore ID.
  58. @remarks If the app is not already installed on an iOS device and an appStoreId is provided, the
  59. app store page of the app will be opened. If no app store ID is provided, the web app link
  60. will be used instead.
  61. */
  62. - (void)setIOSBundleID:(NSString *)iOSBundleID appStoreID:(nullable NSString *)appStoreID;
  63. /** @fn setAndroidPackageName:installIfNotAvailable:minimumVersion:
  64. @brief Sets the Android package name, the flag to indicate whether or not to install the app and
  65. the minimum Android version supported.
  66. @param androidPackageName The Android package name.
  67. @param installIfNotAvailable Indicates whether or not the app should be installed if not
  68. available.
  69. @param minimumVersion The minimum version of Android supported.
  70. @remarks If installIfNotAvailable is set to YES and the link is opened on an android device, it
  71. will try to install the app if not already available. Otherwise the web URL is used.
  72. */
  73. - (void)setAndroidPackageName:(NSString *)androidPackageName
  74. installIfNotAvailable:(BOOL)installIfNotAvailable
  75. minimumVersion:(nullable NSString *)minimumVersion;
  76. @end
  77. NS_ASSUME_NONNULL_END