Skip to content

Commit

Permalink
prepare 8.3.0 release (#306)
Browse files Browse the repository at this point in the history
## [8.3.0] - 2023-09-08
### Changed:
- Deprecated `LDValue.init(integerLiteral: Double)` as this method
signature is misleading. A new `LDValue.init(integerLiteral: Int)`
signature has been added for clarity.

---------

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: 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: tanderson-ld <[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]>
Co-authored-by: Todd Anderson <[email protected]>
  • Loading branch information
13 people authored Sep 8, 2023
1 parent 7635ef4 commit 89f5d3e
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 44 deletions.
20 changes: 3 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,7 @@ workflows:
xcode-version: '14.0.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 14,OS=16.0'
- build:
name: Xcode 13.3 - Swift 5.6
xcode-version: '13.3.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 13,OS=15.4'
- build:
name: Xcode 13.1 - Swift 5.5
xcode-version: '13.1.0'
ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.0'
build-doc: true
run-lint: true
- build:
name: Xcode 12.5 - Swift 5.4
xcode-version: '12.5.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.5'
- build:
name: Xcode 11.7 - Swift 5.2
xcode-version: '11.7.0'
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.4'
name: Xcode 13.4.1 - Swift 5.6
xcode-version: '13.4.1'
ios-sim: 'platform=iOS Simulator,name=iPhone 13,OS=15.5'
- contract-tests
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## [8.3.0] - 2023-09-08
### Changed:
- Deprecated `LDValue.init(integerLiteral: Double)` as this method signature is misleading. A new `LDValue.init(integerLiteral: Int)` signature has been added for clarity.

## [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
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 = "8.3.0"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand Down
20 changes: 10 additions & 10 deletions LaunchDarkly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1526,7 +1526,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1549,7 +1549,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand All @@ -1570,7 +1570,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand Down Expand Up @@ -1614,7 +1614,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 8.0.0;
DYLIB_CURRENT_VERSION = 8.2.0;
DYLIB_CURRENT_VERSION = 8.3.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_VERSION = E;
Expand Down Expand Up @@ -1685,7 +1685,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 8.0.0;
DYLIB_CURRENT_VERSION = 8.2.0;
DYLIB_CURRENT_VERSION = 8.3.0;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_VERSION = E;
Expand Down Expand Up @@ -1724,7 +1724,7 @@
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand All @@ -1744,7 +1744,7 @@
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand Down Expand Up @@ -1786,7 +1786,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand All @@ -1808,7 +1808,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 8.2.0;
MARKETING_VERSION = 8.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand Down
15 changes: 15 additions & 0 deletions LaunchDarkly/LaunchDarkly/LDCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,25 @@ public enum LDValue: Codable,
self = .bool(booleanLiteral)
}

/// Create an LDValue representation from the provided Double value.
///
/// This method DOES NOT truncate the provided Double. As JSON numeric
/// values are always treated as double-precision, this method will
/// store the given Double as it.
@available(*, deprecated, message: "Use LDValue.init(integerLiteral: Int) or LDValue.init(floatLiteral: Double)")
public init(integerLiteral: Double) {
self = .number(integerLiteral)
}

/// Create an LDValue representation from the provided Int.
///
/// All JSON numeric types are represented as double-precision so the
/// provided Int will be cast to a Double.
public init(integerLiteral: Int) {
self = .number(Double(integerLiteral))
}

/// Create an LDValue representation from the provided Double.
public init(floatLiteral: Double) {
self = .number(floatLiteral)
}
Expand Down
45 changes: 33 additions & 12 deletions LaunchDarkly/LaunchDarkly/Models/LDUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public struct LDUser: Encodable, Equatable {

static let storedIdKey: String = "ldDeviceIdentifier"

/// Client app defined string that uniquely identifies the user. If the client app does not define a key, the SDK will assign an identifier associated with the anonymous user. The key cannot be made private.
/// Client app defined string that uniquely identifies the user. If the client app does not define a key, the SDK
/// will assign an identifier associated with the anonymous user. The key cannot be made private.
public var key: String
/// Client app defined name for the user. (Default: nil)
public var name: String?
Expand All @@ -29,33 +30,47 @@ public struct LDUser: Encodable, Equatable {
public var email: String?
/// Client app defined avatar for the user. (Default: nil)
public var avatar: String?
/// Client app defined dictionary for the user. The client app may declare top level dictionary items as private, see `privateAttributes` for details. (Default: [:])
/// Client app defined dictionary for the user. The client app may declare top level dictionary items as private,
/// see `privateAttributes` for details. (Default: [:])
public var custom: [String: LDValue]
/// Client app defined isAnonymous for the user. If the client app does not define isAnonymous, the SDK will use the `key` to set this attribute. isAnonymous cannot be made private. (Default: false)
/// Client app defined isAnonymous for the user. If the client app does not define isAnonymous, the SDK will use the
/// `key` to set this attribute. isAnonymous cannot be made private. (Default: false)
public var isAnonymous: Bool

/**
Client app defined privateAttributes for the user.
The SDK will not include private attribute values in analytics events, but private attribute names will be sent.
This attribute is ignored if `LDConfig.allUserAttributesPrivate` is true. Combined with `LDConfig.privateUserAttributes`. The SDK considers attributes appearing in either list as private. Client apps may define most built-in attributes and all top level `custom` dictionary keys here. (Default: []])

This attribute is ignored if `LDConfig.allUserAttributesPrivate` is true. Combined with
`LDConfig.privateUserAttributes`. The SDK considers attributes appearing in either list as private. Client apps may
define most built-in attributes and all top level `custom` dictionary keys here. (Default: []])

See Also: `LDConfig.allUserAttributesPrivate` and `LDConfig.privateUserAttributes`.
*/
public var privateAttributes: [UserAttribute]

var contextKind: String { isAnonymous ? "anonymousUser" : "user" }

/**
Initializer to create a LDUser. Client configurable attributes each have an optional parameter to facilitate setting user information into the LDUser. The SDK will automatically set `key`, `device`, `operatingSystem`, and `isAnonymous` attributes if the client does not provide them. The SDK embeds `device` and `operatingSystem` into the `custom` dictionary for transmission to LaunchDarkly.
- parameter key: String that uniquely identifies the user. If the client app does not define a key, the SDK will assign an identifier associated with the anonymous user.
Initializer to create a LDUser. Client configurable attributes each have an optional parameter to facilitate
setting user information into the LDUser. The SDK will automatically set `key`, `device`, `operatingSystem`, and
`isAnonymous` attributes if the client does not provide them. The SDK embeds `device` and `operatingSystem` into
the `custom` dictionary for transmission to LaunchDarkly.

- parameter key: String that uniquely identifies the user. If the client app does not define a key, the SDK will
assign an identifier associated with the anonymous user.
- parameter name: Client app defined name for the user. (Default: nil)
- parameter firstName: Client app defined first name for the user. (Default: nil)
- parameter lastName: Client app defined last name for the user. (Default: nil)
- parameter country: Client app defined country for the user. (Default: nil)
- parameter ipAddress: Client app defined ipAddress for the user. (Default: nil)
- parameter email: Client app defined email address for the user. (Default: nil)
- parameter avatar: Client app defined avatar for the user. (Default: nil)
- parameter custom: Client app defined dictionary for the user. The client app may declare top level dictionary items as private. If the client app defines custom as private, the SDK considers the dictionary private except for device & operatingSystem (which cannot be made private). See `privateAttributes` for details. (Default: nil)
- parameter isAnonymous: Client app defined isAnonymous for the user. If the client app does not define isAnonymous, the SDK will use the `key` to set this attribute. (Default: nil)
- parameter custom: Client app defined dictionary for the user. The client app may declare top level dictionary
items as private. If the client app defines custom as private, the SDK considers the dictionary private except for
device & operatingSystem (which cannot be made private). See `privateAttributes` for details. (Default: nil)
- parameter isAnonymous: Client app defined isAnonymous for the user. If the client app does not define
isAnonymous, the SDK will use the `key` to set this attribute. (Default: nil)
- parameter privateAttributes: Client app defined privateAttributes for the user. (Default: nil)
*/
public init(key: String? = nil,
Expand Down Expand Up @@ -113,7 +128,8 @@ public struct LDUser: Encodable, Equatable {
/**
Internal helper method to convert an LDUser to an LDContext.

Ideally we would do this as the LDUser was being built. However, the LDUser properties are publicly accessible, which makes that approach problematic.
Ideally we would do this as the LDUser was being built. However, the LDUser properties are publicly accessible,
which makes that approach problematic.
*/
internal func toContext() -> Result<LDContext, ContextBuilderError> {
var contextBuilder = LDContextBuilder(key: key)
Expand Down Expand Up @@ -200,11 +216,16 @@ public struct LDUser: Encodable, Equatable {
}
}

/// Default key is the LDUser.key the SDK provides when any intializer is called without defining the key. The key should be constant with respect to the client app installation on a specific device. (The key may change if the client app is uninstalled and then reinstalled on the same device.)
/// - parameter environmentReporter: The environmentReporter provides selected information that varies between OS regarding how it's determined
/// Default key is the LDUser.key the SDK provides when any intializer is called without defining the key. The key
/// should be constant with respect to the client app installation on a specific device. (The key may change if the
/// client app is uninstalled and then reinstalled on the same device.)
///
/// - parameter environmentReporter: The environmentReporter provides selected information that varies between OS
/// regarding how it's determined
static func defaultKey(environmentReporter: EnvironmentReporting) -> String {
// For iOS & tvOS, this should be UIDevice.current.identifierForVendor.UUIDString
// For macOS & watchOS, this should be a UUID that the sdk creates and stores so that the value returned here should be always the same
// For macOS & watchOS, this should be a UUID that the sdk creates and stores so that the value returned here
// should be always the same
if let vendorUUID = environmentReporter.vendorUUID {
return vendorUUID
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct EnvironmentReporter: EnvironmentReporting {
#endif

var shouldThrottleOnlineCalls: Bool { !isDebugBuild }
let sdkVersion = "8.2.0"
let sdkVersion = "8.3.0"
// Unfortunately, the following does not function in certain configurations, such as when included through SPM
// var sdkVersion: String {
// Bundle(for: LDClient.self).infoDictionary?["CFBundleShortVersionString"] as? String ?? "5.x"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To include LaunchDarkly in a Swift package, simply add it to the dependencies se

```swift
dependencies: [
.package(url: "https://github.com/launchdarkly/ios-client-sdk.git", .upToNextMinor(from: "8.2.0"))
.package(url: "https://github.com/launchdarkly/ios-client-sdk.git", .upToNextMinor(from: "8.3.0"))
]
```

Expand All @@ -60,7 +60,7 @@ To use the [CocoaPods](https://cocoapods.org) dependency manager to integrate La
```ruby
use_frameworks!
target 'YourTargetName' do
pod 'LaunchDarkly', '~> 8.2'
pod 'LaunchDarkly', '~> 8.3'
end
```

Expand All @@ -71,7 +71,7 @@ To use the [Carthage](https://github.com/Carthage/Carthage) dependency manager t
To integrate LaunchDarkly into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "launchdarkly/ios-client-sdk" ~> 8.2
github "launchdarkly/ios-client-sdk" ~> 8.3
```

### Manual installation
Expand Down

0 comments on commit 89f5d3e

Please sign in to comment.