Invites
class Invites : 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
Swift
var targetApp: FIRInvitesTargetApplication { get set }
-
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)
-
Legacy method to performs initial setup after the application launches. You should call |applicationDidFinishLaunchingWithOptions:| instead.
Declaration
Swift
class func 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?
-
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
Swift
class func handleUniversalLink(_ URL: URL, completion: @escaping InvitesUniversalLinkHandler) -> Bool
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
Swift
class func 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)
-
Returns a invite dialog builder instance. Calls |open| method to create the dialog after setting the parameters as needed.
Declaration
Swift
class func inviteDialog() -> InviteBuilder?
-
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()
-
Sets the API key for API access.
Declaration
Swift
class func setAPIKey(_ apiKey: String)
-
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)
-
Sets the default |FIRInvitesTargetApplication| to be used in the |GINInviteBuilder|.
Declaration
Swift
class func setDefaultOtherPlatformsTargetApplication(_ targetApplication: FIRInvitesTargetApplication)