Skip to content

Commit

Permalink
Merge pull request #18 from AppsFlyerSDK/releases/6.3.1.0
Browse files Browse the repository at this point in the history
SDK 6.3.1 update
  • Loading branch information
sokoloff06 authored May 30, 2021
2 parents 053b427 + 48a1335 commit a60973b
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 188 deletions.
Binary file removed AppsFlyerXamarinBindingAndroid.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<PackageId>AppsFlyerXamarinBindingAndroid</PackageId>
<PackageVersion>6.2.0.0</PackageVersion>
<PackageVersion>6.3.1.0</PackageVersion>
<Authors>AppsFlyer</Authors>
<Description>Xamaring binding for AppsFlyer Android SDK</Description>
<PackageLicenseUrl>https://www.appsflyer.com/terms-of-use/</PackageLicenseUrl>
<Owners>AppsFlyer</Owners>
<PackageProjectUrl>https://github.com/AppsFlyerSDK/XamarinAndroidBinding</PackageProjectUrl>
<PackageReleaseNotes>Android SDK 6.2.0</PackageReleaseNotes>
<PackageReleaseNotes>Android SDK 6.3.1</PackageReleaseNotes>
<Title>AppsFlyerXamarinBindingAndroid</Title>
<PackOnBuild>true</PackOnBuild>
</PropertyGroup>
Expand Down Expand Up @@ -61,16 +61,16 @@
<TransformFile Include="Transforms\EnumFields.xml" />
<TransformFile Include="Transforms\EnumMethods.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedJar Include="Jars\AF-Android-SDK.jar" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Build.Packaging">
<Version>0.2.2</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedJar Include="Jars\AF-Android-SDK.jar" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file modified AppsFlyerXamarinBindingAndroid/Jars/AF-Android-SDK.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions AppsFlyerXamarinBindingAndroid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.2.0.0")]
[assembly: AssemblyFileVersion("6.2.0.0")]
[assembly: AssemblyVersion("6.3.1.0")]
[assembly: AssemblyFileVersion("6.3.1.0")]
53 changes: 11 additions & 42 deletions AppsFlyerXamarinBindingAndroid/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,15 @@
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->
<add-node path="/api/package[@name='com.appsflyer']">
<class abstract="false" deprecated="not deprecated" extends="com.appsflyer.OneLinkHttpTask" extends-generic-aware="com.appsflyer.OneLinkHttpTask" jni-extends="Lcom/appsflyer/OneLinkHttpTask;" final="false" name="CreateOneLinkHttpTask" static="false" visibility="public" jni-signature="Lcom/appsflyer/CreateOneLinkHttpTask;">
<constructor deprecated="not deprecated" final="false" name="CreateOneLinkHttpTask" jni-signature="(Ljava/lang/String;Ljava/util/Map;Lcom/appsflyer/AppsFlyerLibCore;Landroid/content/Context;Z)V" bridge="false" static="false" type="com.appsflyer.CreateOneLinkHttpTask" synthetic="false" visibility="public">
<parameter name="oneLinkId" type="java.lang.String" jni-type="Ljava/lang/String;">
</parameter>
<parameter name="data" type="java.util.Map&lt;java.lang.String, java.lang.String&gt;" jni-type="Ljava/util/Map&lt;Ljava/lang/String;Ljava/lang/String;&gt;;">
</parameter>
<parameter name="afLib" type="com.appsflyer.AppsFlyerLibCore" jni-type="Lcom/appsflyer/AppsFlyerLibCore;">
</parameter>
<parameter name="context" type="android.content.Context" jni-type="Landroid/content/Context;">
</parameter>
<parameter name="isTrackingStopped" type="boolean" jni-type="Z">
</parameter>
</constructor>
<method abstract="false" deprecated="not deprecated" final="false" name="getOneLinkUrl" jni-signature="()Ljava/lang/String;" bridge="false" native="false" return="java.lang.String" jni-return="Ljava/lang/String;" static="false"
synchronized="false" synthetic="false" visibility="protected">
</method>
<method abstract="false" deprecated="not deprecated" final="false" name="handleResponse" jni-signature="(Ljava/lang/String;)V" bridge="false" native="false" return="void" jni-return="V" static="false"
synchronized="false" synthetic="false" visibility="protected">
<parameter name="content" type="java.lang.String" jni-type="Ljava/lang/String;">
</parameter>
</method>
<method abstract="false" deprecated="not deprecated" final="false" name="initRequest" jni-signature="(Ljavax/net/ssl/HttpsURLConnection;)V" bridge="false" native="false" return="void" jni-return="V" static="false"
synchronized="false" synthetic="false" visibility="protected">
<parameter name="conn" type="javax.net.ssl.HttpsURLConnection" jni-type="Ljavax/net/ssl/HttpsURLConnection;">
</parameter>
<exception name="IOException" type="java.io.IOException">
</exception>
<exception name="JSONException" type="org.json.JSONException">
</exception>
</method>
<method abstract="false" deprecated="not deprecated" final="false" name="onErrorResponse" jni-signature="()V" bridge="false" native="false" return="void" jni-return="V" static="false"
synchronized="false" synthetic="false" visibility="protected">
</method>
<method abstract="false" deprecated="not deprecated" final="false" name="setListener" jni-signature="(Lcom/appsflyer/CreateOneLinkHttpTask$ResponseListener;)V" bridge="false" native="false" return="void" jni-return="V" static="false"
synchronized="false" synthetic="false" visibility="public">
<parameter name="responseListener" type="com.appsflyer.CreateOneLinkHttpTask.ResponseListener" jni-type="Lcom/appsflyer/CreateOneLinkHttpTask$ResponseListener;">
</parameter>
</method>
</class>
</add-node>
<remove-node path="/api/package[@name='com.appsflyer.internal.referrer']/class[@name='HuaweiReferrer']"/>
<attr path="/api/package[@name='com.appsflyer.internal']/class[@name='ak']"
name="obfuscated">false</attr>

<attr path="/api/package[@name='com.appsflyer.internal']/class[@name='ak']/method[@name='values']"
name="visibility">public</attr>

<attr path="/api/package[@name='com.appsflyer.internal']/class[@name='ak']/method[@name='valueOf']"
name="visibility">public</attr>

<attr path="/api/package[@name='com.appsflyer.internal']/class[@name='ak']/method[@name='AFInAppEventParameterName']"
name="visibility">public</attr>
</metadata>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


Xamarin Binding integration guide For Android
AppsFlyer Xamarin Binding version `v6.2.0.0`
Built with AppsFlyer Android SDK `v6.2.0`
AppsFlyer Xamarin Binding version `v6.3.1.0`
Built with AppsFlyer Android SDK `v6.3.1`

## <a id="v6-breaking-changes"> ❗ v6 Breaking Changes

Expand Down Expand Up @@ -79,7 +79,7 @@ https://www.nuget.org/packages/AppsFlyerXamarinBindingAndroid/

1. Go to Project > Add NuGet Packages...
2. Select the `AppsFlyerXamarinBindingAndroid`
3. Select under version - `6.2.0.0`
3. Select under version - `6.3.1`
4. Click `Add Package`


Expand Down
22 changes: 8 additions & 14 deletions XamarinSample/AppsFlyerConversionDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
using System;
using Com.Appsflyer;
using System.Collections.Generic;
using Android.Support.V7.App;

namespace XamarinSample
{
public class AppsFlyerConversionDelegate : Java.Lang.Object, IAppsFlyerConversionListener
public class ConversionListener : Java.Lang.Object, IAppsFlyerConversionListener
{
AppCompatActivity activity;
Android.Support.V7.Widget.AppCompatTextView oaoaTextView;
Android.Support.V7.Widget.AppCompatTextView gcdTextView;
MainActivity activity;

public AppsFlyerConversionDelegate(MainActivity activity)
public ConversionListener(MainActivity activity)
{
this.oaoaTextView = activity.oaoaTextView;
this.gcdTextView = activity.gcdTextView;
this.activity = activity;
Console.WriteLine("AppsFlyerConversionDelegate called");
}

public void OnAppOpenAttribution(IDictionary<string, string> p0)
Expand All @@ -29,7 +23,7 @@ public void OnAppOpenAttribution(IDictionary<string, string> p0)
Console.WriteLine(message);
activity.RunOnUiThread(() =>
{
oaoaTextView.Text = message;
activity.udlTextView.Text = message;
});
}

Expand All @@ -39,7 +33,7 @@ public void OnAttributionFailure(string p0)
Console.WriteLine(message);
activity.RunOnUiThread(() =>
{
oaoaTextView.Text = message;
activity.udlTextView.Text = message;
});
}

Expand All @@ -49,7 +43,7 @@ public void OnConversionDataFail(string p0)
Console.WriteLine(message);
activity.RunOnUiThread(() =>
{
gcdTextView.Text = message;
activity.gcdTextView.Text = message;
});
}

Expand All @@ -64,10 +58,10 @@ public void OnConversionDataSuccess(IDictionary<string, Java.Lang.Object> p0)
}
}
message = message + "Timestamp:" + DateTime.Now;
Console.WriteLine(message);
activity.RunOnUiThread(() =>
{
gcdTextView.Text = message;
Console.WriteLine(message);
activity.gcdTextView.Text = message;
});
}
}
Expand Down
27 changes: 27 additions & 0 deletions XamarinSample/DeepLinkListener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using Com.Appsflyer.Deeplink;

namespace XamarinSample
{
public class DeepLinkListener : Java.Lang.Object, IDeepLinkListener
{
private MainActivity activity;

public DeepLinkListener(MainActivity activity)
{
this.activity = activity;
}

public void OnDeepLinking(DeepLinkResult deepLinkResult)
{
string message = "OnDeepLinking:\n";
message += deepLinkResult.ToString();
message = message + "\nTimestamp: " + DateTime.Now;
Console.WriteLine(message);
activity.RunOnUiThread(() =>
{
activity.udlTextView.Text = message;
});
}
}
}
35 changes: 18 additions & 17 deletions XamarinSample/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Android.Support.V7.Widget;
using Android.Views;
using Com.Appsflyer;
using Com.Appsflyer.Deeplink;

namespace XamarinSample
{
Expand All @@ -24,51 +23,53 @@ namespace XamarinSample
public class MainActivity : AppCompatActivity
{
public AppCompatTextView gcdTextView;
public AppCompatTextView oaoaTextView;
public AppCompatTextView udlTextView;
public FloatingActionButton purchaseButton;
FloatingActionButton fab;

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);

SetContentView(Resource.Layout.activity_main);

Toolbar toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
SetSupportActionBar(toolbar);

fab = FindViewById<FloatingActionButton>(Resource.Id.fab);
fab.Click += FabOnClick;

purchaseButton = FindViewById<FloatingActionButton>(Resource.Id.purchase_button);
purchaseButton.Click += PurchaseButtonClick;

gcdTextView = FindViewById<AppCompatTextView>(Resource.Id.gcd_text_view);
oaoaTextView = FindViewById<AppCompatTextView>(Resource.Id.oaoa_text_view);

udlTextView = FindViewById<AppCompatTextView>(Resource.Id.udl_text_view);
ConversionListener cl = new ConversionListener(this);
DeepLinkListener dl = new DeepLinkListener(this);
AppsFlyerLib.Instance.AddPushNotificationDeepLinkPath(new string[] { "key1", "key2" });
AppsFlyerLib.Instance.SetLogLevel(AFLogger.LogLevel.Verbose); // Enable verbose logs for debugging
AppsFlyerLib.Instance.Init("4UGrDF4vFvPLbHq5bXtCza", new AppsFlyerConversionDelegate(this), Application);
AppsFlyerLib.Instance.Init("4UGrDF4vFvPLbHq5bXtCza", cl, Application);
AppsFlyerLib.Instance.SetAppInviteOneLink("E2bM"); // Replace with OneLink ID from your AppsFlyer account
AppsFlyerLib.Instance.SetSharingFilter(new string[]{"test", "partner_int"});
Dictionary<string, Java.Lang.Object> partnerData =
new Dictionary<string, Java.Lang.Object>();
partnerData.Add("id", "test_id");
partnerData.Add("value", "test_value");
AppsFlyerLib.Instance.SetPartnerData("test_partner", partnerData);
AppsFlyerLib.Instance.SubscribeForDeepLink(new MyDeepLinkListener());
AppsFlyerLib.Instance.RegisterConversionListener(this, cl);
AppsFlyerLib.Instance.SubscribeForDeepLink(dl);
AppsFlyerLib.Instance.Start(this, "4UGrDF4vFvPLbHq5bXtCza"); // Replace with your app DevKey
}

private class MyDeepLinkListener : Java.Lang.Object, IDeepLinkListener
protected override void OnStop()
{
public void OnDeepLinking(DeepLinkResult deepLinkResult)
{
Console.WriteLine(deepLinkResult.ToString());
}
base.OnStop();
gcdTextView.Text = "Conversion Data";
udlTextView.Text = "onDeepLinking";
}

protected override void OnResume()
{
base.OnResume();
Console.WriteLine(gcdTextView.Text);
Console.WriteLine(udlTextView.Text);
}

private void PurchaseButtonClick(object sender, EventArgs eventArgs)
{
Expand Down Expand Up @@ -101,7 +102,7 @@ public override void OnRequestPermissionsResult(int requestCode, string[] permis


class OneLinkResponseListener : Java.Lang.Object, CreateOneLinkHttpTask.IResponseListener
{
{
View view;

public OneLinkResponseListener(View view)
Expand Down
2 changes: 1 addition & 1 deletion XamarinSample/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.appsflyer.xamarinsample">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" />
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="29" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Loading

0 comments on commit a60973b

Please sign in to comment.