application(_:continue:restorationHandler:)

AppDelegate.reachfive().application(application, continue: userActivity, restorationHandler: restorationHandler)

Description

Allows ReachFive to handle user activity continuation such as handoffs, and more importantly, universal links.

This method is required by WeChat and by any universal-link provider (such as B.connect): when an external app reopens your app via a universal link to finish a login, the SDK completes the in-flight web authentication session out-of-band through this hook.

Call this method in response to the equivalent UIKit method application(:continue:restorationHandler:). If your app uses scenes, forward scene(:continue:) here as well.

The method returns a Bool that tells you whether ReachFive actually consumed the activity. It returns true only when a ReachFive login was waiting for that universal link; otherwise it returns false so your app can route the link itself. Do not assume ReachFive handles every universal link you forward — honour the returned value.

Universal-link delivery requires an applinks:<host> Associated Domain (see Configure the SDK).

The in-flight login only lives in memory. If iOS terminates your app while the user is in the external app, the login is lost: when the universal link relaunches your app, this method returns false and the user must start the login again.

Examples

import Reach5
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
        return AppDelegate.reachfive().application(application, continue: userActivity, restorationHandler: restorationHandler)
    }
}

Parameters

Parameter Description

application UIApplication

The UIKit Application instance.

For more details, see Apple: UIApplication.

userActivity NSUserActivity

The activity object containing the data associated with the task the user was performing.

restorationHandler ([UIUserActivityRestoring]?) → Void

A block to execute if your app creates objects to perform the task the user was performing.

R5 AI Assistant

Confirm Deletion