Skip to Content
iOS OptionsSession Configuration

Session configuration

GraffityARCloudConfiguration is immutable and Sendable. Construct it once, then pass it to try GraffityARCloud(configuration:) on the main actor. All public SDK APIs require iOS 18.0+.

Public initializer

import CoreLocation import UIKit import GraffityARCloud @MainActor func makeNavigationSession(accessToken: String) throws -> GraffityARCloud { let configuration = GraffityARCloudConfiguration( accessToken: accessToken, mode: .navigation, userId: "YOUR_USER_ID", initialLocation: CLLocation(latitude: 13.7563, longitude: 100.5018), logging: .default, telemetry: .disabled, minimap: .enabled, theme: GraffityARTheme(primary: .systemIndigo), preferredTransitionTypeId: nil, deepLink: nil ) return try GraffityARCloud(configuration: configuration) }

Replace the seed coordinate with a known location for your user, or omit it. Use your app’s stable player ID, or omit it when collection is not needed.

ParameterTypeDefaultEffect
accessTokenStringRequiredGraffity-issued token; basic validation runs in the SDK initializer.
modeGraffityARMode.navigationDestination-first navigation, or immediate localization with .arContent.
userIdString?nilUser-specific content and collection player identity.
initialLocationCLLocation?nilSeed before the first GPS fix; real updates take over. Does not bypass authorization.
loggingGraffityARLogging.defaultLog sink and severity; see logging.
telemetryGraffityARTelemetry.default → .disabledOpt-in analytics, independent of required SDK requests and collection.
minimapGraffityARMinimapConfiguration.disabledDocked route map, honored only in navigation mode.
themeGraffityARTheme.defaultNative UI palette.
preferredTransitionTypeIdString?nilPreferred transition type for every hop; backend falls back to the unrestricted shortest path if needed.
deepLinkGraffityARDeepLink?nilPlace, section, or POI for the first destination-picker presentation.

Token validation

Initialization trims whitespace and an optional case-insensitive Bearer prefix for the basic check. The remaining token must be longer than 10 characters. This catches obvious missing or short input; it is not JWT verification or server authentication.

Pass the raw issued token without a prefix for consistent use across services. A later server rejection surfaces as .invalidAccessToken and triggers shutdown. There is no public token setter or refresh callback: obtain a new token and create a new session.

Configuration changes

The public initializer targets production. Environment selection and custom endpoints are internal SPI, outside the external developer API.

Properties use let. To change token, mode, user, location seed, minimap, theme, transition preference, or deep link, end the current session and create a new configuration and SDK. Use setLogger(_:) and setTelemetryEnabled(_:) for runtime sink and telemetry changes.

See navigation, collection, and lifecycle.