How do I update and recompile the iOS Authenticator App 1 or 2.x with custom branding?
The purpose of this article is to provide information on updating and recompiling the iOS® ForgeRock Authenticator App so that it can be published to the Apple® App Store. Changes include renaming the App and rebranding changes, such as updating the Splashscreen video, updating the App icon and changing default colors.
Archived
This article has been archived and is no longer maintained by ForgeRock.
Warning
ForgeRock support covers the use of the official binary builds made available and downloaded from our customer portal: BackStage. We will support builds made from source providing no changes have been made to the core code of the product, the product was built from a tag that matches an official release, for example, 6 and said product was built using the ForgeRock build scripts provided as part of the source. In the event that a customer experiences an issue with a ForgeRock product built from source where ForgeRock believe the issue is as a result of the build process, ForgeRock reserves the right to ask the customer to attempt to reproduce the issue on an official ForgeRock binary build. Customers who are running custom builds or who need further clarification should contact their ForgeRock sales representative.
Overview
This article explains how to clone the iOS ForgeRock Authenticator App source code and create your own version of the App that you can publish to the Apple App Store. There is also a section that provides links relevant to setting up Push notifications.
High level steps
- Create a new iOS App Bundle ID
- Obtain Authenticator source, prepare a project and open in Xcode
- Launch the App on an iPhone®
- Rename the project
- Rename the scheme
- Update the CocoaPods configuration
- Rename the ForgeRock-Authenticator directory
- Rename the Entitlements file
- Update the Build settings and rebuild
- Update the Test Build settings
- Update the Splashscreen video
- Update App Permission Request dialogs
- Update Localizable.strings
- Update About.strings
- Update the App icon
- Update the Default Account icon
- Update the Default colors
- Publish your App
These steps were completed using Xcode Version 10.0 (10A255).
Note
Before updating the Authenticator app, please make sure Xcode® is installed and up-to-date.
Create a new iOS App Bundle ID
- Log in to your paid Apple Developer account (http://developer.apple.com/account).
- Select Certificates, Identifiers & Profiles.
- Select App IDs (under Identifiers in the menu on the left).
- Select the “+” (Add) icon.
- Complete the Registering an App ID form:
- Enter an App ID description, for example “ACME Authenticator”.
- Select Explicit App ID and enter a bundle ID, for example “com.acme.authenticator”.
- Leave default selections for App Services (we will enable “Push Notifications” later in this article):
- Select “Register”, then “Done” to complete creation of your new iOS App Bundle ID.
Obtain Authenticator source, prepare a project and open in Xcode
Note
- Git clone the ForgeRock Authenticator iOS repository: $ git clone ssh://git@stash.forgerock.org:7999/openam/forgerock-authenticator-ios.git
- Install CocoaPods. See CocoaPods - Getting Started for further information.
- Prepare the project to be opened in Xcode:
- Navigate to the project’s root directory on the command line and download the project’s dependencies: $ cd forgerock-authenticator-ios $ pod install
- Open the project in Xcode: $ open ForgeRock.xcworkspace/
- Select the “ForgeRock” folder from the “Project Navigator View” in Xcode to view the App’s configuration in the main Xcode view.
- Update the App Identity settings:
- Bundle identifier, this should be the same as set in step 5b in the previous section, for example “com.acme.authenticator”.
- Version, for example “1.0.0”.
- Build, for example “1”.
- Update the App Signing settings:
- Enable “Automatically manage signing”; this is enabled for the official ForgeRock App.
- Team, this should refer to your Apple developer account.
- Provisioning profile, you should have a provisioning profile.
- Signing certificate, you should have a signing certificate.
Before making further changes, now would be a good time to verify that you are able to run the code on a physical device as detailed in Launch the App on an iPhone.
Dependency versions
Downloading the project's dependencies captures the versions in the Podfile.lock file (located in the project's root directory). This ensures that the same versions will be downloaded if the pod install command is re-run.
To update to a newer version of a dependency, you can use a combination of pod outdated to identify dependencies that are outdated and pod update to update them. See CocoaPods install vs update documentation for further details. If you make changes to third-party dependencies, you must also update the LIBRARIES file.
Launch the App on an iPhone
- Connect an iPhone to the laptop running Xcode.
- Accept the dialog displayed on your iPhone asking if you would like to trust your computer.
- Select your phone from the devices dropdown in the top-left of Xcode.
- Select the “Play” icon.
Rename the project
- Select the “ForgeRock” folder from the “Project Navigator View” in Xcode to view the App’s configuration in the main Xcode view.
- Select the "File inspector" on the right hand-side; the name of your project should be in there under "Identity and Type":
- Change the name of your project to a new name, for example to “ACME”.
- Review the contents that will be renamed by Xcode and select “Rename”:
See How do I completely rename an Xcode project (i.e. inclusive of folders)? for further information on these steps.
Rename the scheme
- Click on the scheme for your OLD product (in the top bar near the "Stop" icon), then select "Manage schemes":
- Click on the OLD name in the scheme to make it editable and change the name:
See How do I completely rename an Xcode project (i.e. inclusive of folders)? for further information on these steps.
Update the CocoaPods configuration
- Close Xcode.
- Open the Podfile (located in the project's root directory) in a text editor and update as follows:
- Rename the target “ForgeRock”, for example to “ACME”.
- Rename the target “ForgeRockTests”, for example to “ACMETests”:
- Navigate to the project’s root directory on the command line and and run the pod install command again to apply the CocoaPods changes: $ cd [project_root_dir] $ pod install
- Remove the ForgeRock.xcworkspace directory (also in the project’s root directory): $ rm -rf ForgeRock.xcworkspace
- Open the updated project in Xcode: $ open ACME.xcworkspace/
Rename the ForgeRock-Authenticator directory
- Close Xcode.
- Rename the directory using Git in order to preserve the history: $ git mv ForgeRock-Authenticator ACME-Authenticator
- Re-open the project in Xcode: $ open ACME.xcworkspace/
- Dismiss any warnings regarding missing files.
- Select “Authenticator” from the “Project Navigator View” in Xcode; it should be shown in red.
- Navigate to the Utilities pane under "Identity and Type" where you will see the "Name" entry.
- Select the folder icon to show a new dialog and update the location:
Rename the Entitlements file
- Rename the ForgeRock.entitlements file (located in the project's root directory), for example to ACME.entitlements:
Update the Build settings and rebuild
- Select the project from the “Project Navigator View” in Xcode.
- Select “General”, scroll down to the “Linked Frameworks and Libraries” section and remove the “libPods-ForgeRock.a” entry:
- Select "Build Settings", followed by “Packaging” and update the “Info.plist File” path, for example to “ACME-Authenticator/ACME-Info.plist”:
- Navigate to "Signing" and update the following:
- “Code Signing Entitlements” path, for example to “ACME.entitlements”.
- “Prefix header”, for example to “ACME-Authenticator/ACME-Prefix.pch”:
- Rebuild the project:
- Command + Shift + K to clean.
- Command + B to build.
Before making further changes, now would be a good time to verify that you are able to run the code on a physical device as detailed in Launch the App on an iPhone.
Update the Test Build settings
- Select the project from the “Project Navigator View” in Xcode.
- Select the “ACMETests” target in the main view.
- Select "Build Settings", followed by “Bundle Loader” and update the following:
- “Debug” path, for example to “$(BUILT_PRODUCTS_DIR)/ACME.app/ACME”.
- “Release” path, for example to “$(BUILT_PRODUCTS_DIR)/ACME.app/ACME”:
- Select “Build Phases”, followed by “Link Binary with Libraries” and remove the “libPods-ForgeRockTests.a” entry:
Update the Splashscreen video
- Replace the splashvideo.mp4 file (located in the [project_root_dir]/ACME-Authenticator directory) with the updated video file. Keeping the same filename means you do not have to update other project files.
Update App Permission Request dialogs
- Replace references to ForgeRock within the ACME-Info.plist file (located in the [project_root_dir]/ACME-Authenticator directory). For example, change them to ACME:
Update Localizable.strings
- Replace references to ForgeRock within the Localizable.strings file (located in the [project_root_dir]/ACME-Authenticator/en.lproj directory). For example, change them to ACME:
Update About.strings
- Replace relevant references to ForgeRock within the About.strings (located in the [project_root_dir]/ACME-Authenticator/Settings.bundle/en.lproj directory). For example, change them to ACME:
Note
ForgeRock and other copyright attributions should not be changed.
Update the App icon
- Generate a new set of icon files and a Contents.json file. These can be generated from a single source image using an online service such as https://appicon.co/.
- Replace the contents of the [project_root_dir]/ACME-Authenticator/Images.xcassets/AppIcon.appiconset/ directory with the set of icon files and a Contents.json file:
Update the Default Account icon
-
Replace the forgerock-logo.png file (located in the [project_root_dir]/ACME-Authenticator directory) with an updated icon. If you want to change the name of this file, for example to acme-logo.png, then you must also update the references to it in the following files (using a text editor to find and replace is likely the easiest approach):
- FRAUIUtils.m (located in the [project_root_dir]/ACME-Authenticator directory).
- Main.storyboard (located in the [project_root_dir]/ACME-Authenticator directory)
- project.pbxproj (located in the [project_root_dir]/ACME.xcodeproj directory):
Optional
You can delete the following files (located in the [project_root_dir]/ACME-Authenticator directory) from Xcode and the file system if you want as they are not used:
- forgerock-logo-text.png
- forgerock-logo-opaque.png
Update the Default colors
-
Update colors in the following files (located in the [project_root_dir]/ACME-Authenticator directory); colors to update are specified in brackets:
- FRANotificationsTableViewController.m (seaGreen and dashboardRed)
- FRACircleProgressView.m (lightGrey)
- FRAOathMechanismTableViewCellController.m (seaGreen and dashboardRed)
- Update colors and layout defined in the Main.storyboard file (located in the [project_root_dir]/ACME-Authenticator directory) if necessary.
Note
Any changes made to the Main.storyboard file will result in merge conflicts when rebasing over later changes to the official App; ForgeRock's development approach allows edits to this file by only one developer at a time.
Publish your App
Once you have completed all your changes and rebuilt the App, you can submit your App to the Apple App Store. The following links provide useful Apple resources on the next steps:
Set up Push notifications
Refer to the following articles for further information on setting up Push notifications:
- How do I use Push notifications in AM with a non-AWS SNS Push Service?
- How To Configure Service Credentials (Push Auth, Docker) in Backstage