Skip to content

Commit 1ae9ec7

Browse files
authored
Merge pull request #20 from AppsFlyerSDK/dev/sdk-v6-beta
dev/sdk-v6-beta
2 parents 45ecff6 + 268caf3 commit 1ae9ec7

15 files changed

+143
-139
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ AppsFlyerSampleApp/obj
44
AppsFlyerXamarinBinding/obj
55
.vs/
66
**/[Pp]ackages/*
7+
8+
AppsFlyerXamarinBinding/bin/Debug/

AppsFlyerSampleApp/AppDelegate.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using Foundation;
22
using UIKit;
3-
using AppsFlyerXamarinBinding;
43
using System;
4+
using AppsFlyerXamarinBinding;
55

66
namespace AppsFlyerSampleApp
77
{
8-
// The UIApplicationDelegate for the application. This class is responsible for launching the
9-
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
8+
// The UIApplicationDelegate for the application. This class is responsible for launching the
9+
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
1010

11-
[Register ("AppDelegate")]
11+
[Register ("AppDelegate")]
1212
public class AppDelegate : UIApplicationDelegate
1313
{
1414
// class-level declarations
15-
AppsFlyerTracker tracker = AppsFlyerTracker.SharedTracker ();
16-
15+
AppsFlyerLib appsflyer = AppsFlyerLib.Shared;
1716
public override UIWindow Window {
1817
get;
1918
set;
@@ -23,19 +22,24 @@ public override bool FinishedLaunching (UIApplication application, NSDictionary
2322
{
2423
// Override point for customization after application launch.
2524
// If not required for your application you can safely delete this method
26-
tracker.IsDebug = true;
27-
tracker.AppsFlyerDevKey = "4UGrDF4vFvPLbHq5bXtCza"; // Replace with your DevKey
28-
tracker.AppleAppID = "753258300"; // Replace with your app ID
29-
tracker.setAppInviteOneLink("E2bM"); // Replace with your OneLink ID
25+
appsflyer.IsDebug = true;
26+
appsflyer.AppsFlyerDevKey = "4UGrDF4vFvPLbHq5bXtCza"; // Replace with your DevKey
27+
appsflyer.AppleAppID = "753258300"; // Replace with your app ID
28+
appsflyer.AppInviteOneLinkID = "E2bM"; // Replace with your OneLink ID
29+
appsflyer.AnonymizeUser = true;
30+
if (UIDevice.CurrentDevice.CheckSystemVersion (14, 0)) {
31+
appsflyer.WaitForAdvertisingIdentifierWithTimeoutInterval (10); // When Xamarin.iOS will support AppTrackingTransparency, you should implement a popup asking for IDFA permission
32+
// Ask for the IDFA permission here (with AppTrackingTransparency framework)
33+
}
3034
string [] networks = {"test_int", "partner_int"};
31-
tracker.SharingFilter = networks;
35+
appsflyer.SharingFilter = networks;
3236

3337

3438

3539
// Conversion data callbacks
3640
ViewController controller = (ViewController)Window.RootViewController;
37-
AppsFlyerTrackerDelegate af_delegate = new AppsFlyerConversionDataDelegate (controller);
38-
AppsFlyerTracker.SharedTracker().Delegate = af_delegate;
41+
AppsFlyerLibDelegate af_delegate = new AppsFlyerConversionDataDelegate (controller);
42+
AppsFlyerLib.Shared.Delegate = af_delegate;
3943

4044
// Uninstall Measurement
4145
var settings = UIUserNotificationSettings.GetSettingsForTypes (
@@ -74,7 +78,7 @@ public override void OnActivated (UIApplication application)
7478
{
7579
// Restart any tasks that were paused (or not yet started) while the application was inactive.
7680
// If the application was previously in the background, optionally refresh the user interface.
77-
tracker.TrackAppLaunch ();
81+
appsflyer.Start();
7882

7983
}
8084

@@ -92,21 +96,21 @@ public override void FailedToRegisterForRemoteNotifications (UIApplication appli
9296
[Export ("application:didRegisterForRemoteNotificationsWithDeviceToken:")]
9397
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
9498
{
95-
tracker.RegisterUninstall (deviceToken);
99+
appsflyer.RegisterUninstall (deviceToken);
96100
}
97101

98102
[Export ("application:openURL:options:")]
99103
public override bool OpenUrl (UIApplication app, NSUrl url, NSDictionary options)
100104
{
101-
tracker.handleOpenUrl (url, options);
105+
appsflyer.handleOpenUrl (url, options);
102106
return true;
103107
}
104108
//Universal Links
105109
public override bool ContinueUserActivity (UIApplication application,
106110
NSUserActivity userActivity,
107111
UIApplicationRestorationHandler completionHandler)
108112
{
109-
AppsFlyerTracker.SharedTracker ().ContinueUserActivity (userActivity, completionHandler);
113+
AppsFlyerLib.Shared.ContinueUserActivity (userActivity, completionHandler);
110114
return true;
111115
}
112116
}

AppsFlyerSampleApp/AppsFlyerConversionDataDelegate.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace AppsFlyerSampleApp
77
{
8-
public class AppsFlyerConversionDataDelegate : AppsFlyerTrackerDelegate
8+
public class AppsFlyerConversionDataDelegate : AppsFlyerLibDelegate
99
{
1010

1111
private ViewController viewController;
@@ -38,7 +38,7 @@ public override void OnAppOpenAttributionFailure (NSError error) {
3838

3939
}
4040

41-
public override void onConversionDataSuccess (NSDictionary conversionInfo) {
41+
public override void OnConversionDataSuccess (NSDictionary conversionInfo) {
4242
String message = "OnConversionDataSuccess:\n";
4343
foreach (var kvp in conversionInfo) {
4444
if (kvp.Value != null) {
@@ -54,7 +54,7 @@ public override void onConversionDataSuccess (NSDictionary conversionInfo) {
5454
}
5555
}
5656

57-
public override void onConversionDataFail (NSError error){
57+
public override void OnConversionDataFail (NSError error){
5858

5959
}
6060
}

AppsFlyerSampleApp/AppsFlyerSampleApp.csproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<WarningLevel>4</WarningLevel>
2222
<ConsolePause>false</ConsolePause>
2323
<MtouchArch>i386, x86_64</MtouchArch>
24-
<MtouchLink>None</MtouchLink>
24+
<MtouchLink>SdkOnly</MtouchLink>
2525
<MtouchDebug>true</MtouchDebug>
2626
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
2727
<MtouchFastDev>true</MtouchFastDev>
@@ -48,7 +48,7 @@
4848
<WarningLevel>4</WarningLevel>
4949
<ConsolePause>false</ConsolePause>
5050
<MtouchArch>i386, x86_64</MtouchArch>
51-
<MtouchLink>None</MtouchLink>
51+
<MtouchLink>SdkOnly</MtouchLink>
5252
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
5353
<CodesignProvision>VS: com.appsflyer.xamarinsample Development</CodesignProvision>
5454
</PropertyGroup>
@@ -76,6 +76,9 @@
7676
<Reference Include="System.Xml" />
7777
<Reference Include="System.Core" />
7878
<Reference Include="Xamarin.iOS" />
79+
<Reference Include="AppsFlyerXamarinBinding">
80+
<HintPath>..\packages\AppsFlyerXamarinBinding.6.0.2\lib\xamarinios10\AppsFlyerXamarinBinding.dll</HintPath>
81+
</Reference>
7982
</ItemGroup>
8083
<ItemGroup>
8184
<InterfaceDefinition Include="Resources\LaunchScreen.xib" />
@@ -84,6 +87,7 @@
8487
<ItemGroup>
8588
<None Include="Info.plist" />
8689
<None Include="Entitlements.plist" />
90+
<None Include="packages.config" />
8791
</ItemGroup>
8892
<ItemGroup>
8993
<Compile Include="Main.cs" />
@@ -94,11 +98,5 @@
9498
</Compile>
9599
<Compile Include="AppsFlyerConversionDataDelegate.cs" />
96100
</ItemGroup>
97-
<ItemGroup>
98-
<ProjectReference Include="..\AppsFlyerXamarinBinding\AppsFlyerXamarinBindingiOS.csproj">
99-
<Project>{F85DBA77-44A5-4037-A811-9707791A426F}</Project>
100-
<Name>AppsFlyerXamarinBindingiOS</Name>
101-
</ProjectReference>
102-
</ItemGroup>
103101
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
104102
</Project>

AppsFlyerSampleApp/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@
5858
<string>com.appsflyer.xamarinsample</string>
5959
<key>CFBundleDisplayName</key>
6060
<string>Xamarin Sample App</string>
61+
<key>Privacy - Tracking Usage Description</key>
62+
<string>Please allow us to read your IDFA</string>
6163
</dict>
6264
</plist>

AppsFlyerSampleApp/ViewController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ partial void EventButton_TouchUpInside (UIButton sender)
3535
AFEventParameter.AFEventParamContentType, "type 1",
3636
AFEventParameter.AFEventParamCurrency, "USD",
3737
AFEventParameter.AFEventParamDescription, "Description example");
38-
AppsFlyerTracker.SharedTracker ().TrackEvent (AFEventName.AFEventAddToCart, addToCartEvent);
38+
AppsFlyerLib.Shared.LogEvent (AFEventName.AFEventAddToCart, addToCartEvent);
3939
}
4040

4141
partial void ShareButton_TouchUpInside (UIButton sender)

0 commit comments

Comments
 (0)