Aller au contenu principal

iOS API Reference

API reference for the Azeoo SDK on iOS. The current flow is AzeooSDK.init(...) or Pigeon initialize + connect; see iOS Quick Start and SDK API.

AzeooSDK

Single entry point. init(apiKey, config, theme, deepLinks, safeArea, ...) returns the SDK instance. connect(userId, token, completion) attaches a user. Access user, theme, navigation, modules.nutrition, modules.training after connect.

AzeooClient (legacy reference)

  • apiKey: String - The API key used for initialization
  • subscriptions: [String] - List of active subscriptions
  • isAuthenticated: Bool - Authentication status

Methods

func validateApiKey() async throws -> Bool

Validates the API key with the server.

AzeooUser

User management and profile operations.

Initialization

init(client: AzeooClient, userId: String)

Methods

func logout() async throws

Logs out the current user and clears user-specific data.

func changeHeight(_ height: Double) async throws

Updates the user's height.

func changeWeight(_ weight: Double) async throws

Updates the user's weight.

func getProfile() async throws -> UserProfile

Retrieves the user's profile information.

func getToken() async throws -> String

Gets the current authentication token.

func update(_ data: [String: Any]) async throws

Updates user information.

func delete() async throws

Deletes the user account.

AzeooUI

UI components and navigation management.

Initialization

static func initialize(
client: AzeooClient,
config: Config,
completion: @escaping (Result<Void, Error>) -> Void
)

Instance Access

static var instance: AzeooUI? { get }

Nutrition Module

var nutrition: NutritionModule { get }

Methods

func showMainScreen(bottomSafeArea: Bool? = nil)

Shows the main nutrition screen.

func showNutritionPlans()

Shows the nutrition plans screen.

func showNutritionPlan(_ planId: String)

Shows a specific nutrition plan.

func showUserNutritionPlan()

Shows the user's nutrition plan.

func showRecipes()

Shows the recipes screen.

func showRecipe(_ recipeId: Int, recipeName: String? = nil)

Shows a specific recipe.

func showBarcodeScanner()

Shows the barcode scanner.

func showMobileScanner()

Shows the mobile scanner.

func showCart()

Shows the shopping cart.

func showNutritionSearch()

Shows the nutrition search screen.

func showAddSelection()

Shows the add selection screen.

func showAddFood()

Shows the add food screen.

func showAddMeal()

Shows the add meal screen.

Training Module

var training: TrainingModule { get }

Methods

func showMainScreen()

Shows the main training screen.

func showWorkoutPlans()

Shows the workout plans screen.

func showExercises()

Shows the exercises screen.

func showProgress()

Shows the progress screen.

func showSchedule()

Shows the schedule screen.

Theme Management

func changePrimaryColor(_ color: UIColor)

Changes the primary color for both light and dark themes.

func setLightMode()

Sets theme mode to light.

func setDarkMode()

Sets theme mode to dark.

func setSystemMode()

Sets theme mode to follow system setting.

func toggleThemeMode() async throws

Toggles between light and dark theme modes.

Reset

static func reset() async throws

Resets the SDK, clearing user-specific data.

Config Builder

Configuration builder for SDK initialization.

class Config {
static func builder() -> ConfigBuilder
}

ConfigBuilder Methods

func setUserId(_ id: String) -> ConfigBuilder
func setAuthToken(_ token: String) -> ConfigBuilder
func setLocale(_ locale: String) -> ConfigBuilder
func setAnalyticsEnabled(_ enabled: Bool) -> ConfigBuilder
func setOfflineSupport(_ enabled: Bool) -> ConfigBuilder
func setTheme(_ theme: ThemeConfig) -> ConfigBuilder
func setSafeArea(_ safeArea: SafeAreaConfig) -> ConfigBuilder
func setDeepLinkConfig(_ config: DeepLinkConfig) -> ConfigBuilder
func build() -> Config

Error Types

enum AzeooSDKError: Error {
case invalidApiKey
case networkError
case initializationError
case authenticationError
case configurationError
}

Next Steps