iOS/tvOS/macOS 1.6.6 Migration Guide¶
This document is intended for projects migrating from the old iOS SDK / macOS SDK to SDK 1.6.6 and later. Starting from 1.6.6, the main SDK for Apple platforms is unified as GuanceSDK, shared by iOS, tvOS, and macOS.
macOS Alpha Note
macOS is currently in Alpha status, and not all iOS features are guaranteed to be supported. Before integrating macOS, please verify core chains such as initialization, RUM, Log, Trace, and data synchronization in a test environment.
Overview of Changes¶
- The main SDK library is unified as
GuanceSDK. datakit-macosis no longer maintained separately; macOS capabilities are merged into the current SDK repository.- Session Replay is provided as a standalone product
GuanceSessionReplay, supporting iOS only. - Widget Extension is provided as a standalone product
GuanceWidgetExtension, for iOS Widget Extension Targets only. - iOS, tvOS, and macOS share the main SDK; APIs not supported on a particular platform will be declared with availability attributes.
| Component | iOS | tvOS | macOS |
|---|---|---|---|
GuanceSDK |
Supported | Supported | Alpha |
GuanceSessionReplay |
Supported | Not Supported | Not Supported |
GuanceWidgetExtension |
Supported | Not Supported | Not Supported |
Minimum system versions are defined by the release package configuration:
- iOS 12.0+
- tvOS 12.0+
- macOS 10.14+
Installation Migration¶
CocoaPods¶
Old main SDK:
Migrate to:
For Session Replay:
For Widget Extension data collection, integrate only in the Widget Extension Target. New integrations should use the WidgetExtension subspec:
If your old project originally used pod 'FTMobileSDK', :subspecs => ['Extension'], after upgrading to GuanceSDK, you can continue using the compatibility subspec:
Compatibility notes:
GuanceSDKincludes the main SDK capabilities by default.GuanceSDK/SessionReplaysupports iOS only.GuanceSDK/WidgetExtensionis for iOS Widget Extension Targets only.- The old
GuanceSDK/FTSessionReplayandGuanceSDK/Extensionare kept as compatibility aliases.pod 'GuanceSDK', :subspecs => ['Extension']can also continue to integrate Widget Extension capabilities. New integrations should useSessionReplayandWidgetExtension. - macOS Targets should not integrate the
SessionReplayorWidgetExtensionsubspec.
Swift Package Manager¶
SPM product names have been updated to the new brand product names:
| Old Product | New Product |
|---|---|
FTMobileSDK |
GuanceSDK |
FTSessionReplay |
GuanceSessionReplay |
FTMobileExtension |
GuanceWidgetExtension |
After adding the Swift Package in Xcode, select the corresponding product for your Target:
- App Target:
GuanceSDK - iOS Session Replay Target:
GuanceSessionReplay - Widget Extension Target:
GuanceWidgetExtension
Swift import:
For Session Replay:
Framework / XCFramework¶
Framework product names have been updated:
| Old Product | New Product |
|---|---|
FTMobileSDK.xcframework |
GuanceSDK.xcframework |
FTSessionReplay.xcframework |
GuanceSessionReplay.xcframework |
FTMobileExtension.xcframework |
GuanceWidgetExtension.xcframework |
Objective-C is recommended to use the new entry header:
Compatibility entries are still available:
Session Replay recommended entry header by integration method:
| Integration Method | Objective-C import |
|---|---|
| CocoaPods | #import <GuanceSDK/GuanceSessionReplay.h> |
| Swift Package Manager | @import GuanceSessionReplay; |
| Framework / XCFramework | #import <GuanceSessionReplay/GuanceSessionReplay.h> |
The old Session Replay headers are still compatible. CocoaPods integration uses the GuanceSDK path, Framework / XCFramework integration uses the GuanceSessionReplay path, Swift Package Manager uses module import directly: |
// CocoaPods
#import <GuanceSDK/FTSessionReplay.h>
// Framework / XCFramework
#import <GuanceSessionReplay/FTSessionReplay.h>
// Swift Package Manager
@import GuanceSessionReplay;
API Migration¶
Initialization Configuration¶
New code is recommended to migrate from FTMobileConfig to FTSDKConfig.
Old approach:
FTMobileConfig *config = [[FTMobileConfig alloc] initWithDatakitUrl:datakitUrl];
[FTMobileAgent startWithConfigOptions:config];
New approach:
FTSDKConfig *config = [[FTSDKConfig alloc] initWithDatakitUrl:datakitUrl];
[FTMobileAgent startWithConfigOptions:config];
Notes:
FTMobileConfigis still usable now, and inherits fromFTSDKConfig.FTMobileConfigis deprecated; new code should useFTSDKConfig.FTMobileAgentcan still be used as the entry point; new code can also use the compatibility aliasFTSDKAgent.
Sampling Rate Parameter Naming¶
samplerate has been adjusted to the standard camelCase sampleRate.
Affected configurations:
FTRumConfigFTTraceConfigFTLoggerConfig
Old approach:
FTRumConfig *rumConfig = [[FTRumConfig alloc] initWithAppid:appId];
rumConfig.samplerate = 100;
FTTraceConfig *traceConfig = [[FTTraceConfig alloc] init];
traceConfig.samplerate = 100;
FTLoggerConfig *loggerConfig = [[FTLoggerConfig alloc] init];
loggerConfig.samplerate = 100;
New approach:
FTRumConfig *rumConfig = [[FTRumConfig alloc] initWithAppid:appId];
rumConfig.sampleRate = 100;
FTTraceConfig *traceConfig = [[FTTraceConfig alloc] init];
traceConfig.sampleRate = 100;
FTLoggerConfig *loggerConfig = [[FTLoggerConfig alloc] init];
loggerConfig.sampleRate = 100;
Notes:
samplerateis still usable now, but deprecated.sampleRateandsampleratemap to the same value.- For SDK versions below 1.6.6, continue to use
samplerate.
Session Replay¶
Session Replay related public types still use the FT prefix, for example:
Old code may use different paths depending on the integration method:
New code should select the entry header by integration method:
| Integration Method | Objective-C import |
|---|---|
| CocoaPods | #import <GuanceSDK/GuanceSessionReplay.h> |
| Swift Package Manager | @import GuanceSessionReplay; |
| Framework / XCFramework | #import <GuanceSessionReplay/GuanceSessionReplay.h> |
| For privacy masking capabilities, also select the entry by integration method: |
| Integration Method | Privacy Masking Entry |
|---|---|
| CocoaPods | #import <GuanceSDK/UIView+FTSRPrivacy.h> |
| Swift Package Manager | @import GuanceSessionReplay; |
| Framework / XCFramework | #import <GuanceSessionReplay/UIView+FTSRPrivacy.h> |
| New code is recommended to directly import the entry. The following is the Swift Package Manager approach; for CocoaPods or Framework / XCFramework integration, use the corresponding paths in the table above: |
Widget Extension¶
The Widget Extension component should be integrated only in the Widget Extension Target.
CocoaPods example. New integrations should use the WidgetExtension subspec:
When upgrading an old project, if it originally used pod 'FTMobileSDK', :subspecs => ['Extension'], you can continue to keep the subspec form:
Swift Package Manager example:
// Add the product to the Widget Extension Target:
// GuanceWidgetExtension```
Objective-C import by integration method:
| Integration Method | Objective-C import |
| --- | --- |
| CocoaPods | `#import <GuanceSDK/GuanceWidgetExtension.h>` |
| Swift Package Manager | `@import GuanceWidgetExtension;` |
| Framework / XCFramework | `#import <GuanceWidgetExtension/GuanceWidgetExtension.h>` |
Swift Package Manager example:
```objc
@import GuanceWidgetExtension;
Framework / XCFramework example:
macOS Considerations¶
macOS has been merged into the main SDK and is currently in Alpha status. When migrating macOS projects:
- Do not integrate
GuanceSessionReplay. - Do not integrate
GuanceWidgetExtension. - Not all iOS features are guaranteed to be supported.
- For APIs marked with
API_UNAVAILABLE(macos), remove the calls or isolate them with conditional compilation.
Example:
Recommended Migration Steps¶
- First update the dependency name: switch the CocoaPods / SPM / Framework product to
GuanceSDK. - Update imports: for Objective-C, prefer the new entry headers; for Swift, use the corresponding product module's
importentry. - Replace
FTMobileConfigwithFTSDKConfigin new code. - Replace
sampleratewithsampleRate. - Confirm separately if the iOS Target needs
GuanceSessionReplay. - Confirm separately if the Widget Extension Target needs
GuanceWidgetExtension. - For macOS Targets, check unavailable APIs and adjust code based on availability.
Compatibility Notes¶
To reduce migration costs, the following old entries are still compatible for now:
FTMobileSDK.hFTMobileAgent.hFTMobileConfigsamplerateFTSessionReplay.h
These compatibility entries may be removed in future major versions. New code is recommended to use the new integration products, entry headers, and standard naming.