ForgeRock SDKs 3.3

Integrate the SDK into your app

To initialize the ForgeRock iOS SDK for your application, perform one of the following procedures:

CocoaPods is a dependency manager for iOS projects. CocoaPods provides developers with a simple way to integrate the ForgeRock iOS SDK into their project.

  1. If you do not already have CocoaPods, install the latest version of CocoaPods.

  2. In a terminal, navigate to the project location/root folder.

  3. Run pod init.

  4. Edit the resulting Podfile.

  5. On the line after the # Pods for DemoApp comment, add pod 'FRAuth' to the pod file.

  6. Save your changes.

  7. Run pod install.

  8. Close Xcode.

  9. Your DemoApp project should now include a DemoApp.xcworkspace file.

    When you install the SDK using CocoaPods, you must always open your project using this workspace file.

  10. In the terminal, open the .xcworkspace file.

    Xcode opens and displays the workspace that contains your project.

  11. In Xcode, in the left panel, verify that the FRAuth pod appears under Pods > Pods.

  12. To ensure your project builds, select the project and click the Start/Run arrow icon.

    Xcode should display a device simulator.

    You are now ready to develop your app using the ForgeRock iOS SDK.

To embed the SDK in your project

To initialize the ForgeRock iOS SDK, perform one of the following tasks:

  1. To Embed the SDK source code in your project:

    In the left navigation panel, right-click on the project and select Add Files to DemoApp.

    Browse and add the following SDK files to the project:

    • /path/to/forgerock-ios-sdk/FRAuth/FrAuth.xcodeproj

    • /path/to/forgerock-ios-sdk/FRUI/FRUI.xcodeproj

  2. Link your target to the Frameworks of the FRAuth and FRUI projects:

    1. In the left navigation panel, select DemoApp, then select the DemoApp Target.

    2. Under Frameworks, Libraries and Embedded Content, click +, then select and add FRAuth.framework and FRUI.framework.

To embed the SDK in your project

  1. To embed the SDK source code in your project:

    In the left navigation panel, right-click on your project and select Add Files to DemoApp. Browse and add the following SDK files to the project:

    • /path/to/forgerock-ios-sdk/FRAuth/FrAuth.xcodeproj

    • /path/to/forgerock-ios-sdk/FRUI/FRUI.xcodeproj

  2. Link your target to the Frameworks of the FRAuth and FRUI projects:

    1. In the left navigation panel, select DemoApp then select the DemoApp Target.

    2. Under Frameworks, Libraries and Embedded Content, click + then select and add FRAuth.framework and FRUI.framework.

To install the SDK using Swift Package manager

Swift Package Manager is a dependency management tool for Swift code. Swift Package Manager allows developers to easily integrate the ForgeRock iOS SDK into their Xcode project.

  1. In Xcode menu, select File > Add Packages.

  2. In the search bar, enter the ForgeRock SDK for iOS repository URL: https://github.com/ForgeRock/forgerock-ios-sdk.

  3. Beside Dependency Rule, in the version field, enter 3.1.1.

    The ForgeRock iOS SDK is only available via Swift Package Manager for the version 3.0.0 and above. For versions 2.2.0 and earlier, please use CocoaPods instead.
  4. Select the forgerock-ios-sdk package.

  5. Click Add Package.

  6. Select FRAuth and FRCore.

  7. Verify that the modules you selected appear in the left menu.

Copyright © 2010-2022 ForgeRock, all rights reserved.