Official Amplitude iOS SDK
iOS/tvOS/macOS SDK for tracking events and revenue to Amplitude.
Installation and Quick Start
- For using the SDK, please visit our :100:Developer Center.
- For developing the SDK, please visit our CONTRIBUTING.md.
- A demo application showing the integration of our SDK using Cocoapods.
- A demo application showing the integration of our SDK using Carthage.
- A demo application showing the integration of our SDK via Segment's iOS SDK.
- A demo application showing an integration in an iOS extension.
- A demo application demonstrating a potential integration with Google Tag Manager.
Click here to view the iOS SDK Changelog.
If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.
You may find interesting
- buildsettings: Remove override for GCC_WARN_INHIBIT_ALL_WARNINGS (#302) (0e55297)
- deprecation warnings: Fix deprecation warnings (#301) (e7b0e6e), closes /github.com/amplitude/Amplitude-iOS/issues/250#issuecomment-655224554
- deprecations: Use DEPRECATED_MSG_ATTRIBUTE instead of notes (#305) (f501c6c)
- nil dynamic config refresh crash (#288) (#289) (9dc896d)
- Swift UserId and DeviceId setter (#299) (b7c0f90)
- Explicitly add files in Resources for SPM (#292) (61da6d3)
- Add support to view/copy userId, deviceId to use Event Explorer (BETA). NOTE: This feature doesn't support Swift Package Manager yet.
Background: Users reported that IDFA MACRO still do not prevent app rejections. So we make both idfa and location tracking to be fully customer driven.
adSupportBlockto let idfa tracking to be customer driven.
locationInfoBlockto let location tracking to be customer driven.
- To accommodate the new rules over IDFA in iOS 14, we make some changes over our IDFA logic.
AMPLITUDE_IDFA_TRACKINGMARCO to control if IDFA logic is included in the binary.
useDynamicConfigflag!! Turning this flag on will find the best server url automatically based on users' geo location.
- Note 1. If you have your own proxy server and use
setServerUrlAPI, please leave this OFF.
- Note 2. If you have users in China Mainland, we suggest you turn this on.
- Note 3. By default, this feature is OFF. So you need to explicitly set it to ON to use it.
Related issues: #260 , #257
- Removed obsolete certificates used for SSL Pinning before.
- Fixed an implementation issue in SSL pinning. If you're using SSL pinning, please update your SDK ASAP.
- Added APIs to
Amplitudeto let users set
libraryname and version. This should be only used when you develop your own library which wraps Amplitude iOS SDK.
- Now macOS support!
- Covered both cases. (1) pure macOS App, (2) Mac Catalyst (Running iPad App on macOS)
- NOTE 1: CocoaPods users! Amplitude-iOS pod is deprecated (4.10.0 is the last version we support). Please use the new one Amplitude going forward.
- NOTE 2: If you encounter any issues when instrumenting your macOS App, please reach out to us!
- NOTE 3: Minimum supported iOS version is now 10.0 instead of 8.0 in the past. We made this decision since usages for 9.0 and 8.0 are extremely low now. (<= 1%)
- Please find new pod here! New https://cocoapods.org/pods/Amplitude
- Now you can enable or disable COPPA (Children's Online Privacy Protection Act) restrictions on IDFA, IDFV, city, IP address and location tracking.
- To enable COPPA, please call
[[Amplitude instance] enableCoppaControl];.
- To disable COPPA, please call
[[Amplitude instance] disableCoppaControl];.
- Fix partial truncation for string with unicode (e.g. emoji).
Fix error for not finding declaration for NSObject when using Swift Package Manager
Added support for Swift Package Manager. Kudos to contribution from @mayur1407.
Ensure background tasks are always ended and add safeguard before retrieving the app by checking for valid uploadTaskID
- Suppress NSLogs for non-dev environments.
- Identify Macs for Mac Catalyst support.
- Fix issue where tag wasn't included in tag spec
- Fix bug where background task might be stopped before final events are flushed
- Revert logic to restore db from memory on potential db resets
- Add support for installing on tvOS platform via Carthage
- Do not use IDFV or IDFA for device ID if disabled via tracking options
- Close Sqlite DB object even if open fails
startOrContinueSessionpublic method. Only call this if you know what you are doing. This may trigger a new session to start.
- Properly end background event flush task
- Increased minimum iOS deployment target to 8.0
- Add ability to set a custom server URL for uploading events using
- Add ability to set group properties via a new
groupIdentifyWithGroupTypemethod that takes in an
AMPIdentifyobject as well as a group type and group name.
- Update SDK to better handle SQLite Exceptions.
AMPTrackingOptionsinterface to customize the automatic tracking of user properties in the SDK (such as language, ip_address, platform, etc). See Help Center Documentation for instructions on setting up this configuration.
- Fix a bunch of compiler warnings
- Fix SSLPinning import so that it doesn't corrupt debug console. Thanks to @rob-keepsafe for the PR
- Added a
setUserIdmethod with optional boolean argument
startNewSession, which when
YESstarts a new session after changing the userId.
- Add option to disable IDFA tracking. To disable IDFA tracking call
[[Amplitude instance] disableIdfaTracking];before initializing with your API key.
- Fix bug where events in the initial session for brand new users have a session id of -1 (introduced in v4.0.2).
- Fix unknown carrier caching. This fixes "Could not successfully update network info during initialization" warnings when logging events on devices without SIM cards.
- Ensure the foreground checker in
initializeApiKeyruns on the main thread. This fixes the "UI API called on a background thread" warning.
- Removing unnecessary try / catch when looking up device carrier.