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 configure] as a target app for new invites. This property allows retrieving a copy of that |GINInviteTargetApplication|.

    Declaration

    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

    Objective-C

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

    Declaration

    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

    Objective-C

    + (nullable id)handleURL:(nonnull NSURL *)url
           sourceApplication:(nullable NSString *)sourceApplication
                  annotation:(nullable id)annotation;
  • Convenience method to handle a Universal Link whether it is long or short. A long link will call the handler immediately, but a short link may not.

    Declaration

    Objective-C

    + (BOOL)handleUniversalLink:(nonnull NSURL *)URL
                     completion:(nonnull FIRInvitesUniversalLinkHandler)completion;

    Parameters

    URL

    A Universal Link URL.

    completion

    A block that handles the outcome of attempting to create a FIRReceivedInvite.

    Return Value

    YES if FIRInvites is handling the link, otherwise, NO.

  • 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

    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

    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

    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

    Objective-C

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

    Declaration

    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

    Objective-C

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

    Declaration

    Objective-C

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