Skip to main content

πŸš€ iOS Quick Start

Prerequisites​

  • Xcode 15+
  • API key from Client Platform
  • SPM: add package from Downloads or local sdk/ios
  • Monorepo: run ./scripts/ios_build.sh first

Step 1: Add the package​

Swift Package Manager β€” dependency URL in Downloads.

Local development:

.package(path: "../../sdk/ios")

Product: AzeooSDK.

Step 2: Initialize​

import AzeooSDK

let config = AzeooConfig(
locale: "en",
analyticsEnabled: true,
offlineEnabled: true,
connectionTimeoutSeconds: 30,
persistSession: true
)
let deepLinks = AzeooDeepLinkConfig(scheme: "https", host: "azeoo.com")
let safeArea = AzeooSafeAreaConfig(top: true, bottom: true, left: true, right: true)

AzeooSDK.initialize(
apiKey: "YOUR_API_KEY",
config: config,
theme: themeConfig,
deepLinks: deepLinks,
safeArea: safeArea
) { result in
switch result {
case .success:
break // show connect UI
case .failure(let error):
break
}
}

Step 3: Connect​

Pass a User JWT created by your backend. See Creating the User JWT for the payload spec and backend code examples.

AzeooSDK.shared.connectUser(
token: userJwt, // JWT from YOUR backend β€” see link above
gender: user.gender,
height: user.height,
weight: user.weight
) { result in
// handle profile
}

Step 4: Embed UI​

SwiftUI​

AzeooSDK.shared.modules.nutrition.getView()

In a TabView, see example/ios_example/ContentView.swift.

let nutrition = sdk.tabHost(for: .nutrition)
let training = sdk.tabHost(for: .training)
// Add as view controllers to UITabBarController

See example/ios_example_uikit/MainTabBarController.swift.

Tab coordinator​

let coordinator = AzeooSwiftUITabCoordinator(selection: $tab, mapping: [
.nutrition: 1,
.training: 2,
])
sdk.setModuleContainer(coordinator)

Step 5: Disconnect​

AzeooSDK.shared.disconnect { }

Generated API docs​

Static DocC site under /ios-docs/ on the docs website β€” supplement only; follow this guide for integration.

Next steps​