exponea / exponea-ios-sdk

MIT License
19 stars 27 forks source link

Failing to configure SDK #63

Closed dan-phrasee closed 2 months ago

dan-phrasee commented 3 months ago

I am attempting to add the SDK to a new app however its failing when I call Exponea.shared.configure.

App Delegate

class AppDelegate: ExponeaAppDelegate {
    override func application(
            _ application: UIApplication,
            didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
        ) -> Bool {
            super.application(application, didFinishLaunchingWithOptions: launchOptions);
            Exponea.shared.checkPushSetup = true;
            Exponea.logger.logLevel = .verbose;

            Exponea.shared.configure(Exponea.ProjectSettings(
                projectToken: "...",
                authorization: .token("..."),
                baseUrl: "https://cloud-api.exponea.com"
            ), pushNotificationTracking: .enabled(appGroup: "..."))
            return true
    }
}

Logs

⚙️ Starting ExponeaSDK, version 2.24.0.
2024-03-26 11:44:28497 [EXP-iOS] ℹ️ VERBOSE [ExponeaInternal.swift]:229 sharedInitializer(configuration:): Configuring Exponea with provided configuration:
[Configuration]
Project Token: ...
Authorization: Token Authorization (token redacted)
Base URL: https://cloud-api.exponea.com
Session Timeout: 6.0
Automatic Session Tracking: true
Automatic Push Notification Tracking: false
Require Push Authorization: false
Token Track Frequency: onTokenChange
Flush Event Max Retries: 5
App Group: ...
Default Customer Props allowed: true
Advanced authorization Enabled: false
Fatal error: NSArray element failed to match the Swift Array Element type
Expected Customer but found Customer
2024-03-26 11:44:28.502778+0000 bloomreach[12923:575853] Fatal error: NSArray element failed to match the Swift Array Element type
Expected Customer but found Customer
Ankmara commented 3 months ago

Hi, thank you for report. Pretty strange behavior. I tried your code and works fine. Can you clean project and restart Xcode please? Your project is pure swift or this native code is part of some cross-platform option?