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

AppierAistra 2.0.1

AppierAistra 2.0.1

Maintained by Appier iOS Bot.



  • By
  • Appier


<html
lang="en"

data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
data-a11y-animated-images="system" data-a11y-link-underlines="true"

















<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-97df7784617ce1ea.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-9be9fe6313f476af.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-f65d5aef412a9712.css" />
<link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-7a418ea859d1654d.css" />
















































































ads-aistra-ios/README.md at main · appier/ads-aistra-ios · GitHub




<meta name="hovercard-subject-tag" content="repository:1314516926" data-turbo-transient>


<meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I">

<meta name="user-login" content="">



<meta name="viewport" content="width=device-width">



  <meta name="description" content="Contribute to appier/ads-aistra-ios development by creating an account on GitHub.">

  <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">

<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
<meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/appier/ads-aistra-ios/blob/main/README.md" />

  <meta name="twitter:image" content="https://opengraph.githubassets.com/ca60db2a7538beaf7682791efb82b34b989ece59f84063c106a3c8029dba8918/appier/ads-aistra-ios" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="ads-aistra-ios/README.md at main · appier/ads-aistra-ios" /><meta name="twitter:description" content="Contribute to appier/ads-aistra-ios development by creating an account on GitHub." />

  <meta name="hostname" content="github.com">



    <meta name="expected-hostname" content="github.com">




  <meta name="turbo-cache-control" content="no-cache" data-turbo-transient>

<meta data-hydrostats="publish">

<meta name="turbo-body-classes" content="logged-out env-production page-responsive">






<div class="position-relative header-wrapper js-header-wrapper ">
  <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 tmp-py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a>

  <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
<span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span>





<react-partial
partial-name="keyboard-shortcuts-dialog"
data-ssr="false"
data-attempted-ssr="false"
data-react-profiling="false"

      <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/app-install-banner-partial-e9858a9b511a83dc.js" fetchpriority="low" />


<react-partial
partial-name="app-install-banner-partial"
data-ssr="false"
data-attempted-ssr="false"
data-react-profiling="false"

            <link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/2l-e468179ba7123a2e.js" fetchpriority="low" />










<react-partial
partial-name="marketing-header"
data-ssr="true"
data-attempted-ssr="true"
data-react-profiling="false"

  <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full">

    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
<path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>




<button id="icon-button-1e987dab-f063-4526-9008-68482a250e62" aria-labelledby="tooltip-3773f398-bfce-4a77-9d12-36c0a58d58a7" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close">  <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual">
<path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>


Dismiss alert


<div id="js-flash-container" class="flash-container" data-turbo-replace>


Latest commit

 

History

History
125 lines (92 loc) · 4.06 KB

File metadata and controls

125 lines (92 loc) · 4.06 KB

Aistra iOS SDK

Binary distribution of Aistra, Appier's device-signal SDK. The public module is Aistra (import Aistra), shipped as a signed Aistra.xcframework.

This repo is generated from the private source repo appier-ads-data-signal-ios; only the built framework, podspec, and SPM manifest live here. Do not edit sources here — releases are opened as PRs by the source repo's CI.

Requirements

  • iOS 12.0+
  • Swift Package Manager (swift-tools 5.7.1 / Xcode 14.1+), CocoaPods, or a manually embedded xcframework
  • Aistra.xcframework is a dynamic framework that links these system frameworks: Foundation, UIKit, AVFoundation, CoreTelephony, Network, AdSupport, AppTrackingTransparency, StoreKit and WebKit. SPM and CocoaPods add them to your link line automatically.
  • The framework ships its own privacy manifest (PrivacyInfo.xcprivacy).

Installation

Aistra supports three integration paths.

Swift Package Manager

In Xcode: File ▸ Add Package Dependencies… and enter

https://github.com/appier/ads-aistra-ios.git

or add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/appier/ads-aistra-ios.git", from: "2.0.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "Aistra", package: "ads-aistra-ios")
        ]
    )
]

CocoaPods

Add to your Podfile:

pod 'AppierAistra'

then pod install. (The module is Aistra regardless of the pod name.)

Direct download (manual)

Download AistraFramework.zip from the latest release, unzip it, and drag Aistra.xcframework into your target's Frameworks, Libraries, and Embedded Content with Embed & Sign.

Usage

import Aistra

// Start as early as possible (e.g. at app launch) so asynchronous signals such
// as the WebKit user agent can resolve before the first ad request.
AistraSDK.start()

// Optional: supply coordinates from a source you already authorize. Until this
// is set (or while it returns nil) the geo fields are omitted — the SDK never
// touches CoreLocation itself.
AistraSDK.locationProvider = myLocationProvider   // conforms to LocationProviding

// Encrypted snapshot of the device signals. Optional asynchronous fields,
// including the user agent, are omitted until they have resolved.
let aistraData: Data = AistraSDK.getData()

// Record ad lifecycle events so they are reflected in later snapshots.
AistraSDK.recordAdEvent(.impression, bidObjId: bidObjId,
                        meta: AdEventMeta(adomain: "example.com", bundle: "com.example.app"))
AistraSDK.recordStoreViewDisplayed()   // after showing a StoreKit product page

A location source only has to expose a coordinate pair:

final class MyLocationProvider: LocationProviding {
    var coordinate: (latitude: Double, longitude: Double)? {
        // Return nil while no authorized fix is available.
        return (latitude: 25.0330, longitude: 121.5654)
    }
}

Public API

All members are static on AistraSDK.

Member Purpose
start() Boot the shared instance early so lifecycle tracking and asynchronous signal collection start at launch
version: String The compiled-in Aistra version, readable without starting collection
getData() -> Data Current signal snapshot, encrypted for the Aistra request field
locationProvider: LocationProviding? Inject a coordinate source at any time
recordAdEvent(_:bidObjId:meta:) Record an ad .win, .impression or .click, with optional AdEventMeta (adomain, bundle)
recordStoreViewDisplayed() Mark that a StoreKit product page was shown

getData() is safe to call from any thread — UIKit-backed reads are marshalled onto the main thread internally. It is also exposed to Objective-C as [AistraSDK getData]; the rest of the API is Swift-only.

License

Aistra is available under the MIT license. See the LICENSE file.

Author

Appier Inc., [email protected] — https://www.appier.com

<template id="site-details-dialog">



</div>
<div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div>
<div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div>