On this page Link the XCFrameworkInitialize and install a sessionPermissions and device capabilitiesPayment URL handlingMirroring extensions and logoutPrivacy resources
APP SDK / Android · iOS

iOS integration

Link the XCFramework, configure permissions, application identity and payment URLs, and use native account and device clients.

Link the XCFramework

Add ios/InfiniteRideMobile.xcframework from the package to your project. The minimum is iOS 15.1, with device arm64 and simulator arm64/x86_64 slices. This is a static framework: select Do Not Embed and add -ObjC.

Link Foundation, UIKit, CoreBluetooth, Security, Network, NetworkExtension, MediaPlayer, CoreGraphics, ImageIO, ReplayKit and libz. Import the public interfaces through InfiniteRideMobile/InfiniteRideMobile.h.

The package’s native sample builds independently and helps verify linkage. Installing on a phone requires your own signing identity, provisioning profile and capabilities.

Initialize and install a session

Configure once on the main thread. Use your registered clientId and a paymentScheme matching the host’s URL registration. The host provides the variables and callbacks below:

#import <InfiniteRideMobile/InfiniteRideMobile.h>

[IRMobileSDK configureWithConsent:^BOOL {
    return userHasAcceptedPrivacy();
} clientId:registeredClientId paymentScheme:paymentScheme];

[[IRMobileSDK account] write:platformSessionJson
                         resolve:success
                          reject:failure];

The consent query must reflect the current state. Use the session returned by platform login; do not construct your own or replace its token. Create a cloud client only after the session write succeeds:

IRCloudVehicles *vehicles = [[IRCloudVehicles alloc]
    initWithBaseURL:apiBase language:@"en"];
IRCloudOperation *operation = [vehicles execute:@"list"
    parameters:@{} resolve:success reject:failure];

apiBase is your assigned HTTPS base including /api/v1. Normally call recover before list. The vehicle-list result is a JSON string; decode it before updating the UI. Swift hosts can import the same Objective-C module and public interfaces.

Permissions and device capabilities

Provide Bluetooth and local network usage descriptions in Info.plist as needed. Automatic joining of vehicle hotspots requires Hotspot Configuration capability. Background Bluetooth requires the bluetooth-central background mode. Signing must match the enabled capabilities.

[IRMobileSDK devices] returns the shared device client, including scan, pair, submitPin, vehicleStatus and vehicleCommand. Follow vehicles and recovery for pairing, binding and Wi-Fi sequencing. The simulator supports compilation and UI work; it does not establish working Bluetooth, hotspots or vehicle commands.

Supply the host’s actual navigation state through setNavigationActiveProvider:. The SDK rejects vehicle switching or removal while navigation is active.

Payment URL handling

Include the package’s InfiniteRideMobile/Alipay CocoaPods subspec for real Alipay payments. Core alone does not include the payment provider. Alternatively, manually link the matching provider framework as described in the package. Query [IRMobileSDK paymentAvailable] for availability.

Register the configured paymentScheme under CFBundleURLTypes in Info.plist. Forward AppDelegate, SceneDelegate and cold-launch URLs to the SDK first:

if ([IRMobileSDK handlePaymentURL:url]) {
    return;
}
// Continue with the host's remaining URL handlers.

This is a URL-routing fragment; return the corresponding handled flag in system methods that require a BOOL. Initiate payment only after an explicit user action. Follow payment recovery when the app returns to the foreground.

Mirroring extensions and logout

Mirroring needs your own Broadcast Upload Extension, App Group and Keychain access group. Configure the shared groups through Info.plist keys InfiniteRideMirrorAppGroup and MotoMirrorKeychainGroup. Do not copy another application’s signing groups.

APP SDK 1.0.0 reports two distinct connection states:

Field Meaning and use
terminalStatus.wifiConnected Primary business authentication; controls also require permissions and fresh vehicle state
mirrorWifiConnected A fresh authenticated heartbeat for the current vehicle’s mirror link, used for mirror connection display

Match terminalId before combining both fields for a Wi-Fi icon. Controls, binding and OTA retain their primary-business gates.

Mirror freshness is established in three steps:

  1. The extension receives a PONG matching its TLS session, request and streamId.
  2. It writes monotonic time as controlConfirmedAtUptime in the current token’s state.plist. Ordinary watchdog writes do not renew it.
  3. The SDK checks the mirror grant, vehicle, session, stream, token, authorization expiry and heartbeat age below ten seconds. Missing or expired feedback means disconnected.

Recovering controls on foreground return also requires a recovery-capable APP SDK build and hardware r26 / ABI 8 with PROFILE39. Resubscribe and read vehicle state after primary recovery; see the changelog.

On logout, cancel operations, wait for settlement and call [[IRMobileSDK account] clear:success reject:failure]. Recreate cloud clients after token or account changes so old screen results cannot populate the new account’s UI.

When consent is withdrawn, immediately stop accepting new work, cancel all held cloud operations and call account.clear to stop the device session and clear the account. Consume final callbacks without updating the departed screen. Withdrawing consent cannot undo a completed payment.

Privacy resources

Each 1.0.0 XCFramework slice includes PrivacyInfo.xcprivacy; CocoaPods uses InfiniteRideMobilePrivacy.bundle. Manual static-framework integration must copy privacy resources into the final app and merge existing app declarations without replacing them. Follow the supplied PRIVACY.md to check enabled cloud features, data categories, API reasons and other SDKs. Inspect the Xcode Archive Privacy Report; a manifest does not establish App Store acceptance.