FIRInvites

@interface FIRInvites : NSObject

The main entry point for the invite APIs.

  • App Invite requires defining the client ID if the invite is received on a different platform than iOS. If an Android client ID is defined in the GoogleService-Info.plist, the targetApp will automatically be configured by calling [FIRApp configre] as a target app for new invites. This property allows retrieving a copy of that |GINInviteTargetApplication|.

    Declaration

    Swift

    var targetApp: FIRInvitesTargetApplication { get set }

    Objective-C

    @property (assign, readwrite, nonatomic)
        FIRInvitesTargetApplication *_Nonnull targetApp;
  • Performs initial setup after the application launches. You should call this method in |application:didFinishLaunchingWithOptions:| method. For backward compatibility, launchOptions may nil. If nil, the invitation may appear twice on iOS 9 if a user clicks on a link before opening the app.

    Declaration

    Swift

    class func applicationDidFinishLaunching(options launchOptions: [AnyHashable : Any]? = nil)

    Objective-C

    + (void)applicationDidFinishLaunchingWithOptions:
        (nullable NSDictionary *)launchOptions;
  • Legacy method to performs initial setup after the application launches. You should call |applicationDidFinishLaunchingWithOptions:| instead.

    Declaration

    Swift

    class func applicationDidFinishLaunching()

    Objective-C

    + (void)applicationDidFinishLaunching;
  • This method should be called from your |UIApplicationDelegate|’s |application:openURL:sourceApplication:annotation|. sourceApplication and annotation may nil, and there will be no side effects. Returns a |FIRReceivedInvite| instance if the URL is an invite deeplink.

    Declaration

    Swift

    class func handle(_ url: URL, sourceApplication: String?, annotation: Any?) -> Any?

    Objective-C

    + (nullable id)handleURL:(nonnull NSURL *)url
           sourceApplication:(nullable NSString *)sourceApplication
                  annotation:(nullable id)annotation;
  • Sends google analytics data after the invitation flow is completed. You could call this method in your application after you obtain a |FIRReceivedInvite| instance in

    Declaration

    Swift

    class func completeInvitation()

    Objective-C

    + (void)completeInvitation;
  • Marks an invitation as converted. You should call this method in your application after the user performs an action that represents a successful conversion.

    Declaration

    Swift

    class func convertInvitation(_ invitationId: String)

    Objective-C

    + (void)convertInvitation:(nonnull NSString *)invitationId;
  • Returns a invite dialog builder instance. Calls |open| method to create the dialog after setting the parameters as needed.

    Declaration

    Swift

    class func inviteDialog() -> FIRInviteBuilder?

    Objective-C

    + (nullable id<FIRInviteBuilder>)inviteDialog;
  • Closes the active invite dialog immediately, if one exists. Note that it is usually not necessary to call this method, as the invite dialog closes itself once the invite action has completed either successfully or with an error. Only call this method when you need to interrupt the user in the middle of inviting.

    Declaration

    Swift

    class func closeActiveInviteDialog()

    Objective-C

    + (void)closeActiveInviteDialog;
  • Sets the API key for API access.

    Declaration

    Swift

    class func setAPIKey(_ apiKey: String)

    Objective-C

    + (void)setAPIKey:(nonnull NSString *)apiKey;
  • Sets the Google Analytics tracking Id. This is an optional method that you can use to overwrite the value of the tracking Id. If this method is not called, we will use the tracking Id set on the default Google Analytics tracker.

    Declaration

    Swift

    class func setGoogleAnalyticsTrackingId(_ trackingId: String)

    Objective-C

    + (void)setGoogleAnalyticsTrackingId:(nonnull NSString *)trackingId;
  • Sets the default |FIRInvitesTargetApplication| to be used in the |GINInviteBuilder|.

    Declaration

    Swift

    class func setDefaultOtherPlatformsTargetApplication(_ targetApplication: FIRInvitesTargetApplication)

    Objective-C

    + (void)setDefaultOtherPlatformsTargetApplication:
        (nonnull FIRInvitesTargetApplication *)targetApplication;