GithubHelp home page GithubHelp logo

xpereta / appsflyer-sdk-v6-sample-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsflyersdk/appsflyer-sdk-v6-sample-app

0.0 1.0 0.0 7.67 MB

A sample to demonstrate the init and functionality of AppsFlyer's SDK v6

Ruby 2.42% Swift 97.58%

appsflyer-sdk-v6-sample-app's Introduction

image

Welcome to AppsFlyer SDK 6.x

‼️ The sample app is cmpatible with the IDFA limitations in iOS 14.5

iOS 14.5 blocks the collection of IDFA unless the user allows ita collection when the application starts.

AppsFlyer's SDK - starting of version 6.0.3 - supports this functionality using Apple's AppTrackingTransperancy framework.

This sample app will allow you to test this functionality and ensure that your app is running smoothly ahead of the release of iOS 14.

Compatability

  • iOS version >= 10.0

  • AppsFlyer SDK version 6.0.3 (current installed SDK is 6.2.2)

How do I test consent to collect of IDFA?

When the application initialises in iOS 14:

idfa_menu

This code shows a menu that requests the user to authorise IDFA collection.

// The following block is optional for applications wishing to give users the option to collect IDFA.
// for iOS 14 and above - The user may be prompted to collect IDFA.
//                        If user opts-in, the IDFA will be collected by the SDK.
// for iOS 13 and below - The IDFA will be collected by the SDK. The user will NOT be prompted to consent.
if #available(iOS 14, *) {
  // Set a timeout for the SDK to wait for the IDFA collection before handling app launch
  // If timeout expires before the user allows to collect IDFA , the IDFA will NOT be collected.
  AppsFlyerLib.shared().waitForATTUserAuthorization(timeoutInterval: 60)
  // Show the user the Apple IDFA consent dialog (AppTrackingTransparency)
  // MUST be called here before start() in order to allow IDFA collection by the SDK
  ATTrackingManager.requestTrackingAuthorization { (status) in
                                                 }
}

Get code here

In the app you have a button 'Test IDFA collection'

If user authorised IDFA collection, its IDFA will be displayed

idfa_ok

If user DID NOT authorise IDFA collection, a message will be displayed

idfa_not_allowed

Why is the demo app asking me to allow notifications?

The notifcations are used for the uninstall detection flow

How to use this demo?

  1. Clone the repository
  2. Make sure to open the work environment via Xcode workspace basic_app.xcworkspace
  3. Get your AppsFlyer Dev Key using these instructions.
  4. Create the file sdk-v6-demo/afdevkey_donotpush.plist with the following content:
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>appsFlyerDevKey</key>
        <string>YOUR_AF_DEV_KEY_HERE</string>
        <key>appleAppID</key>
        <string>YOUR_APPLE_APP_ID_HERE</string>
</dict>
</plist>
  1. Add the file into your Xcode project

The file sdk-v6-demo/sdk-v6-demo.xcodeproj/project.pbxproj will have some changes. Do not commit them!

appsflyer-sdk-v6-sample-app's People

Contributors

liaz-af avatar xpereta avatar

Watchers

James Cloos avatar

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.