Rebar iOS App Lifecycle

Monkton, Inc.

Rebar enables developers to get notifications of certain events that occur during the app lifecycle. These are handled through the app configuration settings.

Post Initial Authentication

Developers maybe interested to know when the user has finally authenticated with the server. This can be handled via the postInitialAuthenticationAction method in the RebarAppConfiguration class. Once the user's authentication has been performed, this action is invoked.

For instance, after the user has authenticated, in the example below we will ensure that the photo directory exists:

RebarAppController.default.configuration.postInitialAuthenticationAction = {
    MyAppUtil.default.ensurePhotoDirectory
}

This method will be invoked and the photo directory is created. This is a convenient way to configure a few elements of the app when the users finishes their authentication.

Post Passcode Authentication

Developers maybe interested to know when the user has performed an authentication with the app. This occurs when the app asks for the user to enter a passcode, FaceID, or even automatically authenticating if the app lacks a passcode. This can be handled via the postPasscodeAuthenticationAction method in the RebarAppConfiguration class. Once the user's authentication has been performed, this action is invoked.

For instance, after the user has authenticated, in the example below we will ensure that the photo directory exists:

RebarAppController.default.configuration.postPasscodeAuthenticationAction = {
    MyAppUtil.default.sync
}

This method will be invoked and the app will then sync with the server. This is a convenient way to perform certain actions that are only relevant after the user authenticates with the app.