Setup SDK
iOS and tvOS PacketSDK Integration Guide
Overview
This guide is intended for application developers who want to monetize their iOS and tvOS apps using the PacketSDK. PacketSDK supports native iOS and tvOS apps written in Objective-C and Swift.
Integrating the Packet SDK into your app is the first step to earning revenue. Once integrated, you'll start seeing revenue in the PacketSDK Dashboard within 24 hours.
This document will walk you through the steps required for proper integration. Most apps can be integrated with the Packet SDK in about 15 to 20 minutes.
Compatibility Information
System
Supports iOS 13.0 or higher and tvOS 13.0 or higher
Development Environment
Develop with Xcode15.3 or higher
Preparation
Apply for appkey
Register and log in to the PacketSDK, go to Dashboard>APP to add your app and get your appkey
SDK Integration Package Directory Structure
After completing the previous step, download the SDK package: packet_sdk_ios-\*.zip
Unzip the SDK package to find the following files:
├──PacketSDK.xcframework (Obfuscated SDK package)
├──PacketSDKDemo (The SDK usage demo comes with the SDK already integrated. You can refer to this demo for guidance on integrating the SDK. Before integrating, please test the demo to understand the implementation principles.)
├──PacketSDK_tvOS_Demo (The SDK usage demo comes with the SDK already integrated. You can refer to this demo for guidance on integrating the SDK. Before integrating, please test the demo to understand the implementation principles.)
├──PacketSDK_swiftUI_Demo (The SDK usage demo comes with the SDK already integrated. You can refer to this demo for guidance on integrating the SDK. Before integrating, please test the demo to understand the implementation principles.)
└───packet_sdk_ios_tvos_document-\*.md (Integration Documentation)
SDK Project Configuration
Step1: Import SDK Library
Copy PacketSDK.xcframework to your project directory, Add the following configuration:
Step2: Quick Integration
Step3: Verify if integration is successful.
After call PacketSdk.Start() API, if receive Start preparation Get Server Success and Connect success in the callback function you set, it indicates that you have successfully integrated Packet SDK into your application.
Once you’ve received Connect success in the callback function, you will start seeing devices data and revenue in Packet SDK Dashboard in 24 hours.
Default consent window
We have provided a default consent window.
Custom consent window
If default SDK consent window doesn't suit your needs, you can create a custom consent window. Make sure to call PacketSdk.optIn() whenever user gives a consent and PacketSdk.optOut() whenever user declines it.
Return Value Description
Start preparation.
Start the SDK
Get Server Success.
Server successfully acquired
Connect success.
Connection successful
SDK APIs
Demo Project Reference
We have provided a SDKDemo in the zip file for you to debug. You can use the demo to configure your app_key and then click start.
If the following message is returned, it means that your current device has successfully connected to our service,you will start seeing devices data and revenue in PacketSDK Dashboard in 24 hours.
Start preparation.Get Server Success.Connect success.
Last updated