Skip to content

Commit

Permalink
prepare 9.0.0 release (#298)
Browse files Browse the repository at this point in the history
## [9.0.0] - 2023-08-02
### Added:
- Added Automatic Mobile Environment Attributes functionality which
makes it simpler to target your mobile customers based on application
name or version, or on device characteristics including manufacturer,
model, operating system, locale, and so on. To learn more, read
[Automatic environment
attributes](https://docs.launchdarkly.com/sdk/features/environment-attributes).

### Removed
- Removed LDUser and related functionality. Use LDContext instead. To
learn more, read https://docs.launchdarkly.com/home/contexts.

---------

Co-authored-by: Ben Woskow <[email protected]>
Co-authored-by: torchhound <[email protected]>
Co-authored-by: Gavin Whelan <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Co-authored-by: Matthew Keeler <[email protected]>
Co-authored-by: Louis Chan <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ember Stevens <[email protected]>
Co-authored-by: Ryan Lamb <[email protected]>
Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com>
Co-authored-by: Kane Parkinson <[email protected]>
  • Loading branch information
12 people authored Aug 2, 2023
1 parent 7635ef4 commit cb42f92
Show file tree
Hide file tree
Showing 63 changed files with 1,323 additions and 1,264 deletions.
2 changes: 0 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ custom_categories:
- LDConfig
- LDContext
- LDContextBuilder
- LDUser
- Reference
- LDMultiContextBuilder
- LDEvaluationDetail
Expand Down Expand Up @@ -52,7 +51,6 @@ custom_categories:
- ObjcLDReference
- ObjcLDContext
- ObjcLDChangedFlag
- ObjcLDUser
- ObjcLDValue
- ObjcLDValueType

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [9.0.0] - 2023-08-02
### Added:
- Added Automatic Mobile Environment Attributes functionality which makes it simpler to target your mobile customers based on application name or version, or on device characteristics including manufacturer, model, operating system, locale, and so on. To learn more, read [Automatic environment attributes](https://docs.launchdarkly.com/sdk/features/environment-attributes).

### Removed
- Removed LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts.

## [8.2.0] - 2023-08-02
### Changed:
- Deprecated LDUser and related functionality. Use LDContext instead. To learn more, read https://docs.launchdarkly.com/home/contexts.
Expand Down
38 changes: 18 additions & 20 deletions ContractTests/Source/Controllers/SdkController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class SdkController: RouteCollection {
"service-endpoints",
"strongly-typed",
"tags",
"user-type"
"auto-env-attributes"
]

return StatusResponse(
Expand All @@ -32,7 +32,9 @@ final class SdkController: RouteCollection {

func createClient(_ req: Request) throws -> Response {
let createInstance = try req.content.decode(CreateInstance.self)
var config = LDConfig(mobileKey: createInstance.configuration.credential)
let mobileKey = createInstance.configuration.credential
let autoEnvAttributes: AutoEnvAttributes = createInstance.configuration.clientSide.includeEnvironmentAttributes == true ? .enabled : .disabled
var config = LDConfig(mobileKey: mobileKey, autoEnvAttributes: autoEnvAttributes)
config.enableBackgroundUpdates = true
config.isDebugMode = true

Expand Down Expand Up @@ -81,8 +83,16 @@ final class SdkController: RouteCollection {
applicationInfo.applicationIdentifier(id)
}

if let verision = tags.applicationVersion {
applicationInfo.applicationVersion(verision)
if let name = tags.applicationName {
applicationInfo.applicationName(name)
}

if let version = tags.applicationVersion {
applicationInfo.applicationVersion(version)
}

if let versionName = tags.applicationVersionName {
applicationInfo.applicationVersionName(versionName)
}

config.applicationInfo = applicationInfo
Expand All @@ -101,14 +111,8 @@ final class SdkController: RouteCollection {
let dispatchSemaphore = DispatchSemaphore(value: 0)
let startWaitSeconds = (createInstance.configuration.startWaitTimeMs ?? 5_000) / 1_000

if let context = clientSide.initialContext {
LDClient.start(config: config, context: context, startWaitSeconds: startWaitSeconds) { _ in
dispatchSemaphore.signal()
}
} else if let user = clientSide.initialUser {
LDClient.start(config: config, user: user, startWaitSeconds: startWaitSeconds) { _ in
dispatchSemaphore.signal()
}
LDClient.start(config: config, context: clientSide.initialContext, startWaitSeconds: startWaitSeconds) { _ in
dispatchSemaphore.signal()
}

dispatchSemaphore.wait()
Expand Down Expand Up @@ -159,14 +163,8 @@ final class SdkController: RouteCollection {
return CommandResponse.evaluateAll(result)
case "identifyEvent":
let semaphore = DispatchSemaphore(value: 0)
if let context = commandParameters.identifyEvent!.context {
client.identify(context: context) {
semaphore.signal()
}
} else if let user = commandParameters.identifyEvent!.user {
client.identify(user: user) {
semaphore.signal()
}
client.identify(context: commandParameters.identifyEvent!.context) {
semaphore.signal()
}
semaphore.wait()
case "customEvent":
Expand Down
6 changes: 4 additions & 2 deletions ContractTests/Source/Models/client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ struct EventParameters: Content {

struct TagParameters: Content {
var applicationId: String?
var applicationName: String?
var applicationVersion: String?
var applicationVersionName: String?
}

struct ClientSideParameters: Content {
var initialContext: LDContext?
var initialUser: LDUser?
var initialContext: LDContext
var evaluationReasons: Bool?
var useReport: Bool?
var includeEnvironmentAttributes: Bool?
}
3 changes: 1 addition & 2 deletions ContractTests/Source/Models/command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ struct CustomEventParameters: Content {
}

struct IdentifyEventParameters: Content, Decodable {
var context: LDContext?
var user: LDUser?
var context: LDContext
}

struct ContextBuildParameters: Content, Decodable {
Expand Down
29 changes: 0 additions & 29 deletions ContractTests/Source/Models/user.swift

This file was deleted.

2 changes: 1 addition & 1 deletion LaunchDarkly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |ld|

ld.name = "LaunchDarkly"
ld.version = "8.2.0"
ld.version = "9.0.0"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand Down
Loading

0 comments on commit cb42f92

Please sign in to comment.