Git Product home page Git Product logo

appsflyer-sdkless-skadnetwork-client's Introduction

appsflyer-sdkless-skadnetwork-client

iOS SDKLess + Sample App which demonstrates the usage of Appsflyer API - SKAdNetwork S2S get conversion value per user

The repository has 2 parts:

SPEC

Call the SK API with GET request that has the following query params:

Key Description
uid appsflyer id
app_id application id
af_timestamp current time in miliseconds
af_sig Create an HMAC SHA256 signature by concatenating the values of the timestamp, dev key, app id, and AppsFlyer id: HmacSHA256(af_timestamp + DevKey + app_id + uid)

app_id in a format - "idxxxxxxx" The HMAC is generated using SHA256 and uses the DevKey as the signature’s secret key. The account Dev Key is taken from the App Settings page in the AppsFlyer dashboard.

Example:
https://skadsdkless.appsflyer.com/api/v1.0/conversion-value?uid=LYPnL-sdJuSwjg-AQ2GTZehc&app_id=123456789&af_sig=b457aca5d23a6cbe512775578201&af_timestamp=1603034622

SK API will return the following conversion value response as JSON:

{
  "value": 43
}
Response codes
Code Description
200 the conversion value
400 invalid request (params or headers missing or malformed)
401 invalid signature
404 uid not found/expired
503 server busy

How to run the Sample App

(Be sure you run Xcode 12+)

$ cd Example
$ pod install

Dependencies

  • AppsFlyerSDKLessSKAdNetworkClient
  • OCMock - for testing
  • OHHTTPStubs - for testing

API and Usage

  private let uid = "YOUR_APPSFLYER_ID"; //AppsFlyerLib.shared().getAppsFlyerUID()
  private let appId = "YOUR_APP_ID"; //ID - is a string with following format @"idXXXXXXXX"
  private let devKey = "YOUR_DEV_KEY";
    
  AFSDKLessClient.shared.requestConversionValue(withUID: self.uid, devKey: self.devKey, appID: self.appId) { (cv, error) in
     if let cv = cv?.intValue {
          // Tells to the Client to register For AdNetwork Attribution (iOS 11.3+)
          // Should be called only once
          AFSDKLessClient.shared.registerForAdNetworkAttribution()  
          
          // Tells to the Client to update conversion value 
          AFSDKLessClient.shared.updateConversionValue(cv)        
          task.setTaskCompleted(success: true)
      } else {
          task.setTaskCompleted(success: false)
      }                        
  }

appsflyer-sdkless-skadnetwork-client's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.