Skip to content

Conversation

muzahidul-opti
Copy link
Contributor

@muzahidul-opti muzahidul-opti commented Jun 20, 2023

Summary

Swift async-await support added for:

  • Client initialization
  • ODP

Test plan

  • Test cases added

Issues

Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A few suggestions.

@muzahidul-opti muzahidul-opti changed the title Muzahid/async await support feat: Swift concurrency, async await support added Jun 21, 2023
@muzahidul-opti muzahidul-opti changed the title feat: Swift concurrency, async await support added feat: Swift concurrency, async-await support added Jun 21, 2023
@muzahidul-opti muzahidul-opti requested a review from jaeopt June 21, 2023 17:50
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We can remove all async versions of internal functions.

@muzahidul-opti muzahidul-opti requested a review from jaeopt June 22, 2023 11:00
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few small changes suggested.

Comment on lines 165 to 168
// // For sample codes for APIs, see "Samples/SamplesForAPI.swift"
// //SamplesForAPI.checkOptimizelyConfig(optimizely: self.optimizely)
// //SamplesForAPI.checkOptimizelyUserContext(optimizely: self.optimizely)
// //SamplesForAPI.checkAudienceSegments(optimizely: self.optimizely)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep these lines? We use this for testing sample codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will revert back.


guard let localDatafileUrl = Bundle.main.url(forResource: "demoTestDatafile", withExtension: "json"),
let localDatafile = try? Data(contentsOf: localDatafileUrl)
let localDatafile = try? Data(contentsOf: localDatafileUrl)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - extra spaces. swift lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see any lint warning.


if #available(iOS 13, *) {
if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
Task { [user] in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this explicit capturing [user] here?

Copy link
Contributor Author

@muzahidul-opti muzahidul-opti Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, as we declare user as local variable inside the static method, that's why we needed to capture it. Otherwise, the compiler throws errors. Normally we don't need to capture it, as we did in appdelegate.

optimizely = OptimizelyClient(sdkKey: "<Your_SDK_Key>",
periodicDownloadInterval: 60)
if #available(iOS 13, *) {
Task { [optimizely] in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this explicit capturing [optimizely] here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed above

muzahidul-opti and others added 2 commits June 22, 2023 23:24
Co-authored-by: Jae Kim <45045038+jaeopt@users.noreply.github.com>
@muzahidul-opti muzahidul-opti requested a review from jaeopt June 22, 2023 17:42
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@muzahidul-opti muzahidul-opti merged commit ccda0bd into master Jun 22, 2023
@muzahidul-opti muzahidul-opti deleted the muzahid/async-await-support branch June 22, 2023 18:04
@russell-loube-optimizely russell-loube-optimizely changed the title feat: Swift concurrency, async-await support added [FSSDK-9419]: feat: Swift concurrency, async-await support added Jun 23, 2023
@muzahidul-opti muzahidul-opti changed the title [FSSDK-9419]: feat: Swift concurrency, async-await support added [FSSDK-9707]: feat: App privacy manifest file added Nov 2, 2023
@muzahidul-opti muzahidul-opti changed the title [FSSDK-9707]: feat: App privacy manifest file added [FSSDK-9419]: feat: Swift async-await support added Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants