Open emadhegab opened 1 month ago
Hi, thank you for report. We don't support beta versions (Swift 6). When the version of Swift is officially released, we will definitely cover it. You can use ExponeaInternal() as a public property instead of shared, but we can't guarantee functionality.
As swift 6 officially released. we can't work anymore with the sdk
Hi, I am trying to simulate this warning, but no luck. How this warning blocked you? Could you share your implementation for ExponeaServicing please?
sure.. here is how the error now looks when we start using swift 6 in our project. you need to make your SPM or the main bundle uses swift 6
and here is the code directly so you can see it yourself
`
class ExponeaService: ExponeaServicing {
func setup(withTrackingConsent: Bool) {
Exponea.shared.configure(
Exponea.ProjectSettings(
projectToken: "<PROJECT_ID",
authorization: .token("<TOKEN>"),
baseUrl: "https://api.eu1.exponea.com"
),
pushNotificationTracking:
withTrackingConsent ? .enabled(appGroup: AppConfigurations.Environment.appGroupBundleID) : .disabled
)
}
func anonymizeUser() {
Exponea.shared.anonymize()
}
func sendUserID(_ id: String) {
let properties: [String: String] = [
"customer_id": id
]
Exponea.shared.identifyCustomer(customerIds: properties,
properties: [:], timestamp: nil)
}
func registerToken(_ token: Data) {
guard Exponea.shared.isConfigured else { return }
Exponea.shared.trackPushToken(token)
}
}
`
Thank you. We started with fixing.
Hello, We have latest exponea sdk 2.28.0, we get the warning
Reference to class property 'shared' is not concurrency-safe because it involves shared mutable state; this is an error in the Swift 6 language mode
is there a better way than singleton to init the exponea in the newest versions?