CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

AdswizzSDKPrivacyDataCore 1.0.0

AdswizzSDKPrivacyDataCore 1.0.0

Maintained by Adswizz SDK Team.



  • By
  • AdsWizz, Inc

AdswizzSDKPrivacyDataKit - iOS Swift

AdswizzSDKPrivacyDataKit is an optional helper framework for AdswizzSDK on iOS, that has all the Privacy-Sensitive API required by certain features bundled by the AdswizzSDK.xcframework. AdswizzSDKPrivacyData's purpose is to facilitate the interoperability with AdswizzSDK and to allow your app to manage sensitive APIs (such as permission APIs) without adding unwanted permission usage decription strings in the app's Info.plist manifest. It is a transparent way to communicate to AdswizzSDK all your app-specific Privacy needs and constraints.

Note that this version of AdswizzSDKPrivacyData is only compatible with the Swift Package Manager integration. If you are planning to integrate AdswizzSDK with the other available integration methods such as Cocoapods or Carthage, please use the default AdswizzSDKPrivacyData implementation available here and follow the instructions for AdswizzSDK pre 7.9.2 versions.

Requirements

  • Xcode 15.2+
  • iOS 12.0+
  • Swift 5.9+

Structure

.
├── AdswizzSDKPrivacyDataKit.xcworkspace        # Workspace containing all AdswizzSDKPrivacyDataKit projects
├── AdswizzSDKPrivacyDataCore               	  # Mandatory core component that defines the public interfaces and symbols used by the other optional components (including AdswizzSDK)
├── AdswizzSDKPrivacyDataCalendar           	  # Handles the calendar permissions
├── AdswizzSDKPrivacyDataCamera             	  # Handles the camera permission (currently not used)
├── AdswizzSDKPrivacyDataContacts           	  # Handles the contacts permission (currently not used)
├── AdswizzSDKPrivacyDataIDFA               	  # Handles the tracking permission as defined by Apple's ATT framework
├── AdswizzSDKPrivacyDataLocation           	  # Handles the location permissions
├── AdswizzSDKPrivacyDataMicrophone         	  # Handles the microphone permission
├── AdswizzSDKPrivacyDataSpeech             	  # Handles the speech recognizer permission
├── AdswizzSDKPrivacyDataMotion             	  # Handles the motion permission
├── AdswizzSDKPrivacyDataPhotos             	  # Handles the photos permission
├── Framework                       			      # Stores .xcframeworks variants
│   └── AdswizzSDKPrivacyDataCore.xcframework   # AdswizzSDKPrivacyDataCore binary framework
├── Package.swift 								              # The Swift Package Manager manifest

├── AdswizzSDKPrivacyDataKit.podspec # The Cocoapods manifest ├── AdswizzSDKPrivacyDataKit.json # The Carthage manifest ├── LICENSE ├── README.md

Installation

There are several ways to integrate the AdswizzSDKPrivacyDataKit for iOS into your own project:

You should use one and only one of these methods to install the AdswizzSDKPrivacyDataKit. Adding the SDK in multiple ways loads duplicate copies of the SDK into the project and causes compiler/linker errors.

Swift Package Manager

Adding the AdswizzSDKPrivacyDataKit Swift package into your project can be done directly in Xcode in a few simple steps:

  1. Go to Files > Swift Packages > Add Package Dependency… and include the URL of the GitHub repository:

https://[email protected]/adswizz/ad-sdk-ios-privacydata-kit Replace MY_TOKEN with the Personal Access Token received from your Technical Account Manager.

  1. Select the Branch option and use the latest version on the main branch.
  2. Wait for Xcode to finish downloading and resolving the Swift package into your project.
  3. Now you can choose the package products and targets. Select the AdswizzSDKPrivacyDataCore product to be added into your project. The other products are optional and you can opt-in and select the ones matching the permissions your app is using. For example, if your app asks for the tracking permission, you should select the AdswizzSDKPrivacyDataIDFA product and link it to your project's target. This enables AdswizzSDK to access the ATT framework and use the IDFA identifier for listening context and better targeting.

Another example, if you plan to leverage AdsWizz's interactive audio ad formats, AdswizzSDK will need access to the microphone and speech permissions so you should also include the AdswizzSDKPrivacyDataMicrophone and AdswizzSDKPrivacyDataSpeech products into your project's target.

CocoaPods

TBD

Carthage

TBD

Manual

TBD

Usage

AdswizzSDKPrivacyDataCore is the main standalone module (the 'Core') that the other components depend on and this allows your app to opt-in and instruct AdswizzSDK which permissions is able to use. For the following modules, each refers to a specific system permission with its associated usage description key in your app's Info.plist:

  • AdswizzSDKPrivacyDataCalendar: NSCalendarsWriteOnlyAccessUsageDescription (iOS 17 only) / NSCalendarsUsageDescription or NSCalendarsFullAccessUsageDescription
  • AdswizzSDKPrivacyDataCamera: NSCameraUsageDescription
  • AdswizzSDKPrivacyDataContacts: NSContactsUsageDescription
  • AdswizzSDKPrivacyDataIDFA: NSUserTrackingUsageDescription
  • AdswizzSDKPrivacyDataLocation: NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription
  • AdswizzSDKPrivacyDataMicrophone: NSMicrophoneUsageDescription
  • AdswizzSDKPrivacyDataSpeech: NSSpeechRecognitionUsageDescription
  • AdswizzSDKPrivacyDataMotion: NSMotionUsageDescription
  • AdswizzSDKPrivacyDataPhotos: NSPhotoLibraryUsageDescription

Only add the modules that match the permissions your app is actually using.

Although you are not required to, you can certainly leverage the public API exposed by the AdswizzSDKPrivacyDataCore module either by requesting a permission:

import AdswizzSDKPrivacyData

AdswizzSDKPrivacyData.shared.request(permission: .contacts) { result in
  switch result {
  case let .success(value):
    //success
    print("Success! value = \(value.stringRepresentation)")
  case let .failure(error):
    //failure
    print("Something went wrong... error = \(error)")
  }
}

or by querying the value of a certain permission type:

import AdswizzSDKPrivacyData

let trackingValue = AdswizzSDKPrivacyData.shared.authorizationStatus(for: .idfa).stringRepresentation
print("Tracking permission value = \(trackingValue)")

License

AdswizzSDKPrivacyDataKit is available under the MIT License - see the LICENSE file for details.