Amplitude iOS SDK
An iOS SDK for tracking events and revenue to Amplitude.
Please see our installation guide for instructions on installing and using our iOS SDK.
iOS SDK Reference
See our iOS SDK Reference for a list and description of all available SDK methods.
- 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 questions about using or installing our iOS SDK, you can send an email to Amplitude Support.
Amplitude The MIT License (MIT) Copyright (c) 2014 Amplitude Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You may find interesting
v4.10.0 - 2020-02-04 19:18:04
- 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).
v4.9.3 - 2019-11-23 01:16:45
Fix error for not finding declaration for NSObject when using Swift Package Manager
v4.9.0 - 2019-11-21 23:23:03
Added support for Swift Package Manager. Kudos to contribution from @mayur1407.
- 2019-10-07 17:27:23
Ensure background tasks are always ended and add safeguard before retrieving the app by checking for valid uploadTaskID
v4.8.1 - 2019-09-24 18:19:38
- Suppress NSLogs for non-dev environments.
v4.8.0 - 2019-09-24 18:19:07
- Identify Macs for Mac Catalyst support.
v4.7.1 - 2019-09-24 18:18:39
- Fix issue where tag wasn't included in tag spec
v4.7.0 - 2019-09-24 18:18:07
- Fix bug where background task might be stopped before final events are flushed
- Revert logic to restore db from memory on potential db resets
v4.6.0 - 2019-03-02 00:41:05
- 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
v4.5.0 - 2018-12-19 00:46:28
- Add ability to set a custom server URL for uploading events using
v4.4.0 - 2018-10-16 00:47:50
- Add ability to set group properties via a new
groupIdentifyWithGroupTypemethod that takes in an
AMPIdentifyobject as well as a group type and group name.
v4.3.1 - 2018-08-14 18:58:10
- Update SDK to better handle SQLite Exceptions.
v4.3.0 - 2018-07-25 03:37:21
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.
v4.2.1 - 2018-05-21 18:21:37
- Fix a bunch of compiler warnings
- Fix SSLPinning import so that it doesn't corrupt debug console. Thanks to @rob-keepsafe for the PR
v4.2.0 - 2018-04-20 01:23:52
- Added a
setUserIdmethod with optional boolean argument
startNewSession, which when
YESstarts a new session after changing the userId.
v4.1.0 - 2018-02-28 00:40:12
- Add option to disable IDFA tracking. To disable IDFA tracking call
[[Amplitude instance] disableIdfaTracking];before initializing with your API key.
v4.0.4 - 2017-10-24 00:12:19
- Fix bug where events in the initial session for brand new users have a session id of -1 (introduced in v4.0.2).
v4.0.3 - 2017-10-16 21:26:03
- Fix unknown carrier caching. This fixes "Could not successfully update network info during initialization" warnings when logging events on devices without SIM cards.
v4.0.2 - 2017-10-13 22:53:46
- 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.
v4.0.1 - 2017-09-18 23:31:45
- Lowering minimum required iOS version down to 7.0.
v4.0.0 - 2017-09-18 22:34:36
- Minimum required iOS version is now 9.0
- Removed deprecated methods, fixed warnings in Xcode 9, adding support for iOS 11.
- Migrate setup instructions and SDK documentation in the README file to Zendesk articles.
v3.14.1 - 2017-03-15 04:22:16
- Catch exceptions when looking up device carrier.
- Fix build warnings caused by certificate files in the Podfile. Thanks to @benasher44 for the PR.
- Fix warnings for missing new line at end of files. Thanks to @teanet for reporting.
- Fix linker warnings when using Amplitude framework in an extension target. Thanks to @r-peck for the PR.
v3.14.0 - 2017-02-02 20:27:07
- Add support for enabling SSL-pinning via Cocoapods. Thanks to @aaronwasserman for the PR. See Readme for more information.
v3.13.0 - 2017-01-30 23:34:22
- Add support for tvOS. Thanks to @gabek for the original PR. See Readme for more information.
- Bump iOS minimum deployment target to 6.0.
- Update device list. Thanks to @subbotkin for the PR.
v3.12.1 - 2017-01-30 23:33:59
- Fix bug where
regenerateDeviceIdwas not being run on background thread.
[AMPDeviceInfo generateUUID]should be a static method.
v3.12.0 - 2016-12-06 02:06:17
- Add helper method to regenerate a new random deviceId. This can be used in conjunction with
setUserId:nilto anonymize a user after they log out. Note this is not recommended unless you know what you are doing. See Readme for more information.
v3.11.1 - 2016-11-08 01:10:53
logEventwith a custom long long timestamp (milliseconds since epoch). See iOS documentation for more details.
v3.11.0 - 2016-11-07 23:56:39
logEventwith a custom timestamp (milliseconds since epoch). If the timestamp value is
nil, then the event is timestamped with the current time. If setting a custom timestamp, you should use
[NSNumber numberWithLongLong:milliseconds]. See iOS documentation for more details.
v3.10.1 - 2016-10-31 23:56:16
- Enable "Weak References in Manual Retain Release" to fix build errors in Xcode 7.3 and up.
v3.10.0 - 2016-10-26 22:27:09
- Add ability to log identify events outOfSession, this is useful for updating user properties without triggering session-handling logic. See Readme for more information.