AppsFlyerXamarinBinding 6.10.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package AppsFlyerXamarinBinding --version 6.10.1
NuGet\Install-Package AppsFlyerXamarinBinding -Version 6.10.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AppsFlyerXamarinBinding" Version="6.10.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AppsFlyerXamarinBinding --version 6.10.1
#r "nuget: AppsFlyerXamarinBinding, 6.10.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AppsFlyerXamarinBinding as a Cake Addin
#addin nuget:?package=AppsFlyerXamarinBinding&version=6.10.1

// Install AppsFlyerXamarinBinding as a Cake Tool
#tool nuget:?package=AppsFlyerXamarinBinding&version=6.10.1

Xamarin iOS Binding

Xamarin Binding integration guide For iOS

AppsFlyer Xamarin Binding version v6.9.2 <br> Built with AppsFlyer iOS SDK v6.9.2

❗ v6 Breaking Changes

We have renamed some of the APIs. For more details, please check out our Help Center

Overview

AppsFlyer SDK provides app installation and event logging functionality. We have developed an SDK that is highly robust (7+ billion SDK installations to date), secure, lightweight and very simple to embed.

You can measure installs, updates and sessions and also log additional in-app events beyond app installs (including in-app purchases, game levels, etc.) to evaluate ROI and user engagement levels.


AppsFlyer’s Xamarin binding provides application installation and events logging functionality.

The API for the binding coincides with the native iOS API, which can be found here.

Table of content

Nuget

Install-Package AppsFlyerXamarinBinding <br> https://www.nuget.org/packages/AppsFlyerXamarinBinding

Quick Start

Adding the Plugin to your Project
1. Go to Project > Add NuGet Packages...
2. Select the AppsFlyerXamarinBinding
3. Select under version -  6.9.2
4. Click `Add Package`

To Embed SDK into your Application Manually:

1. Copy AppsFlyerXamarinBinding.dll into your project.
2. On Xamarin Studio go to References and click on Edit References.
3. Go to .Net Assembly tab and click on Browse… button.
4. Locate AppsFlyerXamarinBinding.dll and chose it.

API Methods

SDK Initialization

Go to your AppDelegate.cs and add:

  1. using AppsFlyerXamarinBinding; at the top of the file.

  2. Add the following code to the FinishedLaunching() method:

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{           
    AppsFlyerLib.Shared.AppleAppID = "<APP_ID>";
    AppsFlyerLib.Shared.AppsFlyerDevKey = "<YOUR_DEV_KEY>";
    /* AppsFlyerLib.Shared.Delegate = af_delegate; */
    /* AppsFlyerLib.Shared.IsDebug = true; */
  

    return true;
}
  1. Add the following code in the OnActivated method:
public override void OnActivated(UIApplication application)
{
    AppsFlyerLib.Shared.Start();
}

Logging In-App Events

Logging in-app events is performed by calling LogEvent with event name and value parameters. See In-App Events documentation for more details.

Event Example:

var addToCartEvent = new NSDictionary(AFEventParameter.AFEventParamContentId, "id 1",
                                      AFEventParameter.AFEventParamContentType, "type 1", 
                                      AFEventParameter.AFEventParamCurrency, "USD", 
                                      AFEventParameter.AFEventParamDescription, "description");

AppsFlyerLib.Shared.LogEvent(AFEventName.AFEventAddToCart, addToCartEvent);

Get Conversion Data

First add to the class-level declarations:

AppsFlyerLibDelegate af_delegate = new AppsFlyerConversionDataDelegate();

Then set up the delegate in FinishedLaunching:

AppsFlyerLib.Shared.Delegate = af_delegate;

AppsFlyerConversionDataDelegate.cs can be found here:

public class AppsFlyerConversionDataDelegate : AppsFlyerLibDelegate
{
    public override void OnAppOpenAttribution(NSDictionary attributionData)
    {
        Console.WriteLine("deeplink data in xamarin = " + attributionData.Description);
    }
    
    public override void OnAppOpenAttributionFailure(NSError error) { }
    
    public override void OnConversionDataSuccess(NSDictionary conversionInfo)
    {
        Console.WriteLine("conversion data in xamarin = " + installData.Description);
    }
    
    public override void OnConversionDataFail(NSError error) { }
}

Opt-Out

For complete opt out of the SDK use the following method call

AppsFlyerLib.Shared.IsStopped = true;

This will prevent any data from being sent out of the AppsFlyer SDK.

User invite

Allowing your existing users to invite their friends and contacts as new users to your app can be a key growth factor for your app. AppsFlyer allows you to attribute and record new installs originating from user invites within your app. Set the OneLink ID, before calling Start().

AppsFlyerLib.Shared.AppInviteOneLinkID = "<OneLinKID>";
AppsFlyerXamarinBinding.AppsFlyerShareInviteHelper.generateInviteUrlWithLinkGenerator ((linkGenerator) => {
        linkGenerator.setChannel ("channel_name");
        linkGenerator.setReferrerName ("ref_name");
        return linkGenerator;
    }, completionHandler: (NSURL) => {
        Console.WriteLine (NSURL);
    }
);

Sample App

Sample apps for xamarin.ios10 and net6.0-ios can be found here:

XamariniOSBinding/samples

In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com.

When submitting an issue please specify your AppsFlyer sign-up (account) email, your app ID, production steps, logs, code snippets and any additional relevant information.

Product Compatible and additional computed target framework versions.
.NET net6.0-ios16.1 is compatible.  net7.0-ios was computed.  net8.0-ios was computed. 
Xamarin.iOS xamarinios10 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AppsFlyerXamarinBinding:

Package Downloads
Oscore.AppsFlyer.Maui The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Professional integration of existing Xamarin binding libraries in a single cross-platform interface according to best practices.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.13.1 428 3/14/2024
6.12.1 10,022 9/5/2023
6.10.1 10,840 4/11/2023
6.9.3-beta1 1,153 2/9/2023
6.9.2 2,879 2/9/2023
6.9.2-beta1 1,055 2/9/2023
6.5.4 27,517 4/28/2022
6.4.0.3 28,326 10/24/2021
6.4.0.1 2,851 9/29/2021
6.3.2 55,641 6/29/2021
6.3.0 7,485 5/27/2021
6.2.6.1 16,101 4/29/2021
6.2.4.1 5,671 3/31/2021
6.2.4 4,869 3/21/2021
6.2.3 1,346 3/9/2021
6.2.1 4,591 2/16/2021
6.1.3.2 4,578 1/18/2021
6.1.3.1 871 1/14/2021
6.1.3 815 1/14/2021
6.1.1 7,339 11/22/2020
6.0.3 17,414 9/7/2020
6.0.2 927 9/3/2020
6.0.1.1-beta 707 8/25/2020
5.4.1 7,160 7/28/2020
5.2.0 10,206 5/7/2020
1.3.5 26,442 9/16/2019
1.3.4 30,145 5/24/2018
1.3.3 9,275 12/18/2017
1.3.2 8,322 7/26/2017
1.3.1 4,735 2/27/2017
1.3.0 2,533 12/7/2016