Install Cocoapods.
sudo gem install cocoapods
cd Sandbox
pod install
open Sandbox.xcworkspace
pod updateOn https://developer.apple.com/account, create an Identifier for an App ID.
Choose a bundle ID.
To use the full extent of the Sandbox app features, select the Associated Domains and Sign In with Apple capabilities.
On XCode, connect your account.
In the navigator area, select Sandbox at the root, then in the editor area, in Targets select Sandbox (which should be selected by default) then "Signing & Capabilities".
Fill in your bundle ID.
Add the Associated Domains and Sign In with Apple capabilities.
Configure the associated domains as explained below.
In Domains, enter webcredentials:domain.
The domain must be the same as in the SdkConfig, so for example webcredentials:integ-sandbox-squad2.reach5.dev.
If you use a private web server, which is unreachable from the public internet, you can also enable the alternate mode feature by appending ?mode=<alternate mode>.
So for example webcredentials:integ-sandbox-squad2.reach5.dev?mode=developer
cf. https://developer.apple.com/documentation/xcode/supporting-associated-domains
You also need to set the ReachFive client configuration within the SDK as below:
SdkConfig(
domain: "my-reachfive-url",
clientId: "my-reachfive-client-id"
)
For example:
SdkConfig(
domain: "integ-sandbox.reach5.dev",
clientId: "zhU43aRKZtzps551nvOM"
)
By default, the URL scheme follows this pattern: reachfive-${clientId}://callback.
You can also specify it manually.
The client that you just referenced must be a First-party client with Token Endpoint Authentication Method at None.
You must have the scheme registered in Allowed Callback URLs.
You should also enforce PKCE and enable Refresh Tokens.
If you want to use Passkeys, you must have the Webauthn feature activated on your account, and add your domain in Allowed Origins like this: https://integ-sandbox-squad2.reach5.dev.
Note the https:// here that was not present in the SdkConfig.
To run your app on a device and not just the simulator (to use Passkeys for example), you need to enable "Developer Mode".
On iPhone, iPad, go to Settings > Privacy & Security > Developer Mode.
On a Mac, run in your terminal:
swcutil developer-mode -e trueOpen the project folder to view it as a package project, not the .xcodeproj or .xcworkspace which makes them seen as a Pod project
While you can develop across all modules while being in the Sandbox.xcworkspace,
when you need to add a new file or rename one, you have to be in the specific module workspace and add it from within XCode so that the project.pbxproj is properly updated.
A podspec cannot reference, without resorting to dirty tricks, other locally changed pods.
Instead, they reference the latest version available on Cocoapods.
This means that the non-core pods will not have access to the core changes on CI until the core changes are deployed.
This problem does not impact local development.
So, first, release Reach5 Core. Then you can use the new APIs from this release in the Facebook/Google/WeChat pods.
If the provider depends on an external dependency or needs a specific configuration in the property file, then add a new module, otherwise add it to Core.
For example, a native Apple Provider should not be in a new module.
Also a provider that would depend only on specific web configuration not possible to do in WebViewProvider.
Or one that would use SFSafariViewController instead of ASWebAuthenticationSession (not sure that it is a good idea, it is just an example).
XCode > File > New > Project... > Framework.
Create the Podfile and podspec (with pod commands or by copying from other modules).
Be aware, as per the point above, that the podspec does not reference the local version but the remote version.
Add at least one file for now, push and tag.
Push the new pod pod trunk push so that XCode can show the proper icon in the Products view