Skip to content

Commit

Permalink
prepare 5.0.1 release (#215)
Browse files Browse the repository at this point in the history
## [5.0.1] - 2020-07-23
**Note that this release contains the notes for the 5.0.0 release, which should not be used.**

This major version has an accompanying [Migration Guide](https://docs.launchdarkly.com/sdk/client-side/ios/migration-4-to-5). Please see the guide for more information on updating to this version of the SDK, as the following is just a summary of the changes.

### Added
- Support for multiple LaunchDarkly projects or environments. Each set of feature flags associated with a mobile key is called an environment. This adds:
  * `LDConfig.setSecondaryMobileKeys` and `LDConfig.getSecondaryMobileKeys` which allows configuring a mapping of names to the SDK keys for each additional environment. `LDConfig.mobileKey` is still required, and represents the primary environment.
  * `LDClient.get(environment: )` which allows retrieving an LDClient instance for a given environment after the SDK has been initialized.
  * Equivalent methods have been added to the Objective-C bindings for `LDConfig` and `LDClient`.
- The SDK now periodically sends diagnostic data to LaunchDarkly, describing the version and configuration of the SDK, the operating system the SDK is running on, the device type (such as "iPad"), and performance statistics. No credentials, device IDs, or other identifiable values are included. This behavior can be disabled or configured with the new `LDConfig` properties `diagnosticOptOut` and `diagnosticRecordingInterval`.
- The SDK can now be configured with `LDConfig.wrapperName` and `LDConfig.wrapperVersion` to send an additional header (`X-LaunchDarkly-Wrapper`) in requests to LaunchDarkly. This was added so that the usage of wrapper libraries (such as the [React Native SDK](https://github.com/launchdarkly/react-native-client-sdk)) could be recorded independently.
- Added the `evaluationReasons` field to the Objective-C bindings for `LDConfig` to allow configuring the SDK to request evaluation reasons when the application is written in Objective-C.
- The SDK now supports using the [Swift Package Manager](https://swift.org/package-manager/) to include the SDK as a dependency.
- `LDInvalidArgumentError` that is thrown on incorrect API usage.
- Added `typeMismatch` field to `ObjcLD<T>ChangedFlag` classes (bound to `LD<T>ChangedFlag` in Objective-C) that is `true`/`YES` when the flag value did not match the registered observer.

### Changed (build)
- Minimum deployment targets have been changed as follows:
  * iOS 8.0 -> 10.0
  * macOS 10.10 -> 10.12
  * tvOS 9.0 -> 10.0
  * watchOS 2.0 -> 3.0
- The SDK has replaced the internal dependency on the Objective-C eventsource implementation [DarklyEventSource](https://github.com/launchdarkly/ios-eventsource) with a pure Swift implementation [LDSwiftEventSource](https://github.com/launchdarkly/swift-eventsource). Build configurations that manually specify the DarklyEventSource dependency framework may require additional upgrade steps. See the [Migration Guide](https://docs.launchdarkly.com/sdk/client-side/ios/migration-4-to-5) for more information.
- Internally, the SDK no longer includes its dependencies using CocoaPods and Carthage. This simplifies including the SDK as a subproject of your application for integrating the SDK without a package manager.

### Changed (API)
- The `LDClient` instance method `start` has been replaced with a static method `LDClient.start` for initializing all configured environments.
- `LDChangedFlag` no longer includes the `oldValueSource` and `newValueSource` properties, as `LDFlagValueSource` was removed.
- The following were renamed for consistency internally and with other SDKs:
  * `LDClient.reportEvents()` has been renamed to `LDClient.flush()`.
  * `LDClient.stop()` has been renamed to `LDClient.close()`.
  * `LDClient.trackEvent(key: data: )` method have been renamed to `LDClient.track(key: data: )`
  * `LDClient.allFlagValues` has been renamed to `LDClient.allFlags`.
  * `EvaluationDetail` has been renamed to `LDEvaluationDetail`.
  * The `ObjC<T>EvaluationDetail` classes have been renamed to corresponding `ObjcLD<T>EvaluationDetail`. The names when exposed in Objective-C have been updated to replace the `ObjC` prefix with `LD`, e.g. `ObjCStringEvaluationDetail` to `LDStringEvaluationDetail`.
- `LDClient.track` no longer throws `JSONError` and instead throws `LDInvalidArgumentError`.
- The `fallback` parameter of all `LDClient` and `ObjcLDClient` variation methods has been renamed to `defaultValue` to help distinguish it from `fallback` values in rules specified in the LaunchDarkly dashboard.

### Changed (behavioral)
- The maximum backoff delay between failed streaming connections has been reduced from an hour to 30 seconds. This is to prevent being unable to receive new flag values for up to an hour if the SDK has reached its maximum backoff due to a period of network connectivity loss.
- The backoff on streaming connections will not be reset after just a successful connection, rather waiting for a healthy connection for one minute after receiving flags. This is to reduce congestion in poor network conditions or if extreme load prevents the LaunchDarkly service from maintaining an active streaming connection.
- When sending events to LaunchDarkly, the SDK will now retry the request after a one second delay if it fails.
- When events fail to be sent to LaunchDarkly, the SDK will no longer retain the events. This prevents double recording events when the LaunchDarkly service received the event but the SDK failed to receive the acknowledgement.
- The `LDClient.identify`, `LDClient.flush`, `LDClient.setOnline`, and `LDClient.close` instance methods now operate on all configured environments. Any completion arguments will complete when the operation has completed for all configured environments.

### Removed
- The `LDClient.shared` static property and its `ObjcLDClient.sharedInstance` wrapper property has been removed. After calling `LDClient.start`, the initialized instances can be retrieved with `LDClient.get(environment: )`.
- The `LDClient.config` and its `ObjcLDClient.config` wrapper property has been removed, configuration of the SDK should be done with `LDClient.start`.
- The `LDClient.user` and its `ObjcLDClient.user` wrapper property has been removed. The initial user should be configured with `LDClient.start`, and updates to the user should be performed with `LDClient.identify`.
- `LDFlagValueSource` and `ObjcLDFlagValueSource` were removed in favor of using `LDEvaluationDetail` and `ObjcLD<T>EvaluationDetail`.
- The Objective-C wrapper classes `ObjcLD<T>VariationValue` (bound in Objective-C to `LD<T>VariationValue`), which wrapped a flag value and its source, have been removed.
- `variationAndSource` methods were removed from `LDClient` and its `ObjcLDClient` wrapper in favor of `variationDetail` methods.
- `LDUser.init?(object: )` and corresponding `ObjcLDUser` failable initializers were removed.
- `JSONError` and `JSONErrorDomain` extensions on `JSONSerialization` were removed.
- Removed `isEqual` extension to `Array`, this was only intended for internal SDK use.
- Removed `==` and `!=` extension to `Optional<[String: Any]>` (note that this was not declared as `Equatable` conformance). This extension was only intended for internal SDK use.
- Removed `LDFlagValue` enum and the `ObjcLDFlagValue` wrapper which were exposed but not used in any public APIs.
- Removed `Sysctl` struct (only available on macOS) which was only intended for internal SDK use.
  • Loading branch information
gwhelanLD authored Jul 23, 2020
1 parent ce24744 commit 34a91e3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

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

## [5.0.0] - 2020-07-23
## [5.0.1] - 2020-07-23
**Note that this release contains the notes for the 5.0.0 release, which should not be used.**

This major version has an accompanying [Migration Guide](https://docs.launchdarkly.com/sdk/client-side/ios/migration-4-to-5). Please see the guide for more information on updating to this version of the SDK, as the following is just a summary of the changes.

Expand Down Expand Up @@ -61,6 +62,9 @@ This major version has an accompanying [Migration Guide](https://docs.launchdark
- Removed `LDFlagValue` enum and the `ObjcLDFlagValue` wrapper which were exposed but not used in any public APIs.
- Removed `Sysctl` struct (only available on macOS) which was only intended for internal SDK use.

## [5.0.0] - 2020-07-23
**Please use the 5.0.1 instead. This release incorrectly specifies its version and is unavailable on CocoaPods**

## [4.7.0] - 2020-06-03
### Added
- Added a new method signature for `startCompleteWhenFlagsReceived` that accepts an additional argument specifying a maximum time to wait for flags to be received before calling the completion closure. The completion closure on this method will be passed a `Bool` on completion indication whether the operation timed out.
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 = "4.7.0"
ld.version = "5.0.1"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand Down
32 changes: 14 additions & 18 deletions LaunchDarkly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1634,12 +1634,11 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1658,12 +1657,11 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
MODULEMAP_FILE = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
PRODUCT_NAME = LaunchDarkly_tvOS;
Expand All @@ -1682,13 +1680,11 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand All @@ -1705,13 +1701,11 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
PRODUCT_NAME = LaunchDarkly_macOS;
SDKROOT = macosx;
Expand Down Expand Up @@ -1754,8 +1748,11 @@
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 5.0.1;
DYLIB_CURRENT_VERSION = 5.0.1;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_VERSION = B;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1822,8 +1819,11 @@
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 5.0.1;
DYLIB_CURRENT_VERSION = 5.0.1;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_VERSION = B;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -1855,12 +1855,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
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 = 5.0.1;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand All @@ -1876,12 +1875,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
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 = 5.0.1;
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
PRODUCT_NAME = LaunchDarkly;
Expand Down Expand Up @@ -1919,12 +1917,11 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand All @@ -1942,12 +1939,11 @@
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
MARKETING_VERSION = 5.0.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
PRODUCT_NAME = LaunchDarkly_watchOS;
SDKROOT = watchos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ struct EnvironmentReporter: EnvironmentReporting {
var shouldThrottleOnlineCalls: Bool { true }
#endif

var sdkVersion: String {
Bundle(for: LDClient.self).infoDictionary?["CFBundleShortVersionString"] as? String ?? "4.x"
}
let sdkVersion = "5.0.1"
// 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"
// }
}

#if os(OSX)
Expand Down
2 changes: 1 addition & 1 deletion LaunchDarkly/LaunchDarkly/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.1.1</string>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 2 additions & 0 deletions MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ LaunchDarkly Migration Guide for the iOS Swift SDK
==================================================

# Getting Started
**This documentation is for migrating from the v2.x or v3.x Objective-C implementations of the SDK to the previous major version of the SDK. For information on upgrading from 4.x to the 5.0 major release, see the [Migration Guide](https://docs.launchdarkly.com/sdk/client-side/ios/migration-4-to-5) on the documentation site.**

Follow the steps below to migrate your app from v2.x or v3.x to v4.x. Most of these steps will be required, your IDE will give you build errors if you don't take them. We recommend reading through the guide before starting to get a feel for what you will need to do to migrate your app to v4.x.

### Multiple Environments
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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: "5.0.0"))
.package(url: "https://github.com/launchdarkly/ios-client-sdk.git", .upToNextMinor(from: "5.0.1"))
]
```

Expand Down

0 comments on commit 34a91e3

Please sign in to comment.