Install Userpilot on iOS Application
Podfile
. Replace <SDK_VERSION>
with the latest version available. You can fetch the latest version from here.pod install
in your project directory.<APP_TOKEN>
with your Application Token, which can be fetched from your Environments Page.
identify
when a user signs in to establish their identity for all future events.identify
at app launch.id
is required in company properties to identify a unique company.locale_code
with a value that adheres to ISO 639-1 format.email
for the user’s email.name
for the user’s or company’s name.created_at
for the user’s or company’s signup date.screen
is crucial for unlocking Userpilot’s core engagement and analytics capabilities. When a user navigates to a particular screen, invoking screen
records that view and triggers any eligible in-app experiences. Subsequent events are also attributed to the most recently tracked screen, providing context for richer analytical insights. For these reasons, we strongly recommend tracking all of your app’s screen views.
logout
to clear the current user context. This ensures subsequent events are no longer associated with the previous user.
anonymous
to track events without a user ID. This is useful for pre-signup flows or guest sessions.
UserpilotNavigationHandler
. When a deep link is external, the SDK will handle it appropriately. For complete control over link handling, you can override the UserpilotNavigationHandler
protocol. This allows you to customize the behavior for all types of links as per your requirements.
UIApplicationDelegate
and UNUserNotificationCenterDelegate
methods.
To enable automatic configuration, call Userpilot.enableAutomaticPushConfig()
from UIApplicationDelegate.application(_:didFinishLaunchingWithOptions:)
.
Userpilot.setPushToken(_:)
from UIApplicationDelegate.application(_:didRegisterForRemoteNotificationsWithDeviceToken:)
to pass the APNs token from calling registerForRemoteNotifications()
to Userpilot.
AppDelegate
to conform to the UNUserNotificationCenterDelegate
protocol and assign self
the delegate in application(_:didFinishLaunchingWithOptions:)
.
Implement userNotificationCenter(_:didReceive:withCompletionHandler:)
and pass the received notification response to Userpilot.didReceiveNotification(response:completionHandler:)
.
userNotificationCenter(_:willPresent:withCompletionHandler:)
.
Sample
directory in GitHub repository contains a full example swift app providing references for usage of the Userpilot API.