A newer version of this documentation is available.

View Latest

addPasswordlessCallback

AppDelegate.reachfive().addPasswordlessCallback(passwordlessCallback)

About this command

Add the callback that will be executed when the magic link is intercepted.

Examples

import Reach5

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
      AppDelegate.reachfive().addPasswordlessCallback { result in
        switch (result) {
          case .success(authToken):
            // Handle authToken
          case .failure(error):
            // Handle error
          }
      }

      return true
  }
}

Parameters

Parameter Description

passwordlessCallback PasswordlessCallback

The callback that will be executed when the magic link is intercepted.