iOS SDK Installation
Pre-requisites
- Xcode version 15.1 or newer
- Obtain client settings from Publift:
TENANT_CODE
TAG_ID
GADApplicationIdentifier
Installation (Swift Package Manager)
- Add the Fuse swift package registry by running the following commands in Terminal:
swift package-registry set --global --scope publift https://swift.cloudsmith.io/publift/fuseapp/
swift package-registry login https://swift.cloudsmith.io/publift/fuseapp/ --token BrnMk9bbufLlX4Vd
- Open your Xcode project
- In Xcode, select the menu item “File > Add Package Dependencies…"
- If you are prompted for keycain access to
swift.cloudsmith.io
, click “Always Allow” - On the “Add Packages” popup, type in the search box “FuseAppSDK”
- In the search results, select
publift.FuseAppSDK
and click the “Add Package” button - On the “Choose Package Products” popup, tap the “Add Package” button
- In the main Xcode window left panel,
FuseAppSDK
will now be listed under “Package Dependencies”
Installation (CocoaPods)
- Install CocoaPods in your Xcode project
- Add the following lines to your
Podfile
:
# Put these lines at the top of your Podfile.
source 'https://dl.cloudsmith.io/BrnMk9bbufLlX4Vd/publift/fuseapp/cocoapods/index.git'
source 'https://cdn.cocoapods.org/'
# Add the 'FuseAppSDK' package to your app.
target 'MyApp' do
pod 'FuseAppSDK'
end
# Put these lines at the bottom of your Podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
- Run
pod install
(orpod install --repo-update
if it fails)
Initialization
If you app launches using an App
class, add the following code:
import FuseAppSDK
@main
struct MyApp: App {
init() {
...
FuseSDK.shared.initializeSDK()
}
}
Alternatively, if your app launches using an UIApplicationDelegate
class, add the following code:
import FuseAppSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {`
...
FuseSDK.shared.initializeSDK()
return true
}
Build Settings
In your Xcode project “Build Settings”, set the following configuration:
Key | Value |
---|---|
User Script Sandboxing | No |
App Info Settings
Add the following key/value pairs in the Info.plist
file of your Xcode project:
Key | Value |
---|---|
com.publift.mobile.TENANT_CODE | (Provided by Publift) |
com.publift.mobile.TAG_ID | (Provided by Publift) |
GADApplicationIdentifier | (Provided by Publift) |
SKAdNetworkItems | Copy & add the contents from here. |
GoogleUtilitiesAppDelegateProxyEnabled | NO |
App Uses Non-Exempt Encryption | NO |