LogoLogo
My AppsLive demoNewsArticles
  • Introduction
  • 📌Product updates: 2025
    • 2024
    • 2023
  • Getting Started
    • Registration
    • Adding a space
    • Adding an app to the space
  • Basic Events & Custom Events
  • Integration
    • Expert Tips
      • What to track
      • Payments & Anti-cheat
      • Check your integration
    • Integration of SDK 2.0+
      • SDK Integration
        • Android
        • iOS
        • macOS
        • Windows
        • Web
          • Web SDK Integration
          • Web SDK Releases
        • Unity
        • Unreal Engine
        • Godot Engine
      • Automatic payment tracking
        • App Store
        • Google Play
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anticheat methods
        • Track sessions
      • Push notifications
        • Android
        • iOS
        • Windows (UWP)
        • Unity
          • Android
          • iOS
          • Windows (UWP/WSA)
        • Unreal Engine
      • A/B testing
        • Description of A/B testing on the SDK side
        • Working with A/B tests in the devtodev interface
        • A/B testing examples
    • Integration of SDK 1.0+ (deprecated)
      • SDK Integration
        • iOS
        • Android
        • Windows 8.1 and 10
        • Web
        • Unity
        • Mac OS
        • Adobe Air
        • UE4
      • Setting up Events
        • Basic methods
        • Secondary methods
        • User profile
        • Anti-cheat Methods
      • Push Notifications
        • IOS
        • Android
        • Windows 8.1 and Windows 10
        • Unity
        • Abode Air
        • UE4
    • Test Devices
    • Server API
      • Data API 2.0
      • Subscription API
      • Push API
        • IOS
        • Android
        • Windows UWP
        • Windows
      • Raw Export
      • Labels API
      • Data API
    • Import historical data via API
    • Data Export
      • Data Export to Cloud Storage (BigQuery / Amazon S3)
  • 3rd Party Sources
    • Attribution Trackers
      • AppsFlyer
      • Adjust
      • Branch.io
      • Kochava
      • Tenjin
      • Tune (MAT)
      • Singular
      • Custom postback API
      • Facebook Ads referral decryption
    • App Marketplace Data
      • App Store Connect Stats
      • App Store Subscriptions
      • Google Play Console Stats
      • Google Play Subscriptions
      • AppGallery Connect Stats
    • Ad revenue
      • AdColony
      • AdMob
      • Facebook
      • MoPub
      • Unity Ads
      • Vungle
      • Ad revenue API
    • Cohort export
  • Reports and Functionality
    • Space-related Reports and Functionality
      • Overview
      • Custom dashboards & Reports
      • SQL
        • SQL tips
        • SQL Query examples
      • Audience overlap
    • Project-related Reports and Functionality
      • Overview
        • Real-Time Dashboard
        • Acquisition reports
        • Engagement reports
        • Monetization reports
        • In-game analysis reports
        • Cohort analysis
      • Reports
      • Push Notifications
        • Android Notifications
        • IOS Notifications
        • Windows Notifications
        • Button Templates
      • Predictions
      • Users & Segments
      • Filters
      • A/B Testing
      • Tuning
      • Settings
  • Metrics and Glossary
    • Ad networks metrics
    • Market Metrics
    • Prediction Metrics
    • SDK Metrics
    • Subscription metrics
  • Space Management
  • User Profile Management
  • Limits
  • Scenarios and Best Practices
    • Analytics use cases
    • Match-3
    • MMORPG Games
    • Hyper-Casual games
    • Social Casino
    • RPG games
    • Farming games
    • Non-gaming app
    • Acquisition Example
  • FAQ
    • Identification
    • Raw Data
    • All about data discrepancies
  • Slack
Powered by GitBook
On this page
  • Manual installation
  • Integration features
  • Apps targeted at children

Was this helpful?

Export as PDF
  1. Integration
  2. Integration of SDK 2.0+
  3. SDK Integration

macOS

PreviousiOSNextWindows

Last updated 18 days ago

Was this helpful?

Manual installation

1.

2. Add DTDAnalytics.xcframework to the project (with Do Not Embed specified)

3. Add frameworks:

  • AppTrackingTransparency.framework

  • AdSupport.framework

4. Add initialization todidFinishLaunchingWithOptions method:

let config = DTDAnalyticsConfiguration()
config.logLevel = .error
DTDAnalytics.initialize(applicationKey: "App ID", configuration: config)
DTDAnalyticsConfiguration *config;
config.logLevel = DTDLogLevelError;
[DTDAnalytics applicationKey:@"App ID" configuration:config];
  • An App ID can be found in the settings of the respective app in devtodev (Settings → SDK → Integration → Credentials).

  • config - an object instance of DTDAnalyticsConfiguration, which is used for specifying additional properties during the initialization.

DTDAnalyticsConfiguration

Parameter

Type

Description

currentLevel

int

The player level at the moment of devtodev SDK initialization. It is recommended (but optional) to use to improve data precision.

userId

string

A custom user identifier provided by the developer. If you utilize the default calculation by the device ID, this identifier can be used for finding a user in devtodev.

In case your project utilizes the calculation by the user identifier, you must set this parameter because it becomes the main user identifier in devtodev.

trackingAvailability

DTDTrackingStatus (enum)

The property allows or disallows devtodev tracking of the user. By default, it is set to DTDTrackingStatus.enable. SDK stores the previously assigned value. Pass DTDTrackingStatus.disable if the user opted out of tracking in line with GDPR.

logLevel

DTDLogLevel (enum)

The level of logging the SDK activity. The DTDLogLevel.no value is used by default. For troubleshooting during integration it is recommended to set it to DTDLogLevel.debug, and either switch it off DTDLogLevel.no. Use DTDLogLevel.no in the release version.

Example:

let config = DTDAnalyticsConfiguration()
config.currentLevel = 1
config.userId = "CustomUserID"
config.trackingAvailability = .enable
config.logLevel = .no
DTDAnalytics.initialize(applicationKey: "App ID", configuration: config)
DTDAnalyticsConfiguration *config;
config.currentLevel = @1;
config.userId = @"CustomUserID";
config.trackingAvailability = DTDTrackingStatusEnable;
config.logLevel = DTDLogLevelNo;
[DTDAnalytics applicationKey:@"App ID" configuration:config];

Integration features

For Objective-C

  1. Create Bridging-Header. To do this, you need to add any swift file to the project (don’t delete it later) and choose ‘Create Bridging Header’ in the offered dialog box.

  2. Make sure that the ‘Build Settings’ for ‘Defines Module’ value evaluates to ‘YES’.

  3. While importing, use: #import <DTDAnalytics/DTDAnalytics-Swift.h>

For SwiftUI

For SDK to function properly, it needs to be integrated at the earliest moment of the app launch. It is recommended that you use the following method of main entry point initialization:

@main
struct TestSwiftUIApp: App {
    init() {
        let config = DTDAnalyticsConfiguration()
        config.logLevel = .debug
        DTDAnalytics.initialize(applicationKey: "App ID", configuration: config)
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

Apps targeted at children

When developing and publishing apps targeted at children under 13 years old, you need to ensure special conditions for data processing. Any mobile app aimed at children or intended for users in a region with strict regulations on child online protection, must comply with current laws.

Please study the following requirements:

If your app has to comply with the legal requirements (COPPA), use the following recommendations:

  1. Implement the coppaControlEnable method. The method disables collection of ad IDs and vendor IDs (IDFA, IDFV).

    1. Remove AppTrackingTransparency.framework and all the links pointing to it.

    2. Remove AdSupport.framework all the links pointing to it.

Call the coppaControlEnable method before SDK initialization. If the method was not called, the SDK will work as before.

DTDAnalytics.coppaControlEnable()
DTDAnalytics.initialize(applicationKey: "App ID", configuration: config)
[DTDAnalytics coppaControlEnable];
[DTDAnalytics applicationKey:@"App ID" configuration:config];

USA:

EU:

To comply with

Children’s Online Privacy Protection Act (COPPA)
General Data Protection Regulation (GDPR) Article 8
Apple’s guidelines
Download the latest version of devtodev SDK from the repository