Skip to content

Commit

Permalink
Merge pull request #26 from AppsFlyerSDK/dev/DELIVERY-31414/plugin-up…
Browse files Browse the repository at this point in the history
…date

Plugin update(SDK + .NET6 Support)
  • Loading branch information
andr-ggn authored Sep 5, 2023
2 parents 50219df + 0617af7 commit b2e219b
Show file tree
Hide file tree
Showing 80 changed files with 307 additions and 187 deletions.
35 changes: 35 additions & 0 deletions AppsFlyerBinding.Android/Additions/Extras.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Com.Appsflyer.Internal.Platform_extension;

namespace Com.Appsflyer
{
partial class AppsFlyerLib
{
static bool didSetPlugin = false;

public static AppsFlyerLib Instance
{
get
{
var Instance = AppsFlyerLib.__Instance();
if (didSetPlugin)
{
return Instance;
}
var assembly = typeof(AppsFlyerLib).GetTypeInfo().Assembly;
var assemblyName = new AssemblyName(assembly.FullName);
var version = assemblyName.Version;
var versionStr = version.ToString();
var extra = new Dictionary<string, string>();
extra["build"] = version.Build.ToString();
extra["revision"] = version.Revision.ToString();
Instance.SetPluginInfo(new PluginInfo(Plugin.Xamarin, versionStr, extra));
didSetPlugin = true;
return Instance;
}
}
}
}

52 changes: 52 additions & 0 deletions AppsFlyerBinding.Android/AppsFlyerBinding.Android.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<Project Sdk="Xamarin.Legacy.Sdk">
<PropertyGroup>
<TargetFrameworks>monoandroid11.0;net6.0-android</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<!-- Hide some warnings -->
<NoWarn>CS0108;CS0114;BG8700</NoWarn>
<RootNamespace>AppsFlyerBinding.Android</RootNamespace>
<AssemblyName>AppsFlyerBinding.Android</AssemblyName>
<!--x.x.x.build_ver, platform_extension includes this value -->
<AssemblyVersion>6.12.2.6</AssemblyVersion>
<FileVersion>6.12.2</FileVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<PackageId>AppsFlyerXamarinBindingAndroid</PackageId>
<Title>AppsFlyer SDK for Xamarin Android</Title>
<Summary>C# binding for AppsFlyer official SDK</Summary>
<Description>C# binding for AppsFlyer official SDK</Description>
<Authors>AppsFlyer</Authors>
<Owners>AppsFlyer</Owners>
<Copyright>AppsFlyer</Copyright>
<PackageProjectUrl>https://github.com/AppsFlyerSDK/XamarinAndroidBinding</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageVersion>6.12.2</PackageVersion>
</PropertyGroup>

<PropertyGroup>
<AndroidClassParser>class-parse</AndroidClassParser>
</PropertyGroup>

<ItemGroup>
<Compile Include="../AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<TransformFile Include="Transforms\*.xml" />
</ItemGroup>

<!-- <ItemGroup>
<None Remove="Xamarin.Kotlin.StdLib.Jdk7" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.5.10" />
</ItemGroup>-->

</Project>
Binary file not shown.
17 changes: 17 additions & 0 deletions AppsFlyerBinding.Android/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>

<!--<attr path="/api/package[@name='com.appsflyer']/interface[@name='CreateOneLinkHttpTask.ResponseListener']/method[@name='onResponse']" name="argsType">CreateOneLinkHttpTask.TwoDSignNextManueverEventArgs</attr>-->
<!--<attr path="/api/package[@name='com.appsflyer.share']/interface[@name='CreateOneLinkHttpTask.ResponseListener']/method[@name='onResponse' and count(parameter)=1 and parameter[1][@type='java.lang.String']]" name="managedName">onResponse</attr>-->
<!--<attr path="/api/package[@name='com.appsflyer.share']/interface[@name='CreateOneLinkHttpTask.ResponseListener']/method[@name='onResponseError' and count(parameter)=1 and parameter[1][@type='java.lang.String']]" name="managedName">onResponseError</attr>-->

<attr path="/api/package[@name='com.appsflyer']/class[@name='AppsFlyerLib']/method[@name='getInstance' and count(parameter)=0]" name="managedName">__Instance</attr>

<remove-node path="/api/package[@name='com.appsflyer.internal']/class[starts-with(@name, 'AF')]" />
<remove-node path="/api/package[@name='com.appsflyer.internal']/interface[starts-with(@name, 'AF')]" />
<remove-node path="/api/package[@name='com.appsflyer']/class[@name='PurchaseHandler']" />
<remove-node path="/api/package[@name='com.appsflyer']/class[@name='AFKeystoreWrapper']" />



</metadata>
18 changes: 12 additions & 6 deletions AppsFlyerXamarinBindingAndroid.sln
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsFlyerXamarinBindingAndroid", "AppsFlyerXamarinBindingAndroid\AppsFlyerXamarinBindingAndroid.csproj", "{4A655B5E-EA10-4413-B76D-AE49393F7C60}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.NuGet.Xamarin", "samples\Sample.NuGet.Xamarin\Sample.NuGet.Xamarin.csproj", "{F841D5AF-30A2-481D-AF63-1BC24773C9B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinSample", "XamarinSample\XamarinSample.csproj", "{F841D5AF-30A2-481D-AF63-1BC24773C9B0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsFlyerBinding.Android", "AppsFlyerBinding.Android\AppsFlyerBinding.Android.csproj", "{15E0F236-7E3D-443A-A03A-8C88CD690D11}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.NuGet.NET", "samples\Sample.NuGet.NET\Sample.NuGet.NET.csproj", "{89E076A9-0AAF-4A0E-A522-6FD5F762B12D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4A655B5E-EA10-4413-B76D-AE49393F7C60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A655B5E-EA10-4413-B76D-AE49393F7C60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A655B5E-EA10-4413-B76D-AE49393F7C60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A655B5E-EA10-4413-B76D-AE49393F7C60}.Release|Any CPU.Build.0 = Release|Any CPU
{F841D5AF-30A2-481D-AF63-1BC24773C9B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F841D5AF-30A2-481D-AF63-1BC24773C9B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F841D5AF-30A2-481D-AF63-1BC24773C9B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F841D5AF-30A2-481D-AF63-1BC24773C9B0}.Release|Any CPU.Build.0 = Release|Any CPU
{15E0F236-7E3D-443A-A03A-8C88CD690D11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15E0F236-7E3D-443A-A03A-8C88CD690D11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15E0F236-7E3D-443A-A03A-8C88CD690D11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15E0F236-7E3D-443A-A03A-8C88CD690D11}.Release|Any CPU.Build.0 = Release|Any CPU
{89E076A9-0AAF-4A0E-A522-6FD5F762B12D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89E076A9-0AAF-4A0E-A522-6FD5F762B12D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89E076A9-0AAF-4A0E-A522-6FD5F762B12D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89E076A9-0AAF-4A0E-A522-6FD5F762B12D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
Expand Down

This file was deleted.

Binary file not shown.
24 changes: 0 additions & 24 deletions AppsFlyerXamarinBindingAndroid/Jars/AboutJars.txt

This file was deleted.

30 changes: 0 additions & 30 deletions AppsFlyerXamarinBindingAndroid/Properties/AssemblyInfo.cs

This file was deleted.

18 changes: 0 additions & 18 deletions AppsFlyerXamarinBindingAndroid/Transforms/Metadata.xml

This file was deleted.

7 changes: 7 additions & 0 deletions AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyMetadata ("BUILD_COMMIT", "{BUILD_COMMIT}")]
[assembly: AssemblyMetadata ("BUILD_NUMBER", "{BUILD_NUMBER}")]
[assembly: AssemblyMetadata ("BUILD_TIMESTAMP", "{BUILD_TIMESTAMP}")]

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


Xamarin Binding integration guide For Android
AppsFlyer Xamarin Binding version `v6.5.4.0`
Built with AppsFlyer Android SDK `v6.5.4`
AppsFlyer Xamarin Binding version `v6.12.2`
Built with AppsFlyer Android SDK `v6.12.2`

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

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

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


Expand Down
10 changes: 10 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"sdk":
{
"version": "6.0.400"
},
"msbuild-sdks":
{
"Xamarin.Legacy.Sdk": "0.2.0-alpha4"
}
}
8 changes: 8 additions & 0 deletions pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
rm -rf AppsFlyerBinding.Android/bin
rm -rf AppsFlyerBinding.Android/obj

dotnet clean
dotnet restore
dotnet pack -c Release AppsFlyerBinding.Android/AppsFlyerBinding.Android.csproj

mv AppsFlyerBinding.Android/bin/Release/AppsFlyerXamarinBinding*.nupkg nugets/
11 changes: 11 additions & 0 deletions samples/Sample.NuGet.NET/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true">
</application>
<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- Optional : -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
</manifest>
20 changes: 20 additions & 0 deletions samples/Sample.NuGet.NET/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Com.Appsflyer;
using Com.Appsflyer.Internal;

namespace Sample.NuGet.NET;

[Activity(Label = "@string/app_name", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);

AppsFlyerLib.Instance.SetDebugLog(true);
//AppsFlyerLib.Instance.SetLogLevel(AFLogger.LogLevel.Verbose); // Enable verbose logs for debugging
AppsFlyerLib.Instance.Init("DEV_KEY", null, Application);
AppsFlyerLib.Instance.Start(this, "DEV_KEY");
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
}
}
Loading

0 comments on commit b2e219b

Please sign in to comment.