Steps to Install your iOS Installation
Installing mmob's package allows you to unlock a world of onward journeys for your customers, all served natively within your iOS applications. mmob's library supports iOS 13+, built using Xcode 14.
Installing your iOS Integration
mmob package name is called MmobClient
To install an mmob Integration, the following steps are required:
-
Add the EF Network Client iOS package to Xcode 13 or later
-
Import
MmobClient
-
Set the
configuration
with your organisation'scp_id
andintegration_id
-
Configure the
customer
snippet -
Ensure you are operating off the correct
instanceDomain
for your region
Step 1: Adding Swift Package Manager
To get started, add mmob's package repository in Xcode.
Step 2: Import EF Network Client Package
Click File
-> Add Packages
In the search bar, type
https://github.com/mmob-tech/mmob-client-ios.git
You will find mmob-client-ios
.
You will then see the option to Download Package
- ensure that the tickbox is checked appropriately
The earliest version of MmobClient
supported is v0.3.0
or above. Latest version is v0.4.0
Step 3: Point the Script to a Preconfigured Identifier
A. If you are a Distribution Partner (embedding services into your platform), your configuration will use an integration_id
and cp_id
and look like the following:
let configuration = MmobConfiguration(
configuration: MmobCompanyConfiguration(
cp_id: "Your cp_id here",
integration_id: "Your chosen integration_id here"
)
)
B. If you are a Service Provider (you have already created your own widget for embedding in other channels), the configuration for your distribution partner will use a distribution_id
only:
let configuration = MmobDistribution(
configuration: MmobDistributionConfiguration(
distribution_id: "Your distribution_id here"
)
)
Step 4: Configure the Customer Snippet with the correct parameters
Pass the following parameters into the customer
snippet, using the customer's details of the customer who is actively using your application:
customer: MmobCustomerInfo(
email: "john.smith@example.com",
first_name: "John",
surname: "Smith"
)
Anonymous Users
If your organisation does not wish to pass in any data into the snippet, this part of the snippet can be left as follows:
customerInfo = MmobCustomerInfo()
Step 5: Update the Client View
func updateUIView(_ uiView: MmobClientView, context: Context) {
}
Step 6: Set your Instance Domain to Correct Region
If you are operating in the Asia Pacific region, ensure to set instanceDomain = InstanceDomain.efnetwork
in return
. If you do not set an instance domain, the system will default to our server in Europe.
return client.getClient(mmobConfiguration: configuration)
Example Script
On completion of these steps, your script should look like the following:
import MmobClient
import SwiftUI
struct MarketplaceView: UIViewRepresentable {
let client = MmobClient()
func updateUIView(_ uiView: MmobClientView, context: Context) {
print("update UI")
}
func makeUIView(context: Context) -> MmobClientView {
let configuration = MmobConfiguration(
configuration: MmobCompanyConfiguration(
cp_id: "Place your CP ID here",
integration_id: "Place your Integration ID here",
environment: "stag")
customer: MmobCustomerInfo(
email: "john.smith+4@example.com",
first_name: "John",
surname: "Smith Four",
title: "Mr"
)
)
return client.getClient(mmobConfiguration: configuration)
}
}
Example script for anonymous users
import MmobClient
import SwiftUI
struct MarketplaceView: UIViewRepresentable {
let client = MmobClient()
func updateUIView(_ uiView: MmobClientView, context: Context) {
print("update UI")
}
func makeUIView(context: Context) -> MmobClientView {
let configuration = MmobConfiguration(
configuration: MmobCompanyConfiguration(
cp_id: "Place your CP ID here",
integration_id: "Place your Integration ID here",
environment: "stag")
customer: MmobCustomerInfo()
)
return client.getClient(mmobConfiguration: configuration)
}
}
Was this page helpful?
On This Page
- Installing your iOS Integration
- Step 1: Adding Swift Package Manager
- Step 2: Import EF Network Client Package
- Step 3: Point the Script to a Preconfigured Identifier
- Step 4: Configure the Customer Snippet with the correct parameters
- Anonymous Users
- Step 5: Update the Client View
- Step 6: Set your Instance Domain to Correct Region
- Example Script
- Example script for anonymous users