diff --git a/README.md b/README.md index bffd760a5..88c37e91f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# UPDATED TO IOS SDK 4 +This update was done to test phone authentication in iOS. All other methods haven't been tested. + # cordova-plugin-firebase This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! Android and iOS supported (including iOS 10). @@ -327,3 +330,37 @@ window.FirebasePlugin.setDefaults(defaults); // or, specify a namespace window.FirebasePlugin.setDefaults(defaults, "namespace"); ``` + +### Phone Authetication (iOS only) + +IMPORTANT: SETUP YOUR PUSH NOTIFICATIONS FIRST, AND VERIFY THAT THEY ARE ARRIVING TO YOUR PHYSICAL DEVICE BEFORE YOU TEST THIS METHOD. USE THE APNS AUTH KEY TO GENERATE THE .P8 FILE AND UPLOAD IT TO FIREBASE. +WHEN YOU CALL THIS METHOD, FCM SENDS A SILENT PUSH TO THE DEVICE TO VERIFY IT. + +This method sends an SMS to the user with the SMS_code and gets the verification id you need to continue the sign in process, with the Firebase JS SDK. + +``` +window.FirebasePlugin.getVerificationID("+573123456789",function(id) { + console.log("verificationID: "+id); + + }, function(error) { + console.error(error); + }); +``` + +Using Ionic2? +``` + (window).FirebasePlugin.getVerificationID("+573123456789", id => { + console.log("verificationID: " + id); + this.verificationId = id; + }, error => { + console.log("error: " + error); + }); +``` +Get the intermediate AuthCredential object +``` +var credential = firebase.auth.PhoneAuthProvider.credential(verificationId, SMS_code); +``` +Then, you can sign in the user with the credential: +``` +firebase.auth().signInWithCredential(credential); +``` \ No newline at end of file diff --git a/package.json b/package.json index 76a657082..c1f1a3c66 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "author": { - "name": "Robert Arnesson" + "name": "Robert Arnesson, Juan Semaan" }, "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/arnesson/cordova-plugin-firebase" + "url": "https://github.com/silverio/cordova-plugin-firebase" }, "name": "cordova-plugin-firebase", "version": "0.1.21", @@ -25,6 +25,7 @@ "cordova-browser", "firebase", "push", - "notifications" + "notifications", + "phone auth" ] } diff --git a/plugin.xml b/plugin.xml index 7cf5b5aae..d92b19d1d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -85,12 +85,16 @@ xmlns:android="http://schemas.android.com/apk/res/android"> + + + + diff --git a/scripts/after_prepare.js b/scripts/after_prepare.js index ed0250bda..ff7ba252c 100755 --- a/scripts/after_prepare.js +++ b/scripts/after_prepare.js @@ -40,7 +40,7 @@ if (directoryExists("platforms/ios")) { if (fileExists(paths[i])) { try { var contents = fs.readFileSync(paths[i]).toString(); - fs.writeFileSync("platforms/ios/" + name + "/Resources/GoogleService-Info.plist", contents) + fs.writeFileSync("platforms/ios/" + name + "/Resources/Resources/GoogleService-Info.plist", contents) } catch(err) { process.stdout.write(err); } diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics index 61f61cd17..2b84b22fa 100755 Binary files a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics and b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics differ diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h index e3ff4c125..d499af668 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h @@ -2,6 +2,8 @@ #import "FIRAnalytics.h" +NS_ASSUME_NONNULL_BEGIN + /** * Provides App Delegate handlers to be used in your App Delegate. * @@ -29,14 +31,14 @@ * updated and a new snapshot can be taken. */ + (void)handleEventsForBackgroundURLSession:(NSString *)identifier - completionHandler:(void (^)(void))completionHandler; + completionHandler:(nullable void (^)(void))completionHandler; /** * Handles the event when the app is launched by a URL. * - * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and - * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on iOS 8.x - * and below) in your app. + * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and + * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on + * iOS 8.x and below) in your app. * * @param url The URL resource to open. This resource can be a network resource or a file. */ @@ -55,3 +57,6 @@ + (void)handleUserActivity:(id)userActivity; @end + +NS_ASSUME_NONNULL_END + diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h index f5023f57f..b6d226712 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h @@ -1,5 +1,6 @@ #import +#import "FIRAnalyticsSwiftNameSupport.h" #import "FIREventNames.h" #import "FIRParameterNames.h" #import "FIRUserPropertyNames.h" @@ -9,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN /// The top level Firebase Analytics singleton that provides methods for logging events and setting /// user properties. See the developer guides for general /// information on using Firebase Analytics in your apps. +FIR_SWIFT_NAME(Analytics) @interface FIRAnalytics : NSObject /// Logs an app event. The event can have up to 25 parameters. Events with the same name must have @@ -17,6 +19,12 @@ NS_ASSUME_NONNULL_BEGIN /// /// The following event names are reserved and cannot be used: ///
    +///
  • ad_activeview
  • +///
  • ad_click
  • +///
  • ad_exposure
  • +///
  • ad_impression
  • +///
  • ad_query
  • +///
  • adunit_exposure
  • ///
  • app_clear_data
  • ///
  • app_remove
  • ///
  • app_update
  • @@ -28,23 +36,26 @@ NS_ASSUME_NONNULL_BEGIN ///
  • notification_open
  • ///
  • notification_receive
  • ///
  • os_update
  • +///
  • screen_view
  • ///
  • session_start
  • ///
  • user_engagement
  • ///
/// /// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or /// underscores. The name must start with an alphabetic character. Some event names are -/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix -/// is reserved and should not be used. Note that event names are case-sensitive and that -/// logging two events whose names differ only in case will result in two distinct events. +/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are +/// case-sensitive and that logging two events whose names differ only in case will result in +/// two distinct events. /// @param parameters The dictionary of event parameters. Passing nil indicates that the event has /// no parameters. Parameter names can be up to 40 characters long and must start with an /// alphabetic character and contain only alphanumeric characters and underscores. Only NSString /// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are -/// supported. NSString parameter values can be up to 100 characters long. The "firebase_" -/// prefix is reserved and should not be used for parameter names. +/// supported. NSString parameter values can be up to 100 characters long. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used for parameter names. + (void)logEventWithName:(NSString *)name - parameters:(nullable NSDictionary *)parameters; + parameters:(nullable NSDictionary *)parameters + FIR_SWIFT_NAME(logEvent(_:parameters:)); /// Sets a user property to a given value. Up to 25 user property names are supported. Once set, /// user property values persist throughout the app lifecycle and across sessions. @@ -59,9 +70,10 @@ NS_ASSUME_NONNULL_BEGIN /// @param value The value of the user property. Values can be up to 36 characters long. Setting the /// value to nil removes the user property. /// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters -/// or underscores and must start with an alphabetic character. The "firebase_" prefix is -/// reserved and should not be used for user property names. -+ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name; +/// or underscores and must start with an alphabetic character. The "firebase_", "google_", and +/// "ga_" prefixes are reserved and should not be used for user property names. ++ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name + FIR_SWIFT_NAME(setUserProperty(_:forName:)); /// Sets the user ID property. This feature must be used in accordance with /// Google's Privacy Policy diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h new file mode 100755 index 000000000..50fbf2e2d --- /dev/null +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h @@ -0,0 +1,13 @@ +#ifndef FIR_SWIFT_NAME + +#import + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h index 3b40eecff..ac4e0abfc 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h @@ -7,12 +7,15 @@ /// Event type. Some common events are suggested below, but you may also choose to specify custom /// Event types that are associated with your specific app. Each event type is identified by a /// unique name. Event names can be up to 40 characters long, may only contain alphanumeric -/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_" -/// prefix is reserved and should not be used. +/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// Add Payment Info event. This event signifies that a user has submitted their payment information /// to your app. -static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; +static NSString *const kFIREventAddPaymentInfo FIR_SWIFT_NAME(AnalyticsEventAddPaymentInfo) = + @"add_payment_info"; /// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for /// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness @@ -34,7 +37,7 @@ static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • /// -static NSString *const kFIREventAddToCart = @"add_to_cart"; +static NSString *const kFIREventAddToCart FIR_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart"; /// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. /// Use this event to identify popular gift items in your app. Note: If you supply the @@ -51,13 +54,14 @@ static NSString *const kFIREventAddToCart = @"add_to_cart"; ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • /// -static NSString *const kFIREventAddToWishlist = @"add_to_wishlist"; +static NSString *const kFIREventAddToWishlist FIR_SWIFT_NAME(AnalyticsEventAddToWishlist) = + @"add_to_wishlist"; /// App Open event. By logging this event when an App is moved to the foreground, developers can /// understand how often users leave and return during the course of a Session. Although Sessions /// are automatically reported, this event can provide further clarification around the continuous /// engagement of app-users. -static NSString *const kFIREventAppOpen = @"app_open"; +static NSString *const kFIREventAppOpen FIR_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open"; /// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of /// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the @@ -81,7 +85,8 @@ static NSString *const kFIREventAppOpen = @"app_open"; ///
  • @c kFIRParameterDestination (NSString) (optional)
  • ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • /// -static NSString *const kFIREventBeginCheckout = @"begin_checkout"; +static NSString *const kFIREventBeginCheckout FIR_SWIFT_NAME(AnalyticsEventBeginCheckout) = + @"begin_checkout"; /// Campaign Detail event. Log this event to supply the referral details of a re-engagement /// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource, @@ -96,7 +101,17 @@ static NSString *const kFIREventBeginCheckout = @"begin_checkout"; ///
  • @c kFIRParameterAdNetworkClickID (NSString) (optional)
  • ///
  • @c kFIRParameterCP1 (NSString) (optional)
  • /// -static NSString *const kFIREventCampaignDetails = @"campaign_details"; +static NSString *const kFIREventCampaignDetails FIR_SWIFT_NAME(AnalyticsEventCampaignDetails) = + @"campaign_details"; + +/// Checkout progress. Params: +/// +///
      +///
    • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
    • +///
    • @c kFIRParameterCheckoutOption (NSString) (optional)
    • +///
    +static NSString *const kFIREventCheckoutProgress FIR_SWIFT_NAME(AnalyticsEventCheckoutProgress) = + @"checkout_progress"; /// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log /// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy. @@ -106,7 +121,8 @@ static NSString *const kFIREventCampaignDetails = @"campaign_details"; ///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • ///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • /// -static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; +static NSString *const kFIREventEarnVirtualCurrency + FIR_SWIFT_NAME(AnalyticsEventEarnVirtualCurrency) = @"earn_virtual_currency"; /// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note: /// This is different from the in-app purchase event, which is reported automatically for App @@ -134,7 +150,8 @@ static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; ///
  • @c kFIRParameterDestination (NSString) (optional)
  • ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • /// -static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; +static NSString *const kFIREventEcommercePurchase FIR_SWIFT_NAME(AnalyticsEventEcommercePurchase) = + @"ecommerce_purchase"; /// Generate Lead event. Log this event when a lead has been generated in the app to understand the /// efficacy of your install and re-engagement campaigns. Note: If you supply the @@ -145,7 +162,8 @@ static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • /// -static NSString *const kFIREventGenerateLead = @"generate_lead"; +static NSString *const kFIREventGenerateLead FIR_SWIFT_NAME(AnalyticsEventGenerateLead) = + @"generate_lead"; /// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use /// this event to analyze how popular certain groups or social features are in your app. Params: @@ -153,7 +171,7 @@ static NSString *const kFIREventGenerateLead = @"generate_lead"; ///
      ///
    • @c kFIRParameterGroupID (NSString)
    • ///
    -static NSString *const kFIREventJoinGroup = @"join_group"; +static NSString *const kFIREventJoinGroup FIR_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group"; /// Level Up event. This event signifies that a player has leveled up in your gaming app. It can /// help you gauge the level distribution of your userbase and help you identify certain levels that @@ -163,11 +181,11 @@ static NSString *const kFIREventJoinGroup = @"join_group"; ///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber)
  • ///
  • @c kFIRParameterCharacter (NSString) (optional)
  • /// -static NSString *const kFIREventLevelUp = @"level_up"; +static NSString *const kFIREventLevelUp FIR_SWIFT_NAME(AnalyticsEventLevelUp) = @"level_up"; /// Login event. Apps with a login feature can report this event to signify that a user has logged /// in. -static NSString *const kFIREventLogin = @"login"; +static NSString *const kFIREventLogin FIR_SWIFT_NAME(AnalyticsEventLogin) = @"login"; /// Post Score event. Log this event when the user posts a score in your gaming app. This event can /// help you understand how users are actually performing in your game and it can help you correlate @@ -178,7 +196,7 @@ static NSString *const kFIREventLogin = @"login"; ///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)
  • ///
  • @c kFIRParameterCharacter (NSString) (optional)
  • /// -static NSString *const kFIREventPostScore = @"post_score"; +static NSString *const kFIREventPostScore FIR_SWIFT_NAME(AnalyticsEventPostScore) = @"post_score"; /// Present Offer event. This event signifies that the app has presented a purchase offer to a user. /// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge @@ -196,7 +214,8 @@ static NSString *const kFIREventPostScore = @"post_score"; ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • /// -static NSString *const kFIREventPresentOffer = @"present_offer"; +static NSString *const kFIREventPresentOffer FIR_SWIFT_NAME(AnalyticsEventPresentOffer) = + @"present_offer"; /// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded. /// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the @@ -208,7 +227,27 @@ static NSString *const kFIREventPresentOffer = @"present_offer"; ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • ///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • /// -static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; +static NSString *const kFIREventPurchaseRefund FIR_SWIFT_NAME(AnalyticsEventPurchaseRefund) = + @"purchase_refund"; + +/// Remove from cart event. Params: +/// +///
      +///
    • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
    • +///
    • @c kFIRParameterItemID (NSString)
    • +///
    • @c kFIRParameterItemName (NSString)
    • +///
    • @c kFIRParameterItemCategory (NSString)
    • +///
    • @c kFIRParameterItemLocationID (NSString) (optional)
    • +///
    • @c kFIRParameterPrice (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterOrigin (NSString) (optional)
    • +///
    • @c kFIRParameterDestination (NSString) (optional)
    • +///
    • @c kFIRParameterStartDate (NSString) (optional)
    • +///
    • @c kFIRParameterEndDate (NSString) (optional)
    • +///
    +static NSString *const kFIREventRemoveFromCart FIR_SWIFT_NAME(AnalyticsEventRemoveFromCart) = + @"remove_from_cart"; /// Search event. Apps that support search features can use this event to contextualize search /// operations by supplying the appropriate, corresponding parameters. This event can help you @@ -228,7 +267,7 @@ static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; ///
  • @c kFIRParameterDestination (NSString) (optional)
  • ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • /// -static NSString *const kFIREventSearch = @"search"; +static NSString *const kFIREventSearch FIR_SWIFT_NAME(AnalyticsEventSearch) = @"search"; /// Select Content event. This general purpose event signifies that a user has selected some content /// of a certain type in an app. The content can be any object in your app. This event can help you @@ -238,7 +277,17 @@ static NSString *const kFIREventSearch = @"search"; ///
  • @c kFIRParameterContentType (NSString)
  • ///
  • @c kFIRParameterItemID (NSString)
  • /// -static NSString *const kFIREventSelectContent = @"select_content"; +static NSString *const kFIREventSelectContent FIR_SWIFT_NAME(AnalyticsEventSelectContent) = + @"select_content"; + +/// Set checkout option. Params: +/// +///
      +///
    • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
    • +///
    • @c kFIRParameterCheckoutOption (NSString)
    • +///
    +static NSString *const kFIREventSetCheckoutOption FIR_SWIFT_NAME(AnalyticsEventSetCheckoutOption) = + @"set_checkout_option"; /// Share event. Apps with social features can log the Share event to identify the most viral /// content. Params: @@ -247,7 +296,7 @@ static NSString *const kFIREventSelectContent = @"select_content"; ///
  • @c kFIRParameterContentType (NSString)
  • ///
  • @c kFIRParameterItemID (NSString)
  • /// -static NSString *const kFIREventShare = @"share"; +static NSString *const kFIREventShare FIR_SWIFT_NAME(AnalyticsEventShare) = @"share"; /// Sign Up event. This event indicates that a user has signed up for an account in your app. The /// parameter signifies the method by which the user signed up. Use this event to understand the @@ -256,7 +305,7 @@ static NSString *const kFIREventShare = @"share"; ///
      ///
    • @c kFIRParameterSignUpMethod (NSString)
    • ///
    -static NSString *const kFIREventSignUp = @"sign_up"; +static NSString *const kFIREventSignUp FIR_SWIFT_NAME(AnalyticsEventSignUp) = @"sign_up"; /// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can /// help you identify which virtual goods are the most popular objects of purchase. Params: @@ -266,17 +315,20 @@ static NSString *const kFIREventSignUp = @"sign_up"; ///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • ///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • /// -static NSString *const kFIREventSpendVirtualCurrency = @"spend_virtual_currency"; +static NSString *const kFIREventSpendVirtualCurrency + FIR_SWIFT_NAME(AnalyticsEventSpendVirtualCurrency) = @"spend_virtual_currency"; /// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use /// this in a funnel with kFIREventTutorialComplete to understand how many users complete this /// process and move on to the full app experience. -static NSString *const kFIREventTutorialBegin = @"tutorial_begin"; +static NSString *const kFIREventTutorialBegin FIR_SWIFT_NAME(AnalyticsEventTutorialBegin) = + @"tutorial_begin"; /// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding /// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your /// on-boarding process. -static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; +static NSString *const kFIREventTutorialComplete FIR_SWIFT_NAME(AnalyticsEventTutorialComplete) = + @"tutorial_complete"; /// Unlock Achievement event. Log this event when the user has unlocked an achievement in your /// game. Since achievements generally represent the breadth of a gaming experience, this event can @@ -285,7 +337,8 @@ static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; ///
      ///
    • @c kFIRParameterAchievementID (NSString)
    • ///
    -static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; +static NSString *const kFIREventUnlockAchievement FIR_SWIFT_NAME(AnalyticsEventUnlockAchievement) = + @"unlock_achievement"; /// View Item event. This event signifies that some content was shown to the user. This content may /// be a product, a webpage or just a simple image or text. Use the appropriate parameters to @@ -317,7 +370,7 @@ static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; ///
  • @c kFIRParameterSearchTerm (NSString) (optional) for travel bookings
  • ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • /// -static NSString *const kFIREventViewItem = @"view_item"; +static NSString *const kFIREventViewItem FIR_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item"; /// View Item List event. Log this event when the user has been presented with a list of items of a /// certain category. Params: @@ -325,7 +378,8 @@ static NSString *const kFIREventViewItem = @"view_item"; ///
      ///
    • @c kFIRParameterItemCategory (NSString)
    • ///
    -static NSString *const kFIREventViewItemList = @"view_item_list"; +static NSString *const kFIREventViewItemList FIR_SWIFT_NAME(AnalyticsEventViewItemList) = + @"view_item_list"; /// View Search Results event. Log this event when the user has been presented with the results of a /// search. Params: @@ -333,4 +387,5 @@ static NSString *const kFIREventViewItemList = @"view_item_list"; ///
      ///
    • @c kFIRParameterSearchTerm (NSString)
    • ///
    -static NSString *const kFIREventViewSearchResults = @"view_search_results"; +static NSString *const kFIREventViewSearchResults FIR_SWIFT_NAME(AnalyticsEventViewSearchResults) = + @"view_search_results"; diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h index a43e3473d..44d60b1cf 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h @@ -7,7 +7,10 @@ /// not limited to these. You may supply extra Params for suggested Events or custom Params for /// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric /// characters and underscores ("_"), and must start with an alphabetic character. Param values can -/// be up to 100 characters long. The "firebase_" prefix is reserved and should not be used. +/// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and +/// should not be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// Game achievement ID (NSString). ///
    @@ -16,7 +19,8 @@
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterAchievementID = @"achievement_id"; +static NSString *const kFIRParameterAchievementID FIR_SWIFT_NAME(AnalyticsParameterAchievementID) = + @"achievement_id"; /// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format. ///
    @@ -25,7 +29,18 @@ static NSString *const kFIRParameterAchievementID = @"achievement_id";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; +static NSString *const kFIRParameterAdNetworkClickID + FIR_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid"; + +/// The store or affiliation from which this transaction occurred (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterAffiliation : @"Google Store",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterAffiliation FIR_SWIFT_NAME(AnalyticsParameterAffiliation) = + @"affiliation"; /// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to /// capture campaign information, otherwise can be populated by developer. Highly Recommended @@ -36,7 +51,8 @@ static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; /// // ... /// }; /// -static NSString *const kFIRParameterCampaign = @"campaign"; +static NSString *const kFIRParameterCampaign FIR_SWIFT_NAME(AnalyticsParameterCampaign) = + @"campaign"; /// Character used in game (NSString). ///
    @@ -45,10 +61,31 @@ static NSString *const kFIRParameterCampaign = @"campaign";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterCharacter = @"character"; +static NSString *const kFIRParameterCharacter FIR_SWIFT_NAME(AnalyticsParameterCharacter) = + @"character"; + +/// The checkout step (1..N) (unsigned 64-bit integer as NSNumber). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterCheckoutStep : @"1",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterCheckoutStep FIR_SWIFT_NAME(AnalyticsParameterCheckoutStep) = + @"checkout_step"; + +/// Some option on a step in an ecommerce flow (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterCheckoutOption : @"Visa",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterCheckoutOption + FIR_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option"; /// Campaign content (NSString). -static NSString *const kFIRParameterContent = @"content"; +static NSString *const kFIRParameterContent FIR_SWIFT_NAME(AnalyticsParameterContent) = @"content"; /// Type of content selected (NSString). ///
    @@ -57,7 +94,8 @@ static NSString *const kFIRParameterContent = @"content";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterContentType = @"content_type"; +static NSString *const kFIRParameterContentType FIR_SWIFT_NAME(AnalyticsParameterContentType) = + @"content_type"; /// Coupon code for a purchasable item (NSString). ///
    @@ -66,7 +104,7 @@ static NSString *const kFIRParameterContentType = @"content_type";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterCoupon = @"coupon"; +static NSString *const kFIRParameterCoupon FIR_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon"; /// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign. /// Use varies by network. @@ -76,7 +114,27 @@ static NSString *const kFIRParameterCoupon = @"coupon"; /// // ... /// }; /// -static NSString *const kFIRParameterCP1 = @"cp1"; +static NSString *const kFIRParameterCP1 FIR_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1"; + +/// The name of a creative used in a promotional spot (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterCreativeName : @"Summer Sale",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterCreativeName FIR_SWIFT_NAME(AnalyticsParameterCreativeName) = + @"creative_name"; + +/// The name of a creative slot (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterCreativeSlot : @"summer_banner2",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterCreativeSlot FIR_SWIFT_NAME(AnalyticsParameterCreativeSlot) = + @"creative_slot"; /// Purchase currency in 3-letter /// ISO_4217 format (NSString). @@ -86,7 +144,8 @@ static NSString *const kFIRParameterCP1 = @"cp1"; /// // ... /// }; /// -static NSString *const kFIRParameterCurrency = @"currency"; +static NSString *const kFIRParameterCurrency FIR_SWIFT_NAME(AnalyticsParameterCurrency) = + @"currency"; /// Flight or Travel destination (NSString). ///
    @@ -95,7 +154,8 @@ static NSString *const kFIRParameterCurrency = @"currency";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterDestination = @"destination"; +static NSString *const kFIRParameterDestination FIR_SWIFT_NAME(AnalyticsParameterDestination) = + @"destination"; /// The arrival date, check-out date or rental end date for the item. This should be in /// YYYY-MM-DD format (NSString). @@ -105,7 +165,7 @@ static NSString *const kFIRParameterDestination = @"destination"; /// // ... /// }; /// -static NSString *const kFIRParameterEndDate = @"end_date"; +static NSString *const kFIRParameterEndDate FIR_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date"; /// Flight number for travel events (NSString). ///
    @@ -114,7 +174,8 @@ static NSString *const kFIRParameterEndDate = @"end_date";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterFlightNumber = @"flight_number"; +static NSString *const kFIRParameterFlightNumber FIR_SWIFT_NAME(AnalyticsParameterFlightNumber) = + @"flight_number"; /// Group/clan/guild ID (NSString). ///
    @@ -123,7 +184,26 @@ static NSString *const kFIRParameterFlightNumber = @"flight_number";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterGroupID = @"group_id"; +static NSString *const kFIRParameterGroupID FIR_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id"; + +/// Index of an item in a list (signed 64-bit integer as NSNumber). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterIndex : @(1),
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterIndex FIR_SWIFT_NAME(AnalyticsParameterIndex) = @"index"; + +/// Item brand (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemBrand : @"Google",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemBrand FIR_SWIFT_NAME(AnalyticsParameterItemBrand) = + @"item_brand"; /// Item category (NSString). ///
    @@ -132,7 +212,8 @@ static NSString *const kFIRParameterGroupID = @"group_id";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterItemCategory = @"item_category"; +static NSString *const kFIRParameterItemCategory FIR_SWIFT_NAME(AnalyticsParameterItemCategory) = + @"item_category"; /// Item ID (NSString). ///
    @@ -141,7 +222,7 @@ static NSString *const kFIRParameterItemCategory = @"item_category";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterItemID = @"item_id"; +static NSString *const kFIRParameterItemID FIR_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id"; /// The Google Place ID (NSString) that /// corresponds to the associated item. Alternatively, you can supply your own custom Location ID. @@ -151,7 +232,8 @@ static NSString *const kFIRParameterItemID = @"item_id"; /// // ... /// }; /// -static NSString *const kFIRParameterItemLocationID = @"item_location_id"; +static NSString *const kFIRParameterItemLocationID + FIR_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id"; /// Item name (NSString). ///
    @@ -160,7 +242,28 @@ static NSString *const kFIRParameterItemLocationID = @"item_location_id";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterItemName = @"item_name"; +static NSString *const kFIRParameterItemName FIR_SWIFT_NAME(AnalyticsParameterItemName) = + @"item_name"; + +/// The list in which the item was presented to the user (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemList : @"Search Results",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemList FIR_SWIFT_NAME(AnalyticsParameterItemList) = + @"item_list"; + +/// Item variant (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemVariant : @"Red",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemVariant FIR_SWIFT_NAME(AnalyticsParameterItemVariant) = + @"item_variant"; /// Level in game (signed 64-bit integer as NSNumber). ///
    @@ -169,7 +272,7 @@ static NSString *const kFIRParameterItemName = @"item_name";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterLevel = @"level"; +static NSString *const kFIRParameterLevel FIR_SWIFT_NAME(AnalyticsParameterLevel) = @"level"; /// Location (NSString). The Google Place ID /// that corresponds to the associated event. Alternatively, you can supply your own custom @@ -180,7 +283,8 @@ static NSString *const kFIRParameterLevel = @"level"; /// // ... /// }; /// -static NSString *const kFIRParameterLocation = @"location"; +static NSString *const kFIRParameterLocation FIR_SWIFT_NAME(AnalyticsParameterLocation) = + @"location"; /// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended /// (NSString). @@ -190,7 +294,7 @@ static NSString *const kFIRParameterLocation = @"location"; /// // ... /// }; /// -static NSString *const kFIRParameterMedium = @"medium"; +static NSString *const kFIRParameterMedium FIR_SWIFT_NAME(AnalyticsParameterMedium) = @"medium"; /// Number of nights staying at hotel (signed 64-bit integer as NSNumber). ///
    @@ -199,7 +303,8 @@ static NSString *const kFIRParameterMedium = @"medium";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterNumberOfNights = @"number_of_nights"; +static NSString *const kFIRParameterNumberOfNights + FIR_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights"; /// Number of passengers traveling (signed 64-bit integer as NSNumber). ///
    @@ -208,7 +313,8 @@ static NSString *const kFIRParameterNumberOfNights = @"number_of_nights";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"; +static NSString *const kFIRParameterNumberOfPassengers + FIR_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers"; /// Number of rooms for travel events (signed 64-bit integer as NSNumber). ///
    @@ -217,7 +323,8 @@ static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms"; +static NSString *const kFIRParameterNumberOfRooms FIR_SWIFT_NAME(AnalyticsParameterNumberOfRooms) = + @"number_of_rooms"; /// Flight or Travel origin (NSString). ///
    @@ -226,7 +333,7 @@ static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterOrigin = @"origin"; +static NSString *const kFIRParameterOrigin FIR_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin"; /// Purchase price (double as NSNumber). ///
    @@ -236,7 +343,7 @@ static NSString *const kFIRParameterOrigin = @"origin";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterPrice = @"price"; +static NSString *const kFIRParameterPrice FIR_SWIFT_NAME(AnalyticsParameterPrice) = @"price"; /// Purchase quantity (signed 64-bit integer as NSNumber). ///
    @@ -245,7 +352,8 @@ static NSString *const kFIRParameterPrice = @"price";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterQuantity = @"quantity"; +static NSString *const kFIRParameterQuantity FIR_SWIFT_NAME(AnalyticsParameterQuantity) = + @"quantity"; /// Score in game (signed 64-bit integer as NSNumber). ///
    @@ -254,7 +362,7 @@ static NSString *const kFIRParameterQuantity = @"quantity";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterScore = @"score"; +static NSString *const kFIRParameterScore FIR_SWIFT_NAME(AnalyticsParameterScore) = @"score"; /// The search string/keywords used (NSString). ///
    @@ -263,7 +371,8 @@ static NSString *const kFIRParameterScore = @"score";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterSearchTerm = @"search_term"; +static NSString *const kFIRParameterSearchTerm FIR_SWIFT_NAME(AnalyticsParameterSearchTerm) = + @"search_term"; /// Shipping cost (double as NSNumber). ///
    @@ -273,7 +382,8 @@ static NSString *const kFIRParameterSearchTerm = @"search_term";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterShipping = @"shipping"; +static NSString *const kFIRParameterShipping FIR_SWIFT_NAME(AnalyticsParameterShipping) = + @"shipping"; /// Sign up method (NSString). ///
    @@ -282,7 +392,8 @@ static NSString *const kFIRParameterShipping = @"shipping";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; +static NSString *const kFIRParameterSignUpMethod FIR_SWIFT_NAME(AnalyticsParameterSignUpMethod) = + @"sign_up_method"; /// The origin of your traffic, such as an Ad network (for example, google) or partner (urban /// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your @@ -293,7 +404,7 @@ static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; /// // ... /// }; /// -static NSString *const kFIRParameterSource = @"source"; +static NSString *const kFIRParameterSource FIR_SWIFT_NAME(AnalyticsParameterSource) = @"source"; /// The departure date, check-in date or rental start date for the item. This should be in /// YYYY-MM-DD format (NSString). @@ -303,7 +414,8 @@ static NSString *const kFIRParameterSource = @"source"; /// // ... /// }; /// -static NSString *const kFIRParameterStartDate = @"start_date"; +static NSString *const kFIRParameterStartDate FIR_SWIFT_NAME(AnalyticsParameterStartDate) = + @"start_date"; /// Tax amount (double as NSNumber). ///
    @@ -313,7 +425,7 @@ static NSString *const kFIRParameterStartDate = @"start_date";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterTax = @"tax"; +static NSString *const kFIRParameterTax FIR_SWIFT_NAME(AnalyticsParameterTax) = @"tax"; /// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword /// (NSString). @@ -323,7 +435,7 @@ static NSString *const kFIRParameterTax = @"tax"; /// // ... /// }; /// -static NSString *const kFIRParameterTerm = @"term"; +static NSString *const kFIRParameterTerm FIR_SWIFT_NAME(AnalyticsParameterTerm) = @"term"; /// A single ID for a ecommerce group transaction (NSString). ///
    @@ -332,7 +444,8 @@ static NSString *const kFIRParameterTerm = @"term";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterTransactionID = @"transaction_id"; +static NSString *const kFIRParameterTransactionID FIR_SWIFT_NAME(AnalyticsParameterTransactionID) = + @"transaction_id"; /// Travel class (NSString). ///
    @@ -341,7 +454,8 @@ static NSString *const kFIRParameterTransactionID = @"transaction_id";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterTravelClass = @"travel_class"; +static NSString *const kFIRParameterTravelClass FIR_SWIFT_NAME(AnalyticsParameterTravelClass) = + @"travel_class"; /// A context-specific numeric value which is accumulated automatically for each event type. This is /// a general purpose parameter that is useful for accumulating a key metric that pertains to an @@ -349,7 +463,10 @@ static NSString *const kFIRParameterTravelClass = @"travel_class"; /// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events /// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be /// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is -/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. +/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the +/// corresponding @c kFIRParameterCurrency parameter, or supplying an invalid +/// currency code for conversion events will cause that +/// conversion to be omitted from reporting. ///
     ///     NSDictionary *params = @{
     ///       kFIRParameterValue : @(3.99),
    @@ -357,7 +474,7 @@ static NSString *const kFIRParameterTravelClass = @"travel_class";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterValue = @"value"; +static NSString *const kFIRParameterValue FIR_SWIFT_NAME(AnalyticsParameterValue) = @"value"; /// Name of virtual currency type (NSString). ///
    @@ -366,4 +483,5 @@ static NSString *const kFIRParameterValue = @"value";
     ///       // ...
     ///     };
     /// 
    -static NSString *const kFIRParameterVirtualCurrencyName = @"virtual_currency_name"; +static NSString *const kFIRParameterVirtualCurrencyName + FIR_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name"; diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h index 54cf1c201..a22863546 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h @@ -7,7 +7,11 @@ /// unique UserProperties per app, and you can use the name and value of your choosing for each one. /// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and /// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to -/// 36 characters long. The "firebase_" prefix is reserved and should not be used. +/// 36 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not +/// be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// The method used to sign in. For example, "google", "facebook" or "twitter". -static NSString *const kFIRUserPropertySignUpMethod = @"sign_up_method"; +static NSString *const kFIRUserPropertySignUpMethod + FIR_SWIFT_NAME(AnalyticsUserPropertySignUpMethod) = @"sign_up_method"; diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h index 3142c97bb..e1e96f6df 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h @@ -4,6 +4,7 @@ #import "FIROptions.h" #import "FIRAnalytics+AppDelegate.h" #import "FIRAnalytics.h" +#import "FIRAnalyticsSwiftNameSupport.h" #import "FIREventNames.h" #import "FIRParameterNames.h" #import "FIRUserPropertyNames.h" diff --git a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap index c9bd66bc0..6394d59ee 100755 --- a/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap +++ b/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap @@ -4,7 +4,5 @@ framework module FirebaseAnalytics { module * { export *} link "sqlite3" link "z" - link framework "CoreGraphics" - link framework "Foundation" link framework "UIKit" } \ No newline at end of file diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore b/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore index 364c6d67d..f936ba4f8 100755 Binary files a/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore and b/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore differ diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h index 667d5a4be..f42eaf547 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h @@ -1,14 +1,35 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import +#import "FIRCoreSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + /** * This class provides configuration fields for Firebase Analytics. */ +FIR_SWIFT_NAME(AnalyticsConfiguration) @interface FIRAnalyticsConfiguration : NSObject /** * Returns the shared instance of FIRAnalyticsConfiguration. */ -+ (FIRAnalyticsConfiguration *)sharedInstance; ++ (FIRAnalyticsConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); /** * Sets the minimum engagement time in seconds required to start a new session. The default value @@ -28,11 +49,6 @@ */ - (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; -/** - * Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By - * default they are enabled. - */ -- (void)setIsEnabled:(BOOL)isEnabled - DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead."); - @end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h index 263c4beff..7f1d0c7f7 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h @@ -1,12 +1,30 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import #import +#import "FIRCoreSwiftNameSupport.h" + @class FIROptions; NS_ASSUME_NONNULL_BEGIN /** A block that takes a BOOL and has no return value. */ -typedef void (^FIRAppVoidBoolCallback)(BOOL success); +typedef void (^FIRAppVoidBoolCallback)(BOOL success) FIR_SWIFT_NAME(FirebaseAppVoidBoolCallback); /** * The entry point of Firebase SDKs. @@ -26,6 +44,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); * It is also possible to change the default logging level in code by calling setLoggerLevel: on * the FIRConfiguration interface. */ +FIR_SWIFT_NAME(FirebaseApp) @interface FIRApp : NSObject /** @@ -42,7 +61,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); * * @param options The Firebase application options used to configure the service. */ -+ (void)configureWithOptions:(FIROptions *)options; ++ (void)configureWithOptions:(FIROptions *)options FIR_SWIFT_NAME(configure(options:)); /** * Configures a Firebase app with the given name and options. Raises an exception if any @@ -52,24 +71,33 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); Letters, Numbers and Underscore. * @param options The Firebase application options used to configure the services. */ -+ (void)configureWithName:(NSString *)name options:(FIROptions *)options; ++ (void)configureWithName:(NSString *)name options:(FIROptions *)options + FIR_SWIFT_NAME(configure(name:options:)); /** * Returns the default app, or nil if the default app does not exist. */ -+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp()); ++ (nullable FIRApp *)defaultApp FIR_SWIFT_NAME(app()); /** * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. * This method is thread safe. */ -+ (nullable FIRApp *)appNamed:(NSString *)name; ++ (nullable FIRApp *)appNamed:(NSString *)name FIR_SWIFT_NAME(app(name:)); +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This + * method is thread safe. + */ +@property(class, readonly, nullable) NSDictionary *allApps; +#else /** * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This * method is thread safe. */ -+ (nullable NSDictionary *)allApps; ++ (nullable NSDictionary *)allApps FIR_SWIFT_NAME(allApps()); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for @@ -89,9 +117,9 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); @property(nonatomic, copy, readonly) NSString *name; /** - * Gets the options for this app. + * Gets a copy of the options for this app. These are non-modifiable. */ -@property(nonatomic, readonly) FIROptions *options; +@property(nonatomic, copy, readonly) FIROptions *options; @end diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h index a25647b46..496b21188 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h @@ -1,6 +1,23 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import #import "FIRAnalyticsConfiguration.h" +#import "FIRCoreSwiftNameSupport.h" #import "FIRLoggerLevel.h" /** @@ -22,14 +39,23 @@ typedef NS_ENUM(NSInteger, FIRLogLevel) { } DEPRECATED_MSG_ATTRIBUTE( "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); +NS_ASSUME_NONNULL_BEGIN + /** * This interface provides global level properties that the developer can tweak, and the singleton * of the Firebase Analytics configuration class. */ +FIR_SWIFT_NAME(FirebaseConfiguration) @interface FIRConfiguration : NSObject + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** Returns the shared configuration object. */ -+ (FIRConfiguration *)sharedInstance; +@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance FIR_SWIFT_NAME(shared); +#else +/** Returns the shared configuration object. */ ++ (FIRConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** The configuration class for Firebase Analytics. */ @property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; @@ -50,3 +76,5 @@ typedef NS_ENUM(NSInteger, FIRLogLevel) { - (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; @end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h new file mode 100755 index 000000000..f58bdd783 --- /dev/null +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h @@ -0,0 +1,29 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIR_SWIFT_NAME + +#import + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// // Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h index ddf683f78..fe0d47d97 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h @@ -1,3 +1,21 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRCoreSwiftNameSupport.h" + /** * The log levels used by internal logging. */ @@ -9,4 +27,4 @@ typedef NS_ENUM(NSInteger, FIRLoggerLevel) { FIRLoggerLevelDebug = 7 /*ASL_LEVEL_DEBUG*/, FIRLoggerLevelMin = FIRLoggerLevelError, FIRLoggerLevelMax = FIRLoggerLevelDebug -}; +} FIR_SWIFT_NAME(FirebaseLoggerLevel); diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h index 083082abd..5bae59cd6 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h @@ -1,69 +1,95 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import +#import "FIRCoreSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + /** * This class provides constant fields of Google APIs. */ +FIR_SWIFT_NAME(FirebaseOptions) @interface FIROptions : NSObject /** * Returns the default options. */ -+ (FIROptions *)defaultOptions; ++ (nullable FIROptions *)defaultOptions FIR_SWIFT_NAME(defaultOptions()); /** * An iOS API key used for authenticating requests from your app, e.g. * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. */ -@property(nonatomic, readonly, copy) NSString *APIKey; +@property(nonatomic, copy, nullable) NSString *APIKey FIR_SWIFT_NAME(apiKey); + +/** + * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set + * manually or in a plist. + */ +@property(nonatomic, copy) NSString *bundleID; /** * The OAuth2 client ID for iOS application used to authenticate Google users, for example * @"12345.apps.googleusercontent.com", used for signing in with Google. */ -@property(nonatomic, readonly, copy) NSString *clientID; +@property(nonatomic, copy, nullable) NSString *clientID; /** * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. */ -@property(nonatomic, readonly, copy) NSString *trackingID; +@property(nonatomic, copy, nullable) NSString *trackingID; /** * The Project Number from the Google Developer's console, for example @"012345678901", used to * configure Google Cloud Messaging. */ -@property(nonatomic, readonly, copy) NSString *GCMSenderID; +@property(nonatomic, copy) NSString *GCMSenderID FIR_SWIFT_NAME(gcmSenderID); /** - * The Project ID from the Firebase console, for example @"abc-xyz-123". Currently only populated - * when using [FIROptions defaultOptions]. + * The Project ID from the Firebase console, for example @"abc-xyz-123". */ -@property(nonatomic, readonly, copy) NSString *projectID; +@property(nonatomic, copy, nullable) NSString *projectID; /** * The Android client ID used in Google AppInvite when an iOS app has its Android version, for * example @"12345.apps.googleusercontent.com". */ -@property(nonatomic, readonly, copy) NSString *androidClientID; +@property(nonatomic, copy, nullable) NSString *androidClientID; /** * The Google App ID that is used to uniquely identify an instance of an app. */ -@property(nonatomic, readonly, copy) NSString *googleAppID; +@property(nonatomic, copy) NSString *googleAppID; /** * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". */ -@property(nonatomic, readonly, copy) NSString *databaseURL; +@property(nonatomic, copy, nullable) NSString *databaseURL; /** * The URL scheme used to set up Durable Deep Link service. */ -@property(nonatomic, readwrite, copy) NSString *deepLinkURLScheme; +@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; /** * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". */ -@property(nonatomic, readonly, copy) NSString *storageBucket; +@property(nonatomic, copy, nullable) NSString *storageBucket; /** * Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID @@ -78,7 +104,9 @@ androidClientID:(NSString *)androidClientID databaseURL:(NSString *)databaseURL storageBucket:(NSString *)storageBucket - deepLinkURLScheme:(NSString *)deepLinkURLScheme; + deepLinkURLScheme:(NSString *)deepLinkURLScheme + DEPRECATED_MSG_ATTRIBUTE("Use `-[FIROptions initWithGoogleAppID:gcmSenderID:]` and " + "properties instead."); /** * Initializes a customized instance of FIROptions from the file at the given plist file path. @@ -88,6 +116,16 @@ * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; * Returns nil if the plist file does not exist or is invalid. */ -- (instancetype)initWithContentsOfFile:(NSString *)plistPath; +- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath; + +/** + * Initializes a customized instance of FIROptions with required fields. Use the mutable properties + * to modify fields for configuring specific services. + */ +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID + GCMSenderID:(NSString *)GCMSenderID + FIR_SWIFT_NAME(init(googleAppID:gcmSenderID:)); @end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h index 52a222f59..20816292e 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h @@ -1,5 +1,6 @@ #import "FIRAnalyticsConfiguration.h" #import "FIRApp.h" #import "FIRConfiguration.h" +#import "FIRCoreSwiftNameSupport.h" #import "FIRLoggerLevel.h" #import "FIROptions.h" diff --git a/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap b/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap index f3db90d83..440f052c6 100755 --- a/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap +++ b/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap @@ -3,6 +3,4 @@ framework module FirebaseCore { export * module * { export *} link "z" - link framework "Foundation" - link framework "UIKit" } \ No newline at end of file diff --git a/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics b/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics new file mode 100755 index 000000000..e97d250db Binary files /dev/null and b/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics differ diff --git a/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/Modules/module.modulemap b/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/Modules/module.modulemap new file mode 100644 index 000000000..5855789c2 --- /dev/null +++ b/src/ios/Firebase/Analytics/FirebaseCoreDiagnostics.framework/Modules/module.modulemap @@ -0,0 +1,5 @@ +framework module FirebaseCoreDiagnostics { + export * + module * { export *} + link "z" +} \ No newline at end of file diff --git a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID index 2ebc6e68b..8bde6c145 100755 Binary files a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID and b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID differ diff --git a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h index 5ff8372e1..4b3c546c3 100755 --- a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h +++ b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h @@ -1,12 +1,35 @@ #import +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + /** * @memberof FIRInstanceID * * The scope to be used when fetching/deleting a token for Firebase Messaging. */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging; +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging + FIR_SWIFT_NAME(InstanceIDScopeFirebaseMessaging); +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Called when the system determines that tokens need to be refreshed. + * This method is also called if Instance ID has been reset in which + * case, tokens and FCM topic subscriptions also need to be refreshed. + * + * Instance ID service will throttle the refresh event across all devices + * to control the rate of token updates on application servers. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull kFIRInstanceIDTokenRefreshNotification + FIR_SWIFT_NAME(InstanceIDTokenRefresh); +#else /** * Called when the system determines that tokens need to be refreshed. * This method is also called if Instance ID has been reset in which @@ -15,7 +38,9 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessagin * Instance ID service will throttle the refresh event across all devices * to control the rate of token updates on application servers. */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification; +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification + FIR_SWIFT_NAME(InstanceIDTokenRefreshNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * @related FIRInstanceID @@ -29,7 +54,8 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotificat * failed. See the error codes below for a more detailed * description. */ -typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error); +typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDTokenHandler); /** @@ -41,7 +67,8 @@ typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * * @param error The error describing why deleting the token failed. * See the error codes below for a more detailed description. */ -typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); +typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDDeleteTokenHandler); /** * @related FIRInstanceID @@ -53,7 +80,8 @@ typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); * while creating an identity. * @param error The error if fetching the identity fails else nil. */ -typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error); +typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDHandler); /** * @related FIRInstanceID @@ -64,7 +92,8 @@ typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __ * @param error The error if deleting the identity and all the tokens associated with * it fails else nil. */ -typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error); +typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDDeleteHandler); /** * @enum FIRInstanceIDError @@ -93,7 +122,7 @@ typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { /// InvalidRequest -- Some parameters of the request were invalid. FIRInstanceIDErrorInvalidRequest = 7, -}; +} FIR_SWIFT_NAME(InstanceIDError); /** * The APNS token type for the app. If the token type is set to `UNKNOWN` @@ -107,11 +136,12 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { FIRInstanceIDAPNSTokenTypeSandbox, /// Production token type. FIRInstanceIDAPNSTokenTypeProd, -}; +} FIR_SWIFT_NAME(InstanceIDAPNSTokenType) + __deprecated_enum_msg("Use FIRMessaging's APNSToken property instead."); /** * Instance ID provides a unique identifier for each app instance and a mechanism - * to authenticate and authorize actions (for example, sending a GCM message). + * to authenticate and authorize actions (for example, sending an FCM message). * * Instance ID is long lived but, may be reset if the device is not used for * a long time or the Instance ID service detects a problem. @@ -124,6 +154,7 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * services associated with the app, call * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. */ +FIR_SWIFT_NAME(InstanceID) @interface FIRInstanceID : NSObject /** @@ -131,7 +162,7 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * * @return A shared instance of FIRInstanceID. */ -+ (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID()); ++ (nonnull instancetype)instanceID FIR_SWIFT_NAME(instanceID()); /** * Unavailable. Use +instanceID instead. @@ -149,7 +180,8 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * @param type The APNS token type for the above token. */ - (void)setAPNSToken:(nonnull NSData *)token - type:(FIRInstanceIDAPNSTokenType)type; + type:(FIRInstanceIDAPNSTokenType)type + __deprecated_msg("Use FIRMessaging's APNSToken property instead."); #pragma mark - Tokens @@ -235,11 +267,13 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * a valid identifier is returned and a valid identifier for the * application instance. */ -- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler; +- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler + FIR_SWIFT_NAME(getID(handler:)); /** * Resets Instance ID and revokes all tokens. */ -- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler; +- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler + FIR_SWIFT_NAME(deleteID(handler:)); @end diff --git a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap index 267c03568..c10be0320 100755 --- a/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap +++ b/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap @@ -2,6 +2,5 @@ framework module FirebaseInstanceID { umbrella header "FirebaseInstanceID.h" export * module * { export *} - link framework "Foundation" - link framework "UIKit" + link "z" } \ No newline at end of file diff --git a/src/ios/Firebase/Analytics/FirebaseNanoPB.framework/FirebaseNanoPB b/src/ios/Firebase/Analytics/FirebaseNanoPB.framework/FirebaseNanoPB new file mode 100755 index 000000000..1e1c41673 Binary files /dev/null and b/src/ios/Firebase/Analytics/FirebaseNanoPB.framework/FirebaseNanoPB differ diff --git a/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac b/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac index 345b889cf..ca5817b29 100644 Binary files a/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac and b/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac differ diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/FirebaseAuth b/src/ios/Firebase/Auth/FirebaseAuth.framework/FirebaseAuth new file mode 100755 index 000000000..6d924af79 Binary files /dev/null and b/src/ios/Firebase/Auth/FirebaseAuth.framework/FirebaseAuth differ diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h new file mode 100755 index 000000000..6e9ba8ea9 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAdditionalUserInfo.h @@ -0,0 +1,50 @@ +/** @file FIRAdditionalUserInfo.h + @brief Firebase Auth SDK + @copyright Copyright 2017 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRVerifyAssertionResponse; + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIRAdditionalUserInfo + @brief Represents additional user data returned from an identity provider. + */ +FIR_SWIFT_NAME(AdditionalUserInfo) +@interface FIRAdditionalUserInfo : NSObject + +/** @fn init + @brief This class should not be initialized manually. @c FIRAdditionalUserInfo can be retrieved + from @c FIRAuthDataResult . + */ +- (instancetype)init NS_UNAVAILABLE; + +/** @property providerID + @brief The provider identifier. + */ +@property(nonatomic, readonly) NSString *providerID; + +/** @property profile + @brief profile Dictionary containing the additional IdP specific information. + */ +@property(nonatomic, readonly, nullable) NSDictionary *profile; + +/** @property username + @brief username The name of the user. + */ +@property(nonatomic, readonly, nullable) NSString *username; + +/** @property newUser + @brief Indicates whether or not the current user was signed in for the first time. + */ +@property(nonatomic, readonly, getter=isNewUser) BOOL newUser; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuth.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuth.h new file mode 100755 index 000000000..6f5969d22 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuth.h @@ -0,0 +1,603 @@ +/** @file FIRAuth.h + @brief Firebase Auth SDK + @copyright Copyright 2015 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthAPNSTokenType.h" +#import "FIRAuthErrors.h" +#import "FIRAuthSwiftNameSupport.h" + +@class FIRApp; +@class FIRAuth; +@class FIRAuthCredential; +@class FIRAuthDataResult; +@class FIRUser; +@protocol FIRAuthStateListener; + +NS_ASSUME_NONNULL_BEGIN + +/** @typedef FIRAuthStateDidChangeListenerHandle + @brief The type of handle returned by @c FIRAuth.addAuthStateDidChangeListener:. + */ +typedef id FIRAuthStateDidChangeListenerHandle + FIR_SWIFT_NAME(AuthStateDidChangeListenerHandle); + +/** @typedef FIRAuthStateDidChangeListenerBlock + @brief The type of block which can be registered as a listener for auth state did change events. + + @param auth The FIRAuth object on which state changes occurred. + @param user Optionally; the current signed in user, if any. + */ +typedef void(^FIRAuthStateDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user) + FIR_SWIFT_NAME(AuthStateDidChangeListenerBlock); + +/** @typedef FIRIDTokenDidChangeListenerHandle + @brief The type of handle returned by @c FIRAuth.addIDTokenDidChangeListener:. + */ +typedef id FIRIDTokenDidChangeListenerHandle + FIR_SWIFT_NAME(IDTokenDidChangeListenerHandle); + +/** @typedef FIRIDTokenDidChangeListenerBlock + @brief The type of block which can be registered as a listener for ID token did change events. + + @param auth The FIRAuth object on which ID token changes occurred. + @param user Optionally; the current signed in user, if any. + */ +typedef void(^FIRIDTokenDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user) + FIR_SWIFT_NAME(IDTokenDidChangeListenerBlock); + +/** @typedef FIRAuthDataResultCallback + @brief The type of block invoked when sign-in related events complete. + + @param authResult Optionally; Result of sign-in request containing @c FIRUser and + @c FIRAdditionalUserInfo. + @param error Optionally; the error which occurred - or nil if the request was successful. + */ +typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult, + NSError *_Nullable error) + FIR_SWIFT_NAME(AuthDataResultCallback); + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + @brief The name of the @c NSNotificationCenter notification which is posted when the auth state + changes (for example, a new token has been produced, a user signs in or signs out). The + object parameter of the notification is the sender @c FIRAuth instance. + */ +extern const NSNotificationName FIRAuthStateDidChangeNotification + FIR_SWIFT_NAME(AuthStateDidChange); +#else +/** + @brief The name of the @c NSNotificationCenter notification which is posted when the auth state + changes (for example, a new token has been produced, a user signs in or signs out). The + object parameter of the notification is the sender @c FIRAuth instance. + */ +extern NSString *const FIRAuthStateDidChangeNotification + FIR_SWIFT_NAME(AuthStateDidChangeNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 + +/** @typedef FIRAuthResultCallback + @brief The type of block invoked when sign-in related events complete. + + @param user Optionally; the signed in user, if any. + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error) + FIR_SWIFT_NAME(AuthResultCallback); + +/** @typedef FIRProviderQueryCallback + @brief The type of block invoked when a list of identity providers for a given email address is + requested. + + @param providers Optionally; a list of provider identifiers, if any. + @see FIRGoogleAuthProviderID etc. + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRProviderQueryCallback)(NSArray *_Nullable providers, + NSError *_Nullable error) + FIR_SWIFT_NAME(ProviderQueryCallback); + +/** @typedef FIRSendPasswordResetCallback + @brief The type of block invoked when sending a password reset email. + + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRSendPasswordResetCallback)(NSError *_Nullable error) + FIR_SWIFT_NAME(SendPasswordResetCallback); + +/** @typedef FIRConfirmPasswordResetCallback + @brief The type of block invoked when performing a password reset. + + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error) + FIR_SWIFT_NAME(ConfirmPasswordResetCallback); + +/** @typedef FIRVerifyPasswordResetCodeCallback + @brief The type of block invoked when verifying that an out of band code should be used to + perform password reset. + + @param email Optionally; the email address of the user for which the out of band code applies. + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email, + NSError *_Nullable error) + FIR_SWIFT_NAME(VerifyPasswordResetCodeCallback); + +/** @typedef FIRApplyActionCodeCallback + @brief The type of block invoked when applying an action code. + + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRApplyActionCodeCallback)(NSError *_Nullable error) + FIR_SWIFT_NAME(ApplyActionCodeCallback); + +/** + @brief Keys used to retrieve operation data from a @c FIRActionCodeInfo object by the @c + dataForKey method. + */ +typedef NS_ENUM(NSInteger, FIRActionDataKey) { + /** + * The email address to which the code was sent. + * For FIRActionCodeOperationRecoverEmail, the new email address for the account. + */ + FIRActionCodeEmailKey = 0, + + /** For FIRActionCodeOperationRecoverEmail, the current email address for the account. */ + FIRActionCodeFromEmailKey = 1 +} FIR_SWIFT_NAME(ActionDataKey); + +/** @class FIRActionCodeInfo + @brief Manages information regarding action codes. + */ +FIR_SWIFT_NAME(ActionCodeInfo) +@interface FIRActionCodeInfo : NSObject + +/** + @brief Operations which can be performed with action codes. + */ +typedef NS_ENUM(NSInteger, FIRActionCodeOperation) { + /** Action code for unknown operation. */ + FIRActionCodeOperationUnknown = 0, + + /** Action code for password reset operation. */ + FIRActionCodeOperationPasswordReset = 1, + + /** Action code for verify email operation. */ + FIRActionCodeOperationVerifyEmail = 2 +} FIR_SWIFT_NAME(ActionCodeOperation); + +/** + @brief The operation being performed. + */ +@property(nonatomic, readonly) FIRActionCodeOperation operation; + +/** @fn dataForKey: + @brief The operation being performed. + + @param key The FIRActionDataKey value used to retrieve the operation data. + + @return The operation data pertaining to the provided action code key. + */ +- (NSString *)dataForKey:(FIRActionDataKey)key; + +/** @fn init + @brief please use initWithOperation: instead. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +/** @typedef FIRCheckActionCodeCallBack + @brief The type of block invoked when performing a check action code operation. + + @param info Metadata corresponding to the action code. + @param error Optionally; if an error occurs, this is the NSError object that describes the + problem. Set to nil otherwise. + */ +typedef void (^FIRCheckActionCodeCallBack)(FIRActionCodeInfo *_Nullable info, + NSError *_Nullable error) + FIR_SWIFT_NAME(CheckActionCodeCallback); + +/** @class FIRAuth + @brief Manages authentication for Firebase apps. + @remarks This class is thread-safe. + */ +FIR_SWIFT_NAME(Auth) +@interface FIRAuth : NSObject + +/** @fn auth + @brief Gets the auth object for the default Firebase app. + @remarks The default Firebase app must have already been configured or an exception will be + raised. + */ ++ (FIRAuth *)auth FIR_SWIFT_NAME(auth()); + +/** @fn authWithApp: + @brief Gets the auth object for a @c FIRApp. + + @param app The FIRApp for which to retrieve the associated FIRAuth instance. + @return The FIRAuth instance associated with the given FIRApp. + */ ++ (FIRAuth *)authWithApp:(FIRApp *)app FIR_SWIFT_NAME(auth(app:)); + +/** @property app + @brief Gets the @c FIRApp object that this auth object is connected to. + */ +@property(nonatomic, weak, readonly, nullable) FIRApp *app; + +/** @property currentUser + @brief Synchronously gets the cached current user, or null if there is none. + */ +@property(nonatomic, strong, readonly, nullable) FIRUser *currentUser; + +/** @property APNSToken + @brief The APNs token used for phone number authentication. The type of the token (production + or sandbox) will be attempted to be automatcially detected. + @remarks If swizzling is disabled, the APNs Token must be set for phone number auth to work, + by either setting this property or by calling @c setAPNSToken:type: + */ +@property(nonatomic, strong, nullable) NSData *APNSToken; + +/** @fn init + @brief Please access auth instances using @c FIRAuth.auth and @c FIRAuth.authForApp:. + */ +- (instancetype)init NS_UNAVAILABLE; + +/** @fn fetchProvidersForEmail:completion: + @brief Fetches the list of IdPs that can be used for signing in with the provided email address. + Useful for an "identifier-first" sign-in flow. + + @param email The email address for which to obtain a list of identity providers. + @param completion Optionally; a block which is invoked when the list of providers for the + specified email address is ready or an error was encountered. Invoked asynchronously on the + main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)fetchProvidersForEmail:(NSString *)email + completion:(nullable FIRProviderQueryCallback)completion; + +/** @fn signInWithEmail:password:completion: + @brief Signs in using an email address and password. + + @param email The user's email address. + @param password The user's password. + @param completion Optionally; a block which is invoked when the sign in flow finishes, or is + canceled. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: + +
      +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that email and password + accounts are not enabled. Enable them in the Auth section of the + Firebase console. +
    • +
    • @c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled. +
    • +
    • @c FIRAuthErrorCodeWrongPassword - Indicates the user attempted + sign in with an incorrect password. +
    • +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)signInWithEmail:(NSString *)email + password:(NSString *)password + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn signInWithCredential:completion: + @brief Convenience method for @c signInAndRetrieveDataWithCredential:completion: This method + doesn't return additional identity provider data. + */ +- (void)signInWithCredential:(FIRAuthCredential *)credential + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn signInAndRetrieveDataWithCredential:completion: + @brief Asynchronously signs in to Firebase with the given 3rd-party credentials (e.g. a Facebook + login Access Token, a Google ID Token/Access Token pair, etc.) and returns additional + identity provider data. + + @param credential The credential supplied by the IdP. + @param completion Optionally; a block which is invoked when the sign in flow finishes, or is + canceled. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid. + This could happen if it has expired or it is malformed. +
    • +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts + with the identity provider represented by the credential are not enabled. + Enable them in the Auth section of the Firebase console. +
    • +
    • @c FIRAuthErrorCodeAccountExistsWithDifferentCredential - Indicates the email asserted + by the credential (e.g. the email in a Facebook access token) is already in use by an + existing account, that cannot be authenticated with this sign-in method. Call + fetchProvidersForEmail for this user’s email and then prompt them to sign in with any of + the sign-in providers returned. This error will only be thrown if the "One account per + email address" setting is enabled in the Firebase console, under Auth settings. +
    • +
    • @c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled. +
    • +
    • @c FIRAuthErrorCodeWrongPassword - Indicates the user attempted sign in with an + incorrect password, if credential is of the type EmailPasswordAuthCredential. +
    • +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)signInAndRetrieveDataWithCredential:(FIRAuthCredential *)credential + completion:(nullable FIRAuthDataResultCallback)completion; + +/** @fn signInAnonymouslyWithCompletion: + @brief Asynchronously creates and becomes an anonymous user. + @param completion Optionally; a block which is invoked when the sign in finishes, or is + canceled. Invoked asynchronously on the main thread in the future. + + @remarks If there is already an anonymous user signed in, that user will be returned instead. + If there is any other existing user signed in, that user will be signed out. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that anonymous accounts are + not enabled. Enable them in the Auth section of the Firebase console. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)signInAnonymouslyWithCompletion:(nullable FIRAuthResultCallback)completion; + +/** @fn signInWithCustomToken:completion: + @brief Asynchronously signs in to Firebase with the given Auth token. + + @param token A self-signed custom auth token. + @param completion Optionally; a block which is invoked when the sign in finishes, or is + canceled. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidCustomToken - Indicates a validation error with + the custom token. +
    • +
    • @c FIRAuthErrorCodeCustomTokenMismatch - Indicates the service account and the API key + belong to different projects. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)signInWithCustomToken:(NSString *)token + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn createUserWithEmail:password:completion: + @brief Creates and, on success, signs in a user with the given email address and password. + + @param email The user's email address. + @param password The user's desired password. + @param completion Optionally; a block which is invoked when the sign up flow finishes, or is + canceled. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed. +
    • +
    • @c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email used to attempt sign up + already exists. Call fetchProvidersForEmail to check which sign-in mechanisms the user + used, and prompt the user to sign in with one of those. +
    • +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that email and password accounts + are not enabled. Enable them in the Auth section of the Firebase console. +
    • +
    • @c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is + considered too weak. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo + dictionary object will contain more detailed explanation that can be shown to the user. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)createUserWithEmail:(NSString *)email + password:(NSString *)password + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn confirmPasswordResetWithCode:newPassword:completion: + @brief Resets the password given a code sent to the user outside of the app and a new password + for the user. + + @param newPassword The new password. + @param completion Optionally; a block which is invoked when the request finishes. Invoked + asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is + considered too weak. +
    • +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates the administrator disabled sign + in with the specified identity provider. +
    • +
    • @c FIRAuthErrorCodeExpiredActionCode - Indicates the OOB code is expired. +
    • +
    • @c FIRAuthErrorCodeInvalidActionCode - Indicates the OOB code is invalid. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)confirmPasswordResetWithCode:(NSString *)code + newPassword:(NSString *)newPassword + completion:(FIRConfirmPasswordResetCallback)completion; + +/** @fn checkActionCode:completion: + @brief Checks the validity of an out of band code. + + @param code The out of band code to check validity. + @param completion Optionally; a block which is invoked when the request finishes. Invoked + asynchronously on the main thread in the future. + */ +- (void)checkActionCode:(NSString *)code completion:(FIRCheckActionCodeCallBack)completion; + +/** @fn verifyPasswordResetCode:completion: + @brief Checks the validity of a verify password reset code. + + @param code The password reset code to be verified. + @param completion Optionally; a block which is invoked when the request finishes. Invoked + asynchronously on the main thread in the future. + */ +- (void)verifyPasswordResetCode:(NSString *)code + completion:(FIRVerifyPasswordResetCodeCallback)completion; + +/** @fn applyActionCode:completion: + @brief Applies out of band code. + + @param code The out of band code to be applied. + @param completion Optionally; a block which is invoked when the request finishes. Invoked + asynchronously on the main thread in the future. + + @remarks This method will not work for out of band codes which require an additional parameter, + such as password reset code. + */ +- (void)applyActionCode:(NSString *)code + completion:(FIRApplyActionCodeCallback)completion; + +/** @fn sendPasswordResetWithEmail:completion: + @brief Initiates a password reset for the given email address. + + @param email The email address of the user. + @param completion Optionally; a block which is invoked when the request finishes. Invoked + asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was + sent in the request. +
    • +
    • @c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in + the console for this action. +
    • +
    • @c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for + sending update email. +
    • +
    + */ +- (void)sendPasswordResetWithEmail:(NSString *)email + completion:(nullable FIRSendPasswordResetCallback)completion; + +/** @fn signOut: + @brief Signs out the current user. + + @param error Optionally; if an error occurs, upon return contains an NSError object that + describes the problem; is nil otherwise. + @return @YES when the sign out request was successful. @NO otherwise. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeKeychainError - Indicates an error occurred when accessing the + keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo + dictionary will contain more information about the error encountered. +
    • +
    + + */ +- (BOOL)signOut:(NSError *_Nullable *_Nullable)error; + +/** @fn addAuthStateDidChangeListener: + @brief Registers a block as an "auth state did change" listener. To be invoked when: + + + The block is registered as a listener, + + A user with a different UID from the current user has signed in, or + + The current user has signed out. + + @param listener The block to be invoked. The block is always invoked asynchronously on the main + thread, even for it's initial invocation after having been added as a listener. + + @remarks The block is invoked immediately after adding it according to it's standard invocation + semantics, asynchronously on the main thread. Users should pay special attention to + making sure the block does not inadvertently retain objects which should not be retained by + the long-lived block. The block itself will be retained by @c FIRAuth until it is + unregistered or until the @c FIRAuth instance is otherwise deallocated. + + @return A handle useful for manually unregistering the block as a listener. + */ +- (FIRAuthStateDidChangeListenerHandle)addAuthStateDidChangeListener: + (FIRAuthStateDidChangeListenerBlock)listener; + +/** @fn removeAuthStateDidChangeListener: + @brief Unregisters a block as an "auth state did change" listener. + + @param listenerHandle The handle for the listener. + */ +- (void)removeAuthStateDidChangeListener:(FIRAuthStateDidChangeListenerHandle)listenerHandle; + +/** @fn addIDTokenDidChangeListener: + @brief Registers a block as an "ID token did change" listener. To be invoked when: + + + The block is registered as a listener, + + A user with a different UID from the current user has signed in, + + The ID token of the current user has been refreshed, or + + The current user has signed out. + + @param listener The block to be invoked. The block is always invoked asynchronously on the main + thread, even for it's initial invocation after having been added as a listener. + + @remarks The block is invoked immediately after adding it according to it's standard invocation + semantics, asynchronously on the main thread. Users should pay special attention to + making sure the block does not inadvertently retain objects which should not be retained by + the long-lived block. The block itself will be retained by @c FIRAuth until it is + unregistered or until the @c FIRAuth instance is otherwise deallocated. + + @return A handle useful for manually unregistering the block as a listener. + */ +- (FIRIDTokenDidChangeListenerHandle)addIDTokenDidChangeListener: + (FIRIDTokenDidChangeListenerBlock)listener; + +/** @fn removeIDTokenDidChangeListener: + @brief Unregisters a block as an "ID token did change" listener. + + @param listenerHandle The handle for the listener. + */ +- (void)removeIDTokenDidChangeListener:(FIRIDTokenDidChangeListenerHandle)listenerHandle; + +/** @fn setAPNSToken:type: + @brief Sets the APNs token along with its type. + @remarks If swizzling is disabled, the APNs Token must be set for phone number auth to work, + by either setting calling this method or by setting the @c APNSToken property. + */ +- (void)setAPNSToken:(NSData *)token type:(FIRAuthAPNSTokenType)type; + +/** @fn canHandleNotification: + @brief Whether the specific remote notification is handled by @c FIRAuth . + @param userInfo A dictionary that contains information related to the + notification in question. + @return Whether or the notification is handled. @c YES means the notification is for @c FIRAuth + so the caller should ignore the notification from further processing, and @c NO means the + the notification is for the app (or another libaray) so the caller should continue handling + this notification as usual. + @remarks If swizzling is disabled, related remote notifications must be forwarded to this method + for phone number auth to work. + */ +- (BOOL)canHandleNotification:(NSDictionary *)userInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h new file mode 100755 index 000000000..4d9a029d6 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthAPNSTokenType.h @@ -0,0 +1,33 @@ +/** @file FIRAuthAPNSTokenType.h + @brief Firebase Auth SDK + @copyright Copyright 2017 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * @brief The APNs token type for the app. + */ +typedef NS_ENUM(NSInteger, FIRAuthAPNSTokenType) { + + /** Unknown token type. + The actual token type will be detected from the provisioning profile in the app's bundle. + */ + FIRAuthAPNSTokenTypeUnknown, + + /** Sandbox token type. + */ + FIRAuthAPNSTokenTypeSandbox, + + /** Production token type. + */ + FIRAuthAPNSTokenTypeProd, +} FIR_SWIFT_NAME(AuthAPNSTokenType); + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthCredential.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthCredential.h new file mode 100755 index 000000000..9d234cc54 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthCredential.h @@ -0,0 +1,34 @@ +/** @file FIRAuthCredential.h + @brief Firebase Auth SDK + @copyright Copyright 2015 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIRAuthCredential + @brief Represents a credential. + */ +FIR_SWIFT_NAME(AuthCredential) +@interface FIRAuthCredential : NSObject + +/** @property provider + @brief Gets the name of the identity provider for the credential. + */ +@property(nonatomic, copy, readonly) NSString *provider; + +/** @fn init + @brief This is an abstract base class. Concrete instances should be created via factory + methods available in the various authentication provider libraries (like the Facebook + provider or the Google provider libraries.) + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h new file mode 100755 index 000000000..b5ce401da --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthDataResult.h @@ -0,0 +1,42 @@ +/** @file FIRAuthDataResult.h + @brief Firebase Auth SDK + @copyright Copyright 2017 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAdditionalUserInfo; +@class FIRUser; + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIRAuthDataResult + @brief Helper object that contains the result of a successful sign-in, link and reauthenticate. + It contains a reference to a @c FIRUser and @c FIRAdditionalUserInfo. + */ +FIR_SWIFT_NAME(AuthDataResult) +@interface FIRAuthDataResult : NSObject + +/** @fn init + @brief This class should not be initialized manually. @c FIRAuthDataResult instance is + returned as part of @c FIRAuthDataResultCallback . + */ +- (instancetype)init NS_UNAVAILABLE; + +/** @property user + @brief The signed in user. + */ +@property(nonatomic, readonly) FIRUser *user; + +/** @property additionalUserInfo + @brief If available contains the additional IdP specific information about signed in user. + */ +@property(nonatomic, readonly, nullable) FIRAdditionalUserInfo *additionalUserInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthErrors.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthErrors.h new file mode 100755 index 000000000..854f46102 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthErrors.h @@ -0,0 +1,249 @@ +/** @file FIRAuthErrors.h + @brief Firebase Auth SDK + @copyright Copyright 2015 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +/** @class FIRAuthErrors + @remarks Error Codes common to all API Methods: +
      +
    • @c FIRAuthErrorCodeNetworkError
    • +
    • @c FIRAuthErrorCodeUserNotFound
    • +
    • @c FIRAuthErrorCodeUserTokenExpired
    • +
    • @c FIRAuthErrorCodeTooManyRequests
    • +
    • @c FIRAuthErrorCodeInvalidAPIKey
    • +
    • @c FIRAuthErrorCodeAppNotAuthorized
    • +
    • @c FIRAuthErrorCodeKeychainError
    • +
    • @c FIRAuthErrorCodeInternalError
    • +
    + @remarks Common error codes for @c FIRUser operations: +
      +
    • @c FIRAuthErrorCodeInvalidUserToken
    • +
    • @c FIRAuthErrorCodeUserDisabled
    • +
    + */ +FIR_SWIFT_NAME(AuthErrors) +@interface FIRAuthErrors + +/** + @brief The Firebase Auth error domain. + */ +extern NSString *const FIRAuthErrorDomain FIR_SWIFT_NAME(AuthErrorDomain); + +/** + @brief The key used to read the updated credential from the userinfo dictionary of the NSError + object returned in the case that the credential being linked in already in use. + */ +extern NSString *const FIRAuthUpdatedCredentialKey FIR_SWIFT_NAME(AuthUpdatedCredentialKey); + +/** + @brief The name of the key for the "error_name" string in the NSError userinfo dictionary. + */ +extern NSString *const FIRAuthErrorNameKey FIR_SWIFT_NAME(AuthErrorNameKey); + +/** @var FIRAuthErrorUserInfoEmailKey + @brief Errors with the code @c FIRAuthErrorCodeEmailAlreadyInUse may contains an + @c NSError.userInfo dictinary which contains this key. The value associated with this key is + an NSString of the email address that already exists. + */ +extern NSString *const FIRAuthErrorUserInfoEmailKey FIR_SWIFT_NAME(AuthErrorUserInfoEmailKey); + +/** + @brief Error codes used by Firebase Auth. + */ +typedef NS_ENUM(NSInteger, FIRAuthErrorCode) { + /** Indicates a validation error with the custom token. + */ + FIRAuthErrorCodeInvalidCustomToken = 17000, + + /** Indicates the service account and the API key belong to different projects. + */ + FIRAuthErrorCodeCustomTokenMismatch = 17002, + + /** Indicates the IDP token or requestUri is invalid. + */ + FIRAuthErrorCodeInvalidCredential = 17004, + + /** Indicates the user's account is disabled on the server. + */ + FIRAuthErrorCodeUserDisabled = 17005, + + /** Indicates the administrator disabled sign in with the specified identity provider. + */ + FIRAuthErrorCodeOperationNotAllowed = 17006, + + /** Indicates the email used to attempt a sign up is already in use. + */ + FIRAuthErrorCodeEmailAlreadyInUse = 17007, + + /** Indicates the email is invalid. + */ + FIRAuthErrorCodeInvalidEmail = 17008, + + /** Indicates the user attempted sign in with a wrong password. + */ + FIRAuthErrorCodeWrongPassword = 17009, + + /** Indicates that too many requests were made to a server method. + */ + FIRAuthErrorCodeTooManyRequests = 17010, + + /** Indicates the user account was not found. + */ + FIRAuthErrorCodeUserNotFound = 17011, + + /** Indicates account linking is required. + */ + FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012, + + /** Indicates the user has attemped to change email or password more than 5 minutes after + signing in. + */ + FIRAuthErrorCodeRequiresRecentLogin = 17014, + + /** Indicates an attempt to link a provider to which the account is already linked. + */ + FIRAuthErrorCodeProviderAlreadyLinked = 17015, + + /** Indicates an attempt to unlink a provider that is not linked. + */ + FIRAuthErrorCodeNoSuchProvider = 17016, + + /** Indicates user's saved auth credential is invalid, the user needs to sign in again. + */ + FIRAuthErrorCodeInvalidUserToken = 17017, + + /** Indicates a network error occurred (such as a timeout, interrupted connection, or + unreachable host). These types of errors are often recoverable with a retry. The @c + NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the error + encountered. + */ + FIRAuthErrorCodeNetworkError = 17020, + + /** Indicates the saved token has expired, for example, the user may have changed account + password on another device. The user needs to sign in again on the device that made this + request. + */ + FIRAuthErrorCodeUserTokenExpired = 17021, + + /** Indicates an invalid API key was supplied in the request. + */ + FIRAuthErrorCodeInvalidAPIKey = 17023, + + /** Indicates that an attempt was made to reauthenticate with a user which is not the current + user. + */ + FIRAuthErrorCodeUserMismatch = 17024, + + /** Indicates an attempt to link with a credential that has already been linked with a + different Firebase account + */ + FIRAuthErrorCodeCredentialAlreadyInUse = 17025, + + /** Indicates an attempt to set a password that is considered too weak. + */ + FIRAuthErrorCodeWeakPassword = 17026, + + /** Indicates the App is not authorized to use Firebase Authentication with the + provided API Key. + */ + FIRAuthErrorCodeAppNotAuthorized = 17028, + + /** Indicates the OOB code is expired. + */ + FIRAuthErrorCodeExpiredActionCode = 17029, + + /** Indicates the OOB code is invalid. + */ + FIRAuthErrorCodeInvalidActionCode = 17030, + + /** Indicates that there are invalid parameters in the payload during a "send password reset + * email" attempt. + */ + FIRAuthErrorCodeInvalidMessagePayload = 17031, + + /** Indicates that the sender email is invalid during a "send password reset email" attempt. + */ + FIRAuthErrorCodeInvalidSender = 17032, + + /** Indicates that the recipient email is invalid. + */ + FIRAuthErrorCodeInvalidRecipientEmail = 17033, + + // The enum values between 17033 and 17041 are reserved and should NOT be used for new error + // codes. + + /** Indicates that a phone number was not provided in a call to @c + verifyPhoneNumber:completion:. + */ + FIRAuthErrorCodeMissingPhoneNumber = 17041, + + /** Indicates that an invalid phone number was provided in a call to @c + verifyPhoneNumber:completion:. + */ + FIRAuthErrorCodeInvalidPhoneNumber = 17042, + + /** Indicates that the phone auth credential was created with an empty verification code. + */ + FIRAuthErrorCodeMissingVerificationCode = 17043, + + /** Indicates that an invalid verification code was used in the verifyPhoneNumber request. + */ + FIRAuthErrorCodeInvalidVerificationCode = 17044, + + /** Indicates that the phone auth credential was created with an empty verification ID. + */ + FIRAuthErrorCodeMissingVerificationID = 17045, + + /** Indicates that an invalid verification ID was used in the verifyPhoneNumber request. + */ + FIRAuthErrorCodeInvalidVerificationID = 17046, + + /** Indicates that the APNS device token is missing in the verifyClient request. + */ + FIRAuthErrorCodeMissingAppCredential = 17047, + + /** Indicates that an invalid APNS device token was used in the verifyClient request. + */ + FIRAuthErrorCodeInvalidAppCredential = 17048, + + // The enum values between 17048 and 17051 are reserved and should NOT be used for new error + // codes. + + /** Indicates that the SMS code has expired. + */ + FIRAuthErrorCodeSessionExpired = 17051, + + /** Indicates that the quota of SMS messages for a given project has been exceeded. + */ + FIRAuthErrorCodeQuotaExceeded = 17052, + + /** Indicates that the APNs device token could not be obtained. The app may not have set up + remote notification correctly, or may fail to forward the APNs device token to FIRAuth + if app delegate swizzling is disabled. + */ + FIRAuthErrorCodeMissingAppToken = 17053, + + /** Indicates that the app fails to forward remote notification to FIRAuth. + */ + FIRAuthErrorCodeNotificationNotForwarded = 17054, + + /** Indicates that the app could not be verified by Firebase during phone number authentication. + */ + FIRAuthErrorCodeAppNotVerified = 17055, + + /** Indicates an error occurred while attempting to access the keychain. + */ + FIRAuthErrorCodeKeychainError = 17995, + + /** Indicates an internal error occurred. + */ + FIRAuthErrorCodeInternalError = 17999, +} FIR_SWIFT_NAME(AuthErrorCode); + +@end diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h new file mode 100755 index 000000000..a64b86c3a --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRAuthSwiftNameSupport.h @@ -0,0 +1,20 @@ +/** @file FIRAuthSwiftNameSupport.h + @brief Firebase Auth SDK + @copyright Copyright 2017 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#ifndef FIR_SWIFT_NAME + +#import + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// // Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h new file mode 100755 index 000000000..760d4b34a --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIREmailAuthProvider.h @@ -0,0 +1,54 @@ +/** @file FIREmailAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief A string constant identifying the email & password identity provider. + */ +extern NSString *const FIREmailAuthProviderID FIR_SWIFT_NAME(EmailAuthProviderID); + +/** + @brief please use @c FIREmailAuthProviderID instead. + */ +extern NSString *const FIREmailPasswordAuthProviderID __attribute__((deprecated)); + +/** @class FIREmailAuthProvider + @brief A concrete implementation of @c FIRAuthProvider for Email & Password Sign In. + */ +FIR_SWIFT_NAME(EmailAuthProvider) +@interface FIREmailAuthProvider : NSObject + +/** @typedef FIREmailPasswordAuthProvider + @brief Please use @c FIREmailAuthProvider instead. + */ +typedef FIREmailAuthProvider FIREmailPasswordAuthProvider __attribute__((deprecated)); + + +/** @fn credentialWithEmail:password: + @brief Creates an @c FIRAuthCredential for an email & password sign in. + + @param email The user's email address. + @param password The user's password. + @return A FIRAuthCredential containing the email & password credential. + */ ++ (FIRAuthCredential *)credentialWithEmail:(NSString *)email password:(NSString *)password; + +/** @fn init + @brief This class is not meant to be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h new file mode 100755 index 000000000..1f83210aa --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h @@ -0,0 +1,42 @@ +/** @file FIRFacebookAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief A string constant identifying the Facebook identity provider. + */ +extern NSString *const FIRFacebookAuthProviderID FIR_SWIFT_NAME(FacebookAuthProviderID); + +/** @class FIRFacebookAuthProvider + @brief Utility class for constructing Facebook credentials. + */ +FIR_SWIFT_NAME(FacebookAuthProvider) +@interface FIRFacebookAuthProvider : NSObject + +/** @fn credentialWithAccessToken: + @brief Creates an @c FIRAuthCredential for a Facebook sign in. + + @param accessToken The Access Token from Facebook. + @return A FIRAuthCredential containing the Facebook credentials. + */ ++ (FIRAuthCredential *)credentialWithAccessToken:(NSString *)accessToken; + +/** @fn init + @brief This class should not be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h new file mode 100755 index 000000000..7928e7726 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h @@ -0,0 +1,42 @@ +/** @file FIRGitHubAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief A string constant identifying the GitHub identity provider. + */ +extern NSString *const FIRGitHubAuthProviderID FIR_SWIFT_NAME(GitHubAuthProviderID); + +/** @class FIRGitHubAuthProvider + @brief Utility class for constructing GitHub credentials. + */ +FIR_SWIFT_NAME(GitHubAuthProvider) +@interface FIRGitHubAuthProvider : NSObject + +/** @fn credentialWithToken: + @brief Creates an @c FIRAuthCredential for a GitHub sign in. + + @param token The GitHub OAuth access token. + @return A FIRAuthCredential containing the GitHub credential. + */ ++ (FIRAuthCredential *)credentialWithToken:(NSString *)token; + +/** @fn init + @brief This class is not meant to be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h new file mode 100755 index 000000000..0085a67a1 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h @@ -0,0 +1,44 @@ +/** @file FIRGoogleAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief A string constant identifying the Google identity provider. + */ +extern NSString *const FIRGoogleAuthProviderID FIR_SWIFT_NAME(GoogleAuthProviderID); + +/** @class FIRGoogleAuthProvider + @brief Utility class for constructing Google Sign In credentials. + */ +FIR_SWIFT_NAME(GoogleAuthProvider) +@interface FIRGoogleAuthProvider : NSObject + +/** @fn credentialWithIDToken:accessToken: + @brief Creates an @c FIRAuthCredential for a Google sign in. + + @param IDToken The ID Token from Google. + @param accessToken The Access Token from Google. + @return A FIRAuthCredential containing the Google credentials. + */ ++ (FIRAuthCredential *)credentialWithIDToken:(NSString *)IDToken + accessToken:(NSString *)accessToken; + +/** @fn init + @brief This class should not be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIROAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIROAuthProvider.h new file mode 100755 index 000000000..58d074c06 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIROAuthProvider.h @@ -0,0 +1,55 @@ +/** @file FIROAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIROAuthProvider + @brief A concrete implementation of @c FIRAuthProvider for generic OAuth Providers. + */ +FIR_SWIFT_NAME(OAuthProvider) +@interface FIROAuthProvider : NSObject + +/** @fn credentialWithProviderID:IDToken:accessToken: + @brief Creates an @c FIRAuthCredential for that OAuth 2 provider identified by providerID, ID + token and access token. + + @param providerID The provider ID associated with the Auth credential being created. + @param IDToken The IDToken associated with the Auth credential being created. + @param accessToken The accessstoken associated with the Auth credential be created, if + available. + @return A FIRAuthCredential for the specified provider ID, ID token and access token. + */ ++ (FIRAuthCredential *)credentialWithProviderID:(NSString *)providerID + IDToken:(NSString *)IDToken + accessToken:(nullable NSString *)accessToken; + + +/** @fn credentialWithProviderID:accessToken: + @brief Creates an @c FIRAuthCredential for that OAuth 2 provider identified by providerID using + an ID token. + + @param providerID The provider ID associated with the Auth credential being created. + @param accessToken The accessstoken associated with the Auth credential be created + @return A FIRAuthCredential. + */ ++ (FIRAuthCredential *)credentialWithProviderID:(NSString *)providerID + accessToken:(NSString *)accessToken; + +/** @fn init + @brief This class is not meant to be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h new file mode 100755 index 000000000..90c9f63a1 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthCredential.h @@ -0,0 +1,28 @@ +/** @file FIRPhoneAuthCredential.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthCredential.h" +#import "FIRAuthSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + +/** @class FIRPhoneAuthCredential + @brief Implementation of FIRAuthCredential for Phone Auth credentials. + */ +FIR_SWIFT_NAME(PhoneAuthCredential) +@interface FIRPhoneAuthCredential : FIRAuthCredential + +/** @fn init + @brief This class is not supposed to be instantiated directly. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h new file mode 100755 index 000000000..78fa8bb69 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRPhoneAuthProvider.h @@ -0,0 +1,81 @@ +/** @file FIRPhoneNumberProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2017 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuth.h" +#import "FIRAuthSwiftNameSupport.h" + +@class FIRPhoneAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** @var FIRPhoneAuthProviderID + @brief A string constant identifying the phone identity provider. + */ +extern NSString *const FIRPhoneAuthProviderID FIR_SWIFT_NAME(PhoneAuthProviderID); + +/** @typedef FIRVerificationResultCallback + @brief The type of block invoked when a request to send a verification code has finished. + + @param verificationID On success, the verification ID provided, nil otherwise. + @param error On error, the error that occured, nil otherwise. + */ +typedef void (^FIRVerificationResultCallback)(NSString *_Nullable verificationID, + NSError *_Nullable error) + FIR_SWIFT_NAME(VerificationResultCallback); + +/** @class FIRPhoneNumberProvider + @brief A concrete implementation of @c FIRAuthProvider for Phone Auth Providers. + */ +FIR_SWIFT_NAME(PhoneAuthProvider) +@interface FIRPhoneAuthProvider : NSObject + +/** @fn provider + @brief Returns an instance of @c FIRPhoneAuthProvider for the default @c FIRAuth object. + */ ++ (instancetype)provider FIR_SWIFT_NAME(provider()); + +/** @fn providerWithAuth: + @brief Returns an instance of @c FIRPhoneAuthProvider for the provided @c FIRAuth object. + + @param auth The auth object to associate with the @c PhoneauthProvider instance. + */ ++ (instancetype)providerWithAuth:(FIRAuth *)auth FIR_SWIFT_NAME(provider(auth:)); + +/** @fn verifyPhoneNumber:completion: + @brief Starts the phone number authentication flow by sending a verifcation code to the + specified phone number. + + @param phoneNumber The phone number to be verified. + @param completion The callback to be invoked when the verification flow is finished. + */ +- (void)verifyPhoneNumber:(NSString *)phoneNumber + completion:(nullable FIRVerificationResultCallback)completion; + +/** @fn credentialWithVerificationID:verificationCode: + @brief Creates an @c FIRAuthCredential for the phone number provider identified by the + verification ID and verification code. + + @param verificationID The verification ID obtained from invoking @c + verifyPhoneNumber:completion: + @param verificationCode The verification code obtained from the user. + @return The corresponding @c FIRAuthCredential for the verification ID and verification code + provided. + */ +- (FIRPhoneAuthCredential *)credentialWithVerificationID:(NSString *)verificationID + verificationCode:(NSString *)verificationCode; + +/** @fn init + @brief Please use the @c provider or @providerWithAuth: methods to obtain an instance of @c + FIRPhoneAuthProvider. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h new file mode 100755 index 000000000..9cd2d682b --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h @@ -0,0 +1,43 @@ +/** @file FIRTwitterAuthProvider.h + @brief Firebase Auth SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +@class FIRAuthCredential; + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief A string constant identifying the Twitter identity provider. + */ +extern NSString *const FIRTwitterAuthProviderID FIR_SWIFT_NAME(TwitterAuthProviderID); + +/** @class FIRTwitterAuthProvider + @brief Utility class for constructing Twitter credentials. + */ +FIR_SWIFT_NAME(TwitterAuthProvider) +@interface FIRTwitterAuthProvider : NSObject + +/** @fn credentialWithToken:secret: + @brief Creates an @c FIRAuthCredential for a Twitter sign in. + + @param token The Twitter OAuth token. + @param secret The Twitter OAuth secret. + @return A FIRAuthCredential containing the Twitter credential. + */ ++ (FIRAuthCredential *)credentialWithToken:(NSString *)token secret:(NSString *)secret; + +/** @fn init + @brief This class is not meant to be initialized. + */ +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUser.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUser.h new file mode 100755 index 000000000..70e9da627 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUser.h @@ -0,0 +1,454 @@ +/** @file FIRUser.h + @brief Firebase Auth SDK + @copyright Copyright 2015 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuth.h" +#import "FIRAuthDataResult.h" +#import "FIRAuthSwiftNameSupport.h" +#import "FIRUserInfo.h" + +@class FIRPhoneAuthCredential; +@class FIRUserProfileChangeRequest; + +NS_ASSUME_NONNULL_BEGIN + +/** @typedef FIRAuthTokenCallback + @brief The type of block called when a token is ready for use. + @see FIRUser.getIDTokenWithCompletion: + @see FIRUser.getIDTokenForcingRefresh:withCompletion: + + @param token Optionally; an access token if the request was successful. + @param error Optionally; the error which occurred - or nil if the request was successful. + + @remarks One of: @c token or @c error will always be non-nil. + */ +typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error) + FIR_SWIFT_NAME(AuthTokenCallback); + +/** @typedef FIRUserProfileChangeCallback + @brief The type of block called when a user profile change has finished. + + @param error Optionally; the error which occurred - or nil if the request was successful. + */ +typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error) + FIR_SWIFT_NAME(UserProfileChangeCallback); + +/** @typedef FIRSendEmailVerificationCallback + @brief The type of block called when a request to send an email verification has finished. + + @param error Optionally; the error which occurred - or nil if the request was successful. + */ +typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error) + FIR_SWIFT_NAME(SendEmailVerificationCallback); + +/** @class FIRUser + @brief Represents a user. + @remarks This class is thread-safe. + */ +FIR_SWIFT_NAME(User) +@interface FIRUser : NSObject + +/** @property anonymous + @brief Indicates the user represents an anonymous user. + */ +@property(nonatomic, readonly, getter=isAnonymous) BOOL anonymous; + +/** @property emailVerified + @brief Indicates the email address associated with this user has been verified. + */ +@property(nonatomic, readonly, getter=isEmailVerified) BOOL emailVerified; + +/** @property refreshToken + @brief A refresh token; useful for obtaining new access tokens independently. + @remarks This property should only be used for advanced scenarios, and is not typically needed. + */ +@property(nonatomic, readonly, nullable) NSString *refreshToken; + +/** @property providerData + @brief Profile data for each identity provider, if any. + @remarks This data is cached on sign-in and updated when linking or unlinking. + */ +@property(nonatomic, readonly, nonnull) NSArray> *providerData; + +/** @fn init + @brief This class should not be instantiated. + @remarks To retrieve the current user, use @c FIRAuth.currentUser. To sign a user + in or out, use the methods on @c FIRAuth. + */ +- (instancetype)init NS_UNAVAILABLE; + +/** @fn updateEmail:completion: + @brief Updates the email address for the user. On success, the cached user profile data is + updated. + @remarks May fail if there is already an account with this email address that was created using + email and password authentication. + + @param email The email address for the user. + @param completion Optionally; the block invoked when the user profile change has finished. + Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was + sent in the request. +
    • +
    • @c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in + the console for this action. +
    • +
    • @c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for + sending update email. +
    • +
    • @c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email is already in use by another + account. +
    • +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed. +
    • +
    • @c FIRAuthErrorCodeRequiresRecentLogin - Updating a user’s email is a security + sensitive operation that requires a recent login from the user. This error indicates + the user has not signed in recently enough. To resolve, reauthenticate the user by + invoking reauthenticateWithCredential:completion: on FIRUser. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)updateEmail:(NSString *)email completion:(nullable FIRUserProfileChangeCallback)completion + FIR_SWIFT_NAME(updateEmail(to:completion:)); + +/** @fn updatePassword:completion: + @brief Updates the password for the user. On success, the cached user profile data is updated. + + @param password The new password for the user. + @param completion Optionally; the block invoked when the user profile change has finished. + Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates the administrator disabled + sign in with the specified identity provider. +
    • +
    • @c FIRAuthErrorCodeRequiresRecentLogin - Updating a user’s password is a security + sensitive operation that requires a recent login from the user. This error indicates + the user has not signed in recently enough. To resolve, reauthenticate the user by + invoking reauthenticateWithCredential:completion: on FIRUser. +
    • +
    • @c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is + considered too weak. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo + dictionary object will contain more detailed explanation that can be shown to the user. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)updatePassword:(NSString *)password + completion:(nullable FIRUserProfileChangeCallback)completion + FIR_SWIFT_NAME(updatePassword(to:completion:)); + +/** @fn updatePhoneNumberCredential:completion: + @brief Updates the phone number for the user. On success, the cached user profile data is + updated. + + @param phoneNumberCredential The new phone number credential corresponding to the phone number + to be added to the firebaes account, if a phone number is already linked to the account this + new phone number will replace it. + @param completion Optionally; the block invoked when the user profile change has finished. + Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeRequiresRecentLogin - Updating a user’s phone number is a security + sensitive operation that requires a recent login from the user. This error indicates + the user has not signed in recently enough. To resolve, reauthenticate the user by + invoking reauthenticateWithCredential:completion: on FIRUser. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)updatePhoneNumberCredential:(FIRPhoneAuthCredential *)phoneNumberCredential + completion:(nullable FIRUserProfileChangeCallback)completion; + +/** @fn profileChangeRequest + @brief Creates an object which may be used to change the user's profile data. + + @remarks Set the properties of the returned object, then call + @c FIRUserProfileChangeRequest.commitChangesWithCallback: to perform the updates atomically. + + @return An object which may be used to change the user's profile data atomically. + */ +- (FIRUserProfileChangeRequest *)profileChangeRequest FIR_SWIFT_NAME(createProfileChangeRequest()); + +/** @fn reloadWithCompletion: + @brief Reloads the user's profile data from the server. + + @param completion Optionally; the block invoked when the reload has finished. Invoked + asynchronously on the main thread in the future. + + @remarks May fail with a @c FIRAuthErrorCodeRequiresRecentLogin error code. In this case + you should call @c FIRUser.reauthenticateWithCredential:completion: before re-invoking + @c FIRUser.updateEmail:completion:. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)reloadWithCompletion:(nullable FIRUserProfileChangeCallback)completion; + +/** @fn reauthenticateWithCredential:completion: + @brief Convenience method for @c reauthenticateAndRetrieveDataWithCredential:completion: This + method doesn't return additional identity provider data. + */ +- (void)reauthenticateWithCredential:(FIRAuthCredential *)credential + completion:(nullable FIRUserProfileChangeCallback)completion; + +/** @fn reauthenticateWithCredential:completion: + @brief Renews the user's authentication tokens by validating a fresh set of credentials supplied + by the user and returns additional identity provider data. + + @param credential A user-supplied credential, which will be validated by the server. This can be + a successful third-party identity provider sign-in, or an email address and password. + @param completion Optionally; the block invoked when the re-authentication operation has + finished. Invoked asynchronously on the main thread in the future. + + @remarks If the user associated with the supplied credential is different from the current user, + or if the validation of the supplied credentials fails; an error is returned and the current + user remains signed in. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid. + This could happen if it has expired or it is malformed. +
    • +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the + identity provider represented by the credential are not enabled. Enable them in the + Auth section of the Firebase console. +
    • +
    • @c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential + (e.g. the email in a Facebook access token) is already in use by an existing account, + that cannot be authenticated with this method. Call fetchProvidersForEmail for + this user’s email and then prompt them to sign in with any of the sign-in providers + returned. This error will only be thrown if the "One account per email address" + setting is enabled in the Firebase console, under Auth settings. Please note that the + error code raised in this specific situation may not be the same on Web and Android. +
    • +
    • @c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled. +
    • +
    • @c FIRAuthErrorCodeWrongPassword - Indicates the user attempted reauthentication with + an incorrect password, if credential is of the type EmailPasswordAuthCredential. +
    • +
    • @c FIRAuthErrorCodeUserMismatch - Indicates that an attempt was made to + reauthenticate with a user which is not the current user. +
    • +
    • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
    • +
    + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *) credential + completion:(nullable FIRAuthDataResultCallback) completion; + +/** @fn getIDTokenWithCompletion: + @brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired. + + @param completion Optionally; the block invoked when the token is available. Invoked + asynchronously on the main thread in the future. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)getIDTokenWithCompletion:(nullable FIRAuthTokenCallback)completion + FIR_SWIFT_NAME(getIDToken(completion:)); + +/** @fn getTokenWithCompletion: + @brief Please use @c getIDTokenWithCompletion: instead. + + @param completion Optionally; the block invoked when the token is available. Invoked + asynchronously on the main thread in the future. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)getTokenWithCompletion:(nullable FIRAuthTokenCallback)completion + FIR_SWIFT_NAME(getToken(completion:)) __attribute__((deprecated)); + +/** @fn getIDTokenForcingRefresh:completion: + @brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired. + + @param forceRefresh Forces a token refresh. Useful if the token becomes invalid for some reason + other than an expiration. + @param completion Optionally; the block invoked when the token is available. Invoked + asynchronously on the main thread in the future. + + @remarks The authentication token will be refreshed (by making a network request) if it has + expired, or if @c forceRefresh is YES. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)getIDTokenForcingRefresh:(BOOL)forceRefresh + completion:(nullable FIRAuthTokenCallback)completion; + +/** @fn getTokenForcingRefresh:completion: + @brief Please use getIDTokenForcingRefresh:completion instead. + + @param forceRefresh Forces a token refresh. Useful if the token becomes invalid for some reason + other than an expiration. + @param completion Optionally; the block invoked when the token is available. Invoked + asynchronously on the main thread in the future. + + @remarks The authentication token will be refreshed (by making a network request) if it has + expired, or if @c forceRefresh is YES. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. + */ +- (void)getTokenForcingRefresh:(BOOL)forceRefresh + completion:(nullable FIRAuthTokenCallback)completion + __attribute__((deprecated)); + +/** @fn linkWithCredential:completion: + @brief Convenience method for @c linkAndRetrieveDataWithCredential:completion: This method + doesn't return additional identity provider data. + */ +- (void)linkWithCredential:(FIRAuthCredential *)credential + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn linkAndRetrieveDataWithCredential:completion: + @brief Associates a user account from a third-party identity provider with this user and + returns additional identity provider data. + + @param credential The credential for the identity provider. + @param completion Optionally; the block invoked when the unlinking is complete, or fails. + Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeProviderAlreadyLinked - Indicates an attempt to link a provider of a + type already linked to this account. +
    • +
    • @c FIRAuthErrorCodeCredentialAlreadyInUse - Indicates an attempt to link with a + credential + that has already been linked with a different Firebase account. +
    • +
    • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the identity + provider represented by the credential are not enabled. Enable them in the Auth section + of the Firebase console. +
    • +
    + + @remarks This method may also return error codes associated with updateEmail:completion: and + updatePassword:completion: on FIRUser. + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *) credential + completion:(nullable FIRAuthDataResultCallback) completion; + +/** @fn unlinkFromProvider:completion: + @brief Disassociates a user account from a third-party identity provider with this user. + + @param provider The provider ID of the provider to unlink. + @param completion Optionally; the block invoked when the unlinking is complete, or fails. + Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeNoSuchProvider - Indicates an attempt to unlink a provider + that is not linked to the account. +
    • +
    • @c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive + operation that requires a recent login from the user. This error indicates the user + has not signed in recently enough. To resolve, reauthenticate the user by invoking + reauthenticateWithCredential:completion: on FIRUser. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)unlinkFromProvider:(NSString *)provider + completion:(nullable FIRAuthResultCallback)completion; + +/** @fn sendEmailVerificationWithCompletion: + @brief Initiates email verification for the user. + + @param completion Optionally; the block invoked when the request to send an email verification + is complete, or fails. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was + sent in the request. +
    • +
    • @c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in + the console for this action. +
    • +
    • @c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for + sending update email. +
    • +
    • @c FIRAuthErrorCodeUserNotFound - Indicates the user account was not found.
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + */ +- (void)sendEmailVerificationWithCompletion:(nullable FIRSendEmailVerificationCallback)completion; + +/** @fn deleteWithCompletion: + @brief Deletes the user account (also signs out the user, if this was the current user). + + @param completion Optionally; the block invoked when the request to delete the account is + complete, or fails. Invoked asynchronously on the main thread in the future. + + @remarks Possible error codes: +
      +
    • @c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive + operation that requires a recent login from the user. This error indicates the user + has not signed in recently enough. To resolve, reauthenticate the user by invoking + reauthenticateWithCredential:completion: on FIRUser. +
    • +
    + + @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. + + */ +- (void)deleteWithCompletion:(nullable FIRUserProfileChangeCallback)completion; + +@end + +/** @class FIRUserProfileChangeRequest + @brief Represents an object capable of updating a user's profile data. + @remarks Properties are marked as being part of a profile update when they are set. Setting a + property value to nil is not the same as leaving the property unassigned. + */ +FIR_SWIFT_NAME(UserProfileChangeRequest) +@interface FIRUserProfileChangeRequest : NSObject + +/** @fn init + @brief Please use @c FIRUser.profileChangeRequest + */ +- (instancetype)init NS_UNAVAILABLE; + +/** @property displayName + @brief The user's display name. + @remarks It is an error to set this property after calling + @c FIRUserProfileChangeRequest.commitChangesWithCallback: + */ +@property(nonatomic, copy, nullable) NSString *displayName; + +/** @property photoURL + @brief The user's photo URL. + @remarks It is an error to set this property after calling + @c FIRUserProfileChangeRequest.commitChangesWithCallback: + */ +@property(nonatomic, copy, nullable) NSURL *photoURL; + +/** @fn commitChangesWithCompletion: + @brief Commits any pending changes. + @remarks This method should only be called once. Once called, property values should not be + changed. + + @param completion Optionally; the block invoked when the user profile change has been applied. + Invoked asynchronously on the main thread in the future. + */ +- (void)commitChangesWithCompletion:(nullable FIRUserProfileChangeCallback)completion; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUserInfo.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUserInfo.h new file mode 100755 index 000000000..c4d90f9bc --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FIRUserInfo.h @@ -0,0 +1,53 @@ +/** @file FIRUserInfo.h + @brief Firebase Auth SDK + @copyright Copyright 2015 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +#import "FIRAuthSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + @brief Represents user data returned from an identity provider. + */ +FIR_SWIFT_NAME(UserInfo) +@protocol FIRUserInfo + +/** @property providerID + @brief The provider identifier. + */ +@property(nonatomic, copy, readonly) NSString *providerID; + +/** @property uid + @brief The provider's user ID for the user. + */ +@property(nonatomic, copy, readonly) NSString *uid; + +/** @property displayName + @brief The name of the user. + */ +@property(nonatomic, copy, readonly, nullable) NSString *displayName; + +/** @property photoURL + @brief The URL of the user's profile photo. + */ +@property(nonatomic, copy, readonly, nullable) NSURL *photoURL; + +/** @property email + @brief The user's email address. + */ +@property(nonatomic, copy, readonly, nullable) NSString *email; + +/** @property phoneNumber + @brief A phone number associated with the user. + @remarks This property is only available for users authenticated via phone number auth. + */ +@property(nonatomic, readonly, nullable) NSString *phoneNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuth.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuth.h new file mode 100755 index 000000000..f93215271 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuth.h @@ -0,0 +1,18 @@ +#import "FIREmailAuthProvider.h" +#import "FIRFacebookAuthProvider.h" +#import "FIRGitHubAuthProvider.h" +#import "FIRGoogleAuthProvider.h" +#import "FIROAuthProvider.h" +#import "FIRPhoneAuthCredential.h" +#import "FIRPhoneAuthProvider.h" +#import "FIRTwitterAuthProvider.h" +#import "FIRAdditionalUserInfo.h" +#import "FIRAuth.h" +#import "FIRAuthAPNSTokenType.h" +#import "FIRAuthCredential.h" +#import "FIRAuthDataResult.h" +#import "FIRAuthErrors.h" +#import "FIRAuthSwiftNameSupport.h" +#import "FIRUser.h" +#import "FIRUserInfo.h" +#import "FirebaseAuthVersion.h" diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h new file mode 100755 index 000000000..3f29d7b86 --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h @@ -0,0 +1,18 @@ +/*! @file FirebaseAuthVersion.h + @brief Firebase SDK + @copyright Copyright 2016 Google Inc. + @remarks Use of this SDK is subject to the Google APIs Terms of Service: + https://developers.google.com/terms/ + */ + +#import + +/** + Version number for FirebaseAuth. + */ +extern const double FirebaseAuthVersionNumber; + +/** + Version string for FirebaseAuth. + */ +extern const unsigned char *const FirebaseAuthVersionString; diff --git a/src/ios/Firebase/Auth/FirebaseAuth.framework/Modules/module.modulemap b/src/ios/Firebase/Auth/FirebaseAuth.framework/Modules/module.modulemap new file mode 100755 index 000000000..dc8c8c6ca --- /dev/null +++ b/src/ios/Firebase/Auth/FirebaseAuth.framework/Modules/module.modulemap @@ -0,0 +1,7 @@ +framework module FirebaseAuth { + umbrella header "FirebaseAuth.h" + export * + module * { export *} + link "z" + link framework "Security" +} \ No newline at end of file diff --git a/src/ios/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher b/src/ios/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher new file mode 100644 index 000000000..756a7070e Binary files /dev/null and b/src/ios/Firebase/Auth/GTMSessionFetcher.framework/GTMSessionFetcher differ diff --git a/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash b/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash index 7cf08c10a..2463566d6 100755 Binary files a/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash and b/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash differ diff --git a/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrash.h b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrash.h new file mode 100755 index 000000000..a1c5eba7a --- /dev/null +++ b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrash.h @@ -0,0 +1,24 @@ +#import "FIRCrashLog.h" + +FIR_SWIFT_NAME(Crash) +@interface FIRCrash : NSObject + +/** + * FirebaseCrash instance using the default FIRApp. + */ ++ (FIRCrash *)sharedInstance NS_SWIFT_NAME(sharedInstance()); + +/** + * Is crash reporting enabled? If crash reporting was previously enabled, the exception handler will + * remain installed, but crashes will not be transmitted. + * + * This setting is persisted, and is applied on future invocations of your application. Once + * explicitly set, it overrides any settings in your Info.plist. + * + * By default, crash reporting is enabled. If you need to change the default (for example, because + * you want to prompt the user before collecting crashes) set firebase_crash_enabled to false in + * your application's Info.plist. + */ +@property(nonatomic, assign, getter=isCrashCollectionEnabled) BOOL crashCollectionEnabled; + +@end diff --git a/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h index ac446a621..84af99cab 100755 --- a/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h +++ b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h @@ -1,5 +1,15 @@ #import +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + NS_ASSUME_NONNULL_BEGIN /** @@ -23,6 +33,7 @@ NS_ASSUME_NONNULL_BEGIN * @param ap A variable argument list. */ FOUNDATION_EXTERN NS_FORMAT_FUNCTION(1, 0) +NS_SWIFT_UNAVAILABLE("Use `FirebaseCrashMessage(_:)` instead.") void FIRCrashLogv(NSString *format, va_list ap); /** @@ -79,6 +90,7 @@ void FIRCrashLog(NSString *format, ...) { * @param ap A variable argument list. */ FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 0) +FIR_SWIFT_NAME(FirebaseCrashNSLogv(_:_:)) void FIRCrashNSLogv(NSString *format, va_list ap) { va_list ap2; @@ -142,11 +154,11 @@ void FIRCrashNSLog(NSString *format, ...) { * crash reporter. Excessively long messages will be truncated * safely but that will introduce a delay in submitting the message. * - * @param Message A log message + * @param message A log message * * @see FIRCrashLog(format, ...) */ -FOUNDATION_STATIC_INLINE +FOUNDATION_STATIC_INLINE FIR_SWIFT_NAME(FirebaseCrashMessage(_:)) void FIRCrashMessage(NSString *message) { FIRCrashLog(@"%@", message); } diff --git a/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h index 186592140..efdecc080 100755 --- a/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h +++ b/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h @@ -1 +1,2 @@ +#import "FIRCrash.h" #import "FIRCrashLog.h" diff --git a/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap b/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap index 537a790a3..fc966c4f2 100755 --- a/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap +++ b/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap @@ -2,11 +2,10 @@ framework module FirebaseCrash { umbrella header "FirebaseCrash.h" export * module * { export *} + link "c++" link "sqlite3" link "z" - link framework "CoreGraphics" link framework "CoreTelephony" - link framework "Foundation" link framework "SystemConfiguration" link framework "UIKit" } \ No newline at end of file diff --git a/src/ios/Firebase/Crash/Protobuf.framework/Protobuf b/src/ios/Firebase/Crash/Protobuf.framework/Protobuf index 546e02ec5..838bacd8d 100644 Binary files a/src/ios/Firebase/Crash/Protobuf.framework/Protobuf and b/src/ios/Firebase/Crash/Protobuf.framework/Protobuf differ diff --git a/src/ios/Firebase/Crash/README.md b/src/ios/Firebase/Crash/README.md new file mode 100755 index 000000000..3f0959c42 --- /dev/null +++ b/src/ios/Firebase/Crash/README.md @@ -0,0 +1,54 @@ +# Firebase Crash Reporting + +Firebase Crash Reporting is a free mobile crash analytics service. It provides +detailed analytics and diagnostic information about the crashes encountered +by your users. For more information about crash reporting and many other +cool mobile services, check out [Firebase] (https://firebase.google.com). + +## Getting Started with Cocoapods + +1. Follow the instructions for + [setting up Firebase](https://developers.google.com/firebase/docs/ios/) +2. Add the following to your Podfile + + ``` + pod 'Firebase/Crash' + ``` + +3. Set up automatic symbol file uploads. Symbol files are required to + turn your stack traces into pretty classes and selectors. In + Xcode, click on your project file, choose your application target, + select "Build Phases", hit the little + sign to add a phase, + then select "Run Script". Fill the resulting build step with: + + ``` + "${PODS_ROOT}"/FirebaseCrash/upload-sym + ``` + +## Testing Integration + +In order to try out integration, you need to force a crash +**while not attached to the debugger**. The debugger will +intercept all crashes, preventing Firebase Crash Reporting from +gathering any useful information. + +1. Add a crash somewhere in your app. This will do the trick: + + ``` + abort(); + ``` + +2. Run your app to get the latest code installed on the test + device, then once the app has launched, hit stop. + +3. Relaunch your app directly from the test device and trigger the crash. + +4. Restart your app (either in the debugger or not) and the crash will be + uploaded. Wait at least 10 seconds. Firebase Crash Reporting delays + crash uploading at startup to avoid creating contention with your own code. + +5. Your crash should show up in Firebase within 20 minutes. + +More information can be found in the +[Firebase documentation](https://developers.google.com/firebase/). +Happy bug hunting! diff --git a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging index a0573d06c..095a9fc4b 100755 Binary files a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging and b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging differ diff --git a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h index a0ae2e90b..84d2526bb 100755 --- a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h +++ b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h @@ -1,5 +1,61 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + +/** + * @related FIRMessaging + * + * The completion handler invoked when the registration token returns. + * If the call fails we return the appropriate `error code`, described by + * `FIRMessagingError`. + * + * @param FCMToken The valid registration token returned by FCM. + * @param error The error describing why a token request failed. The error code + * will match a value from the FIRMessagingError enumeration. + */ +typedef void(^FIRMessagingFCMTokenFetchCompletion)(NSString * _Nullable FCMToken, + NSError * _Nullable error) + FIR_SWIFT_NAME(MessagingFCMTokenFetchCompletion); + + +/** + * @related FIRMessaging + * + * The completion handler invoked when the registration token deletion request is + * completed. If the call fails we return the appropriate `error code`, described + * by `FIRMessagingError`. + * + * @param error The error describing why a token deletion failed. The error code + * will match a value from the FIRMessagingError enumeration. + */ +typedef void(^FIRMessagingDeleteFCMTokenCompletion)(NSError * _Nullable error) + FIR_SWIFT_NAME(MessagingDeleteFCMTokenCompletion); + /** * The completion handler invoked once the data connection with FIRMessaging is * established. The data connection is used to send a continous stream of @@ -12,14 +68,64 @@ * @param error The error object if any describing why the data connection * to FIRMessaging failed. */ -typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error); +typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error) + FIR_SWIFT_NAME(MessagingConnectCompletion) + __deprecated_msg("Please listen for the FIRMessagingConnectionStateChangedNotification " + "NSNotification instead."); + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Notification sent when the upstream message has been delivered + * successfully to the server. The notification object will be the messageID + * of the successfully delivered message. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendSuccessNotification + FIR_SWIFT_NAME(MessagingSendSuccess); +/** + * Notification sent when the upstream message was failed to be sent to the + * server. The notification object will be the messageID of the failed + * message. The userInfo dictionary will contain the relevant error + * information for the failure. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendErrorNotification + FIR_SWIFT_NAME(MessagingSendError); + +/** + * Notification sent when the Firebase messaging server deletes pending + * messages due to exceeded storage limits. This may occur, for example, when + * the device cannot be reached for an extended period of time. + * + * It is recommended to retrieve any missing messages directly from the + * server. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingMessagesDeletedNotification + FIR_SWIFT_NAME(MessagingMessagesDeleted); + +/** + * Notification sent when Firebase Messaging establishes or disconnects from + * an FCM socket connection. You can query the connection state in this + * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingConnectionStateChangedNotification + FIR_SWIFT_NAME(MessagingConnectionStateChanged); + +/** + * Notification sent when the FCM registration token has been refreshed. You can also + * receive the FCM token via the FIRMessagingDelegate method + * `-messaging:didRefreshRegistrationToken:` + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull + FIRMessagingRegistrationTokenRefreshedNotification + FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshed); +#else /** * Notification sent when the upstream message has been delivered * successfully to the server. The notification object will be the messageID * of the successfully delivered message. */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification; +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification + FIR_SWIFT_NAME(MessagingSendSuccessNotification); /** * Notification sent when the upstream message was failed to be sent to the @@ -27,7 +133,8 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification * message. The userInfo dictionary will contain the relevant error * information for the failure. */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification; +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification + FIR_SWIFT_NAME(MessagingSendErrorNotification); /** * Notification sent when the Firebase messaging server deletes pending @@ -37,7 +144,25 @@ FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification; * It is recommended to retrieve any missing messages directly from the * server. */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification; +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification + FIR_SWIFT_NAME(MessagingMessagesDeletedNotification); + +/** + * Notification sent when Firebase Messaging establishes or disconnects from + * an FCM socket connection. You can query the connection state in this + * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingConnectionStateChangedNotification + FIR_SWIFT_NAME(MessagingConnectionStateChangedNotification); + +/** + * Notification sent when the FCM registration token has been refreshed. You can also + * receive the FCM token via the FIRMessagingDelegate method + * `-messaging:didRefreshRegistrationToken:` + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingRegistrationTokenRefreshedNotification + FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshedNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * @enum FIRMessagingError @@ -63,7 +188,7 @@ typedef NS_ENUM(NSUInteger, FIRMessagingError) { /// Some parameters of the request were invalid. FIRMessagingErrorInvalidRequest = 7, -}; +} FIR_SWIFT_NAME(MessagingError); /// Status for the downstream message received by the app. typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { @@ -71,9 +196,26 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { FIRMessagingMessageStatusUnknown, /// New downstream message received by the app. FIRMessagingMessageStatusNew, -}; +} FIR_SWIFT_NAME(MessagingMessageStatus); + +/** + * The APNS token type for the app. If the token type is set to `UNKNOWN` + * Firebase Messaging will implicitly try to figure out what the actual token type + * is from the provisioning profile. + * Unless you really need to specify the type, you should use the `APNSToken` + * property instead. + */ +typedef NS_ENUM(NSInteger, FIRMessagingAPNSTokenType) { + /// Unknown token type. + FIRMessagingAPNSTokenTypeUnknown, + /// Sandbox token type. + FIRMessagingAPNSTokenTypeSandbox, + /// Production token type. + FIRMessagingAPNSTokenTypeProd, +} FIR_SWIFT_NAME(MessagingAPNSTokenType); /// Information about a downstream message received by the app. +FIR_SWIFT_NAME(MessagingMessageInfo) @interface FIRMessagingMessageInfo : NSObject /// The status of the downstream message @@ -87,23 +229,43 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use * the local and remote notifications handlers defined in UIApplicationDelegate protocol. */ +FIR_SWIFT_NAME(MessagingRemoteMessage) @interface FIRMessagingRemoteMessage : NSObject /// The downstream message received by the application. @property(nonatomic, readonly, strong, nonnull) NSDictionary *appData; - @end +@class FIRMessaging; /** - * A protocol to receive data message via FCM for devices running iOS 10 or above. + * A protocol to handle events from FCM for devices running iOS 10 or above. * * To support devices running iOS 9 or below, use the local and remote notifications handlers * defined in UIApplicationDelegate protocol. */ +FIR_SWIFT_NAME(MessagingDelegate) @protocol FIRMessagingDelegate +/// This method will be called whenever FCM receives a new, default FCM token for your +/// Firebase project's Sender ID. +/// You can send this token to your application server to send notifications to this device. +- (void)messaging:(nonnull FIRMessaging *)messaging + didRefreshRegistrationToken:(nonnull NSString *)fcmToken + FIR_SWIFT_NAME(messaging(_:didRefreshRegistrationToken:)); + +@optional +/// This method is called on iOS 10 devices to handle data messages received via FCM through its +/// direct channel (not via APNS). For iOS 9 and below, the FCM data message is delivered via the +/// UIApplicationDelegate's -application:didReceiveRemoteNotification: method. +- (void)messaging:(nonnull FIRMessaging *)messaging + didReceiveMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage + FIR_SWIFT_NAME(messaging(_:didReceive:)) + __IOS_AVAILABLE(10.0); + /// The callback to handle data message received via FCM for devices running iOS 10 or above. -- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage; +- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage + FIR_SWIFT_NAME(application(received:)) + __deprecated_msg("Use FIRMessagingDelegate’s -messaging:didReceiveMessage:"); @end @@ -115,28 +277,122 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * app server to send messages to an app instance. * * In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`. - * - * */ +FIR_SWIFT_NAME(Messaging) @interface FIRMessaging : NSObject +/** + * Delegate to handle FCM token refreshes, and remote data messages received via FCM for devices + * running iOS 10 or above. + */ +@property(nonatomic, weak, nullable) id delegate; + + /** * Delegate to handle remote data messages received via FCM for devices running iOS 10 or above. */ -@property(nonatomic, weak, nullable) id remoteMessageDelegate; +@property(nonatomic, weak, nullable) id remoteMessageDelegate + __deprecated_msg("Use 'delegate' property"); + +/** + * When set to YES, Firebase Messaging will automatically establish a socket-based, direct channel + * to the FCM server. You only need to enable this if you are sending upstream messages or + * receiving non-APNS, data-only messages in foregrounded apps. + * Default is NO. + */ +@property(nonatomic) BOOL shouldEstablishDirectChannel; + +/** + * Returns YES if the direct channel to the FCM server is active, NO otherwise. + */ +@property(nonatomic, readonly) BOOL isDirectChannelEstablished; /** * FIRMessaging * * @return An instance of FIRMessaging. */ -+ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging()); ++ (nonnull instancetype)messaging FIR_SWIFT_NAME(messaging()); /** * Unavailable. Use +messaging instead. */ - (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead."))); +#pragma mark - APNS + +/** + * This property is used to set the APNS Token received by the application delegate. + * + * FIRMessaging uses method swizzling to ensure the APNS token is set automatically. + * However, if you have disabled swizzling by setting `FirebaseAppDelegateProxyEnabled` + * to `NO` in your app's Info.plist, you should manually set the APNS token in your + * application delegate's -application:didRegisterForRemoteNotificationsWithDeviceToken: + * method. + * + * If you would like to set the type of the APNS token, rather than relying on automatic + * detection, see: -setAPNSToken:type:. + */ +@property(nonatomic, copy, nullable) NSData *APNSToken FIR_SWIFT_NAME(apnsToken); + +/** + * Set APNS token for the application. This APNS token will be used to register + * with Firebase Messaging using `FCMToken` or + * `tokenWithAuthorizedEntity:scope:options:handler`. + * + * @param apnsToken The APNS token for the application. + * @param type The type of APNS token. Debug builds should use + * FIRMessagingAPNSTokenTypeSandbox. Alternatively, you can supply + * FIRMessagingAPNSTokenTypeUnknown to have the type automatically + * detected based on your provisioning profile. + */ +- (void)setAPNSToken:(nonnull NSData *)apnsToken type:(FIRMessagingAPNSTokenType)type; + +#pragma mark - FCM Tokens + +/** + * The FCM token is used to identify this device so that FCM can send notifications to it. + * It is associated with your APNS token when the APNS token is supplied, so that sending + * messages to the FCM token will be delivered over APNS. + * + * The FCM token is sometimes refreshed automatically. You can be notified of these changes + * via the FIRMessagingDelegate method `-message:didRefreshRegistrationToken:`, or by + * listening for the `FIRMessagingRegistrationTokenRefreshedNotification` notification. + * + * Once you have an FCM token, you should send it to your application server, so it can use + * the FCM token to send notifications to your device. + */ +@property(nonatomic, readonly, nullable) NSString *FCMToken FIR_SWIFT_NAME(fcmToken); + + +/** + * Retrieves an FCM registration token for a particular Sender ID. This registration token is + * not cached by FIRMessaging. FIRMessaging should have an APNS token set before calling this + * to ensure that notifications can be delivered via APNS using this FCM token. You may + * re-retrieve the FCM token once you have the APNS token set, to associate it with the FCM + * token. The default FCM token is automatically associated with the APNS token, if the APNS + * token data is available. + * + * @param senderID The Sender ID for a particular Firebase project. + * @param completion The completion handler to handle the token request. + */ +- (void)retrieveFCMTokenForSenderID:(nonnull NSString *)senderID + completion:(nonnull FIRMessagingFCMTokenFetchCompletion)completion + FIR_SWIFT_NAME(retrieveFCMToken(forSenderID:completion:)); + + +/** + * Invalidates an FCM token for a particular Sender ID. That Sender ID cannot no longer send + * notifications to that FCM token. + * + * @param senderID The senderID for a particular Firebase project. + * @param completion The completion handler to handle the token deletion. + */ +- (void)deleteFCMTokenForSenderID:(nonnull NSString *)senderID + completion:(nonnull FIRMessagingDeleteFCMTokenCompletion)completion + FIR_SWIFT_NAME(deleteFCMToken(forSenderID:completion:)); + + #pragma mark - Connect /** @@ -151,7 +407,9 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * the same time, FIRMessaging performs exponential backoff to retry * establishing a connection and invoke the handler when successful. */ -- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler; +- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler + FIR_SWIFT_NAME(connect(handler:)) + __deprecated_msg("Please use the shouldEstablishDirectChannel property instead."); /** * Disconnect the current FIRMessaging data connection. This stops any attempts to @@ -161,7 +419,8 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * Since the FIRMessaging connection won't be allowed to live when in background it is * prudent to close the connection. */ -- (void)disconnect; +- (void)disconnect + __deprecated_msg("Please use the shouldEstablishDirectChannel property instead."); #pragma mark - Topics @@ -170,14 +429,14 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * * @param topic The name of the topic, for example, @"sports". */ -- (void)subscribeToTopic:(nonnull NSString *)topic; +- (void)subscribeToTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(subscribe(toTopic:)); /** * Asynchronously unsubscribe from a topic. * * @param topic The name of the topic, for example @"sports". */ -- (void)unsubscribeFromTopic:(nonnull NSString *)topic; +- (void)unsubscribeFromTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(unsubscribe(fromTopic:)); #pragma mark - Upstream @@ -190,7 +449,7 @@ typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { * * @param message Key/Value pairs to be sent. Values must be String, any * other type will be ignored. - * @param to A string identifying the receiver of the message. For FCM + * @param receiver A string identifying the receiver of the message. For FCM * project IDs the value is `SENDER_ID@gcm.googleapis.com`. * @param messageID The ID of the message. This is generated by the application. It * must be unique for each message generated by this application. diff --git a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap index 80bc59c15..45dc7bc07 100755 --- a/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap +++ b/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap @@ -4,8 +4,4 @@ framework module FirebaseMessaging { module * { export *} link "sqlite3" link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "SystemConfiguration" - link framework "UIKit" } \ No newline at end of file diff --git a/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf b/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf index 546e02ec5..838bacd8d 100644 Binary files a/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf and b/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf differ diff --git a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig index 456378621..f5c678719 100755 Binary files a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig and b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig differ diff --git a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h index 395020ca6..caa6526be 100755 --- a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h +++ b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h @@ -5,15 +5,27 @@ // #import +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + /// The Firebase Remote Config service default namespace, to be used if the API method does not /// specify a different namespace. Use the default namespace if configuring from the Google Firebase /// service. -extern NSString *const __nonnull FIRNamespaceGoogleMobilePlatform; +extern NSString *const __nonnull FIRNamespaceGoogleMobilePlatform + FIR_SWIFT_NAME(NamespaceGoogleMobilePlatform); /// Key used to manage throttling in NSError user info when the refreshing of Remote Config /// parameter values (data) is throttled. The value of this key is the elapsed time since 1970, /// measured in seconds. -extern NSString *const __nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey; +extern NSString *const __nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey + FIR_SWIFT_NAME(RemoteConfigThrottledEndTimeInSecondsKey); /// Indicates whether updated data was successfully fetched. typedef NS_ENUM(NSInteger, FIRRemoteConfigFetchStatus) { @@ -25,10 +37,10 @@ typedef NS_ENUM(NSInteger, FIRRemoteConfigFetchStatus) { FIRRemoteConfigFetchStatusFailure, /// Config fetch was throttled. FIRRemoteConfigFetchStatusThrottled, -}; +} FIR_SWIFT_NAME(RemoteConfigFetchStatus); /// Remote Config error domain that handles errors when fetching data from the service. -extern NSString *const __nonnull FIRRemoteConfigErrorDomain; +extern NSString *const __nonnull FIRRemoteConfigErrorDomain FIR_SWIFT_NAME(RemoteConfigErrorDomain); /// Firebase Remote Config service fetch error. typedef NS_ENUM(NSInteger, FIRRemoteConfigError) { /// Unknown or no error. @@ -37,7 +49,7 @@ typedef NS_ENUM(NSInteger, FIRRemoteConfigError) { FIRRemoteConfigErrorThrottled = 8002, /// Internal error that covers all internal HTTP errors. FIRRemoteConfigErrorInternalError = 8003, -}; +} FIR_SWIFT_NAME(RemoteConfigError); /// Enumerated value that indicates the source of Remote Config data. Data can come from /// the Remote Config service, the DefaultConfig that is available when the app is first installed, @@ -46,18 +58,20 @@ typedef NS_ENUM(NSInteger, FIRRemoteConfigSource) { FIRRemoteConfigSourceRemote, ///< The data source is the Remote Config service. FIRRemoteConfigSourceDefault, ///< The data source is the DefaultConfig defined for this app. FIRRemoteConfigSourceStatic, ///< The data doesn't exist, return a static initialized value. -}; +} FIR_SWIFT_NAME(RemoteConfigSource); /// Completion handler invoked by fetch methods when they get a response from the server. /// /// @param status Config fetching status. /// @param error Error message on failure. typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status, - NSError *__nullable error); + NSError *__nullable error) + FIR_SWIFT_NAME(RemoteConfigFetchCompletion); #pragma mark - FIRRemoteConfigValue /// This class provides a wrapper for Remote Config parameter values, with methods to get parameter /// values as different data types. +FIR_SWIFT_NAME(RemoteConfigValue) @interface FIRRemoteConfigValue : NSObject /// Gets the value as a string. @property(nonatomic, readonly, nullable) NSString *stringValue; @@ -73,6 +87,7 @@ typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status #pragma mark - FIRRemoteConfigSettings /// Firebase Remote Config settings. +FIR_SWIFT_NAME(RemoteConfigSettings) @interface FIRRemoteConfigSettings : NSObject /// Indicates whether Developer Mode is enabled. @property(nonatomic, readonly) BOOL isDeveloperModeEnabled; @@ -86,6 +101,7 @@ typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status #pragma mark - FIRRemoteConfig /// Firebase Remote Config class. The shared instance method +remoteConfig can be created and used /// to fetch, activate and read config results and set default config results. +FIR_SWIFT_NAME(RemoteConfig) @interface FIRRemoteConfig : NSObject /// Last successful fetch completion time. @property(nonatomic, readonly, strong, nullable) NSDate *lastFetchTime; @@ -102,7 +118,7 @@ typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status /// service, you should use this class method to create a shared instance of the FIRRemoteConfig /// object to ensure that your app will function properly with the Remote Config Server and the /// Firebase service. -+ (nonnull FIRRemoteConfig *)remoteConfig NS_SWIFT_NAME(remoteConfig()); ++ (nonnull FIRRemoteConfig *)remoteConfig FIR_SWIFT_NAME(remoteConfig()); /// Unavailable. Use +remoteConfig instead. - (nonnull instancetype)init __attribute__((unavailable("Use +remoteConfig instead."))); @@ -188,21 +204,22 @@ typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status #pragma mark - Defaults /// Sets config defaults for parameter keys and values in the default namespace config. /// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. +/// @param defaults A dictionary mapping a NSString * key to a NSObject * value. - (void)setDefaults:(nullable NSDictionary *)defaults; /// Sets config defaults for parameter keys and values in the default namespace config. /// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. +/// @param defaults A dictionary mapping a NSString * key to a NSObject * value. /// @param aNamespace Config under a given namespace. -- (void)setDefaults:(nullable NSDictionary *)defaultConfig +- (void)setDefaults:(nullable NSDictionary *)defaults namespace:(nullable NSString *)aNamespace; /// Sets default configs from plist for default namespace; /// @param fileName The plist file name, with no file name extension. For example, if the plist file /// is defaultSamples.plist, call: /// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; -- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName; +- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName + FIR_SWIFT_NAME(setDefaults(fromPlist:)); /// Sets default configs from plist for a given namespace; /// @param fileName The plist file name, with no file name extension. For example, if the plist file @@ -210,7 +227,8 @@ typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status /// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; /// @param aNamespace The namespace where the default config is set. - (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName - namespace:(nullable NSString *)aNamespace; + namespace:(nullable NSString *)aNamespace + FIR_SWIFT_NAME(setDefaults(fromPlist:namespace:)); /// Returns the default value of a given key and a given namespace from the default config. /// diff --git a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap index a6627f5e6..bc93fe24b 100755 --- a/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap +++ b/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap @@ -2,10 +2,7 @@ framework module FirebaseRemoteConfig { umbrella header "FirebaseRemoteConfig.h" export * module * { export *} - link "c++" link "sqlite3" link "z" - link framework "CoreGraphics" - link framework "Foundation" link framework "UIKit" } \ No newline at end of file diff --git a/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf b/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf index 546e02ec5..838bacd8d 100644 Binary files a/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf and b/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf differ diff --git a/src/ios/FirebasePlugin.h b/src/ios/FirebasePlugin.h index a88ce4522..58b4cf603 100755 --- a/src/ios/FirebasePlugin.h +++ b/src/ios/FirebasePlugin.h @@ -3,6 +3,7 @@ @interface FirebasePlugin : CDVPlugin + (FirebasePlugin *) firebasePlugin; +- (void)getVerificationID:(CDVInvokedUrlCommand*)command; - (void)getInstanceId:(CDVInvokedUrlCommand*)command; - (void)getToken:(CDVInvokedUrlCommand*)command; - (void)grantPermission:(CDVInvokedUrlCommand*)command; diff --git a/src/ios/FirebasePlugin.m b/src/ios/FirebasePlugin.m index d7dbf788d..13e44d8d8 100644 --- a/src/ios/FirebasePlugin.m +++ b/src/ios/FirebasePlugin.m @@ -6,6 +6,7 @@ @import FirebaseMessaging; @import FirebaseAnalytics; @import FirebaseRemoteConfig; +@import FirebaseAuth; #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 @import UserNotifications; @@ -117,6 +118,38 @@ - (void)setBadgeNumber:(CDVInvokedUrlCommand *)command { }]; } + +- (void)getVerificationID:(CDVInvokedUrlCommand *)command { + NSString* number = [command.arguments objectAtIndex:0]; + + [[FIRPhoneAuthProvider provider] + verifyPhoneNumber:number + completion:^(NSString *_Nullable verificationID, + NSError *_Nullable error) { +NSDictionary *message; + if (error) { + + // Verification code not sent. + message = @{ + @"code": [NSNumber numberWithInteger:error.code], + @"description": error.description == nil ? [NSNull null] : error.description + }; + + CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:message]; + + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + + } else { + // Successful. +CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:verificationID]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + } +}]; + + + +} + - (void)getBadgeNumber:(CDVInvokedUrlCommand *)command { [self.commandDelegate runInBackground:^{ long badge = [[UIApplication sharedApplication] applicationIconBadgeNumber]; diff --git a/www/firebase-browser.js b/www/firebase-browser.js index 93e3936fd..440a5fcc8 100755 --- a/www/firebase-browser.js +++ b/www/firebase-browser.js @@ -1,3 +1,9 @@ +exports.getVerificationID = function(number, success, error) { + if (typeof success === 'function') { + success(); + } +}; + exports.getInstanceId = function(success, error) { if (typeof success === 'function') { success(); diff --git a/www/firebase.js b/www/firebase.js index 4d350b8c3..1ff8fe7a7 100644 --- a/www/firebase.js +++ b/www/firebase.js @@ -1,4 +1,7 @@ var exec = require('cordova/exec'); +exports.getVerificationID = function(number, success, error) { + exec(success, error, "FirebasePlugin", "getVerificationID", [number]); +}; exports.getInstanceId = function(success, error) { exec(success, error, "FirebasePlugin", "getInstanceId", []);