How to implement the Mobile Safari Extension - Wildfire Support Center

How to implement the Mobile Safari Extension

Overview

This will be a brief walkthrough for importing our iOS Safari Extension into an existing iOS App. After Wildfire builds the extension to agreed specifications we will provide an Xcode project that includes an example host app and the Safari Extension App. This can be used for testing the extension without requiring the extension to be added into your project.

If you are interested in the Wildfire's turn-key Mobile Safari Extension please [contact your client success representative.](/content/contact-us "contact your client success representative."/index.html)

Add a new target in the destination project

We will start by opening up your existing Xcode project and create a new Target.

File > New > Target...

Select "Safari Extension" from the list of iOS targets.

Name your new target, this can follow your conventions and be anything.

Remove the template files

Next, we will remove most of the new files created and replace them with the ones from the extension project.

Delete all of the files within the Resources Directory and the SafariWebExtensionHandler

Add the extension files to your project

Select your project from the navigator in Xcode and Select the target for your extension > then select Build Phases.

Expand the "Copy Bundle Resources" section.

The files you just added will be located at the root level of your app in Xcode.

Navigate back to your-extension/xcode-project/iOS (Extension) and:

Extension Configuration Settings

The host application can provide configuration settings to control extension behavior and manage user attribution. These values are passed from the native host app to the JavaScript context of the extension via SafariWebExtensionHandler.swift.

1. GET_USER_ID (Required)

A unique identifier generated by the host application to identify the current user.

2. IS_EXTENSION_ENABLED (Required)

A boolean flag that enables or disables the extension.

3. IS_COUPON_ENABLED (Required)

A boolean flag that controls the availability of the Couponator feature.

4. GET_SPLIT_AMOUNT (Required)

A float value between 0 and 1 that determines the user's share of transaction earnings.

This value impacts how earning visuals are displayed:

Value User Earnings Share
1.0 100%
0.5 50%
0.3 30%

5. GET_LAST_LINK_TIMESTAMP (Optional)

A Unix timestamp indicating the last time an affiliate link was presented within the host app.

Note: Configuration values can either be hard-coded into SafariWebExtensionHandler.swift or set using an App Group shared between the host app and the extension.

Success

You have successfully added the extension into your app. It will automatically be installed when the project is run on either the simulator or a physical device.

Note__: Extensions must be enabled in Safari before Safari will allow them to launch. This is done by selecting 'Manage Extensions' from the pop-up menu within Safari.

Updated 11 Jun 2026