Skip to content

Commit 45ecff6

Browse files
authored
Merge pull request #19 from AppsFlyerSDK/releases/5.4.1
Releases/5.4.1
2 parents ba94c1e + 3fd0ded commit 45ecff6

38 files changed

+554
-14477
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ AppsFlyerSampleApp/bin/iPhone/Debug
22
AppsFlyerSampleApp/bin
33
AppsFlyerSampleApp/obj
44
AppsFlyerXamarinBinding/obj
5+
.vs/
56
**/[Pp]ackages/*

.vs/AppsFlyerXamarinBindingiOS/xs/UserPrefs.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.vs/AppsFlyerXamarinBindingiOS/xs/project-cache/AppsFlyerXamarinBindingiOS-Debug.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vs/AppsFlyerXamarinBindingiOS/xs/sqlite3/db.lock

Whitespace-only changes.
-1.66 MB
Binary file not shown.

AppsFlyerSampleApp/AppDelegate.cs

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Foundation;
22
using UIKit;
33
using AppsFlyerXamarinBinding;
4+
using System;
45

56
namespace AppsFlyerSampleApp
67
{
@@ -11,8 +12,7 @@ namespace AppsFlyerSampleApp
1112
public class AppDelegate : UIApplicationDelegate
1213
{
1314
// class-level declarations
14-
AppsFlyerXamarinBinding.AppsFlyerTracker tracker = AppsFlyerXamarinBinding.AppsFlyerTracker.SharedTracker();
15-
AppsFlyerTrackerDelegate af_delegate = new AppsFlyerConversionDataDelegate();
15+
AppsFlyerTracker tracker = AppsFlyerTracker.SharedTracker ();
1616

1717
public override UIWindow Window {
1818
get;
@@ -21,23 +21,31 @@ public override UIWindow Window {
2121

2222
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
2323
{
24-
// Override point for customization after application launch.
25-
// If not required for your application you can safely delete this method
26-
tracker.IsStopTracking = false;
24+
// Override point for customization after application launch.
25+
// If not required for your application you can safely delete this method
2726
tracker.IsDebug = true;
28-
tracker.AppsFlyerDevKey = "rbz2mfgZQY5mSEYNTyjwni";
29-
tracker.AppleAppID = "989898989";
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
30+
string [] networks = {"test_int", "partner_int"};
31+
tracker.SharingFilter = networks;
3032

31-
AppsFlyerTracker.SharedTracker().Delegate = af_delegate;
3233

33-
//for uninstall
34-
var settings = UIUserNotificationSettings.GetSettingsForTypes (
35-
UIUserNotificationType.Alert
36-
| UIUserNotificationType.Badge
37-
| UIUserNotificationType.Sound,
38-
new NSSet ());
39-
UIApplication.SharedApplication.RegisterUserNotificationSettings (settings);
40-
UIApplication.SharedApplication.RegisterForRemoteNotifications ();
34+
35+
// Conversion data callbacks
36+
ViewController controller = (ViewController)Window.RootViewController;
37+
AppsFlyerTrackerDelegate af_delegate = new AppsFlyerConversionDataDelegate (controller);
38+
AppsFlyerTracker.SharedTracker().Delegate = af_delegate;
39+
40+
// Uninstall Measurement
41+
var settings = UIUserNotificationSettings.GetSettingsForTypes (
42+
UIUserNotificationType.Alert
43+
| UIUserNotificationType.Badge
44+
| UIUserNotificationType.Sound,
45+
new NSSet ());
46+
47+
UIApplication.SharedApplication.RegisterUserNotificationSettings (settings);
48+
UIApplication.SharedApplication.RegisterForRemoteNotifications ();
4149

4250
return true;
4351
}
@@ -75,13 +83,22 @@ public override void WillTerminate (UIApplication application)
7583
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
7684
}
7785

86+
[Export ("application:didFailToRegisterForRemoteNotificationsWithError:")]
87+
public override void FailedToRegisterForRemoteNotifications (UIApplication application, NSError error)
88+
{
89+
Console.WriteLine ("AppsFLyer: Failed to register for remote notification with error: " + error.Description);
90+
}
91+
92+
[Export ("application:didRegisterForRemoteNotificationsWithDeviceToken:")]
7893
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
7994
{
8095
tracker.RegisterUninstall (deviceToken);
8196
}
97+
98+
[Export ("application:openURL:options:")]
8299
public override bool OpenUrl (UIApplication app, NSUrl url, NSDictionary options)
83100
{
84-
tracker.handleOpenUrl (url, options);
101+
tracker.handleOpenUrl (url, options);
85102
return true;
86103
}
87104
//Universal Links
@@ -92,7 +109,7 @@ public override bool ContinueUserActivity (UIApplication application,
92109
AppsFlyerTracker.SharedTracker ().ContinueUserActivity (userActivity, completionHandler);
93110
return true;
94111
}
95-
}
112+
}
96113
}
97114

98115

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,62 @@
11
using System;
22
using AppsFlyerXamarinBinding;
33
using Foundation;
4+
using UIKit;
45

56
namespace AppsFlyerSampleApp
67
{
78
public class AppsFlyerConversionDataDelegate : AppsFlyerTrackerDelegate
89
{
10+
11+
private ViewController viewController;
12+
private String oaoaString;
13+
private String gcdString;
14+
15+
16+
public AppsFlyerConversionDataDelegate(ViewController viewController)
17+
{
18+
this.viewController = viewController;
19+
oaoaString = viewController.oaoaString;
20+
gcdString = viewController.gcdString;
21+
Console.WriteLine ("AppsFlyerConversionDelegate called");
22+
}
23+
924
public override void OnAppOpenAttribution (NSDictionary attributionData) {
10-
Console.WriteLine ("deeplink data in xamarin = " + attributionData.Description);
25+
string message = "OnAppOpenAttribution:\n";
26+
foreach (var kvp in attributionData) {
27+
message = message + kvp.Key.ToString () + " = " + kvp.Value.ToString () + "\n";
28+
}
29+
Console.WriteLine (message);
30+
if (viewController.oaoaTextView != null) {
31+
viewController.oaoaTextView.Text = message;
32+
} else {
33+
oaoaString = message;
34+
}
1135
}
1236

1337
public override void OnAppOpenAttributionFailure (NSError error) {
1438

1539
}
1640

1741
public override void onConversionDataSuccess (NSDictionary conversionInfo) {
18-
Console.WriteLine ("conversion data in xamarin = " + conversionInfo.Description);
42+
String message = "OnConversionDataSuccess:\n";
43+
foreach (var kvp in conversionInfo) {
44+
if (kvp.Value != null) {
45+
message = message + kvp.Key.ToString () + " = " + kvp.Value.ToString () + "\n";
46+
}
47+
}
48+
message = message + "Timestamp:" + DateTime.Now;
49+
Console.WriteLine (message);
50+
if (viewController.gcdTextView != null) {
51+
viewController.gcdTextView.Text = message;
52+
} else {
53+
gcdString = message;
54+
}
1955
}
2056

2157
public override void onConversionDataFail (NSError error){
2258

2359
}
24-
}
60+
}
2561
}
2662

AppsFlyerSampleApp/AppsFlyerSampleApp.csproj

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<RootNamespace>AppsFlyerSampleApp</RootNamespace>
1010
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
1111
<AssemblyName>AppsFlyerSampleApp</AssemblyName>
12+
<ReleaseVersion>1.1</ReleaseVersion>
1213
</PropertyGroup>
1314
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
1415
<DebugSymbols>true</DebugSymbols>
@@ -22,8 +23,9 @@
2223
<MtouchArch>i386, x86_64</MtouchArch>
2324
<MtouchLink>None</MtouchLink>
2425
<MtouchDebug>true</MtouchDebug>
25-
<CodesignKey>iPhone Developer</CodesignKey>
26+
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
2627
<MtouchFastDev>true</MtouchFastDev>
28+
<CodesignProvision>VS: com.appsflyer.xamarinsample Development</CodesignProvision>
2729
</PropertyGroup>
2830
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
2931
<DebugType>full</DebugType>
@@ -35,7 +37,8 @@
3537
<MtouchArch>ARMv7, ARM64</MtouchArch>
3638
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
3739
<MtouchFloat32>true</MtouchFloat32>
38-
<CodesignKey>iPhone Developer</CodesignKey>
40+
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
41+
<CodesignProvision>VS: com.appsflyer.xamarinsample Development</CodesignProvision>
3942
</PropertyGroup>
4043
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
4144
<DebugType>full</DebugType>
@@ -44,9 +47,10 @@
4447
<ErrorReport>prompt</ErrorReport>
4548
<WarningLevel>4</WarningLevel>
4649
<ConsolePause>false</ConsolePause>
47-
<MtouchArch>i386</MtouchArch>
50+
<MtouchArch>i386, x86_64</MtouchArch>
4851
<MtouchLink>None</MtouchLink>
49-
<CodesignKey>iPhone Developer</CodesignKey>
52+
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
53+
<CodesignProvision>VS: com.appsflyer.xamarinsample Development</CodesignProvision>
5054
</PropertyGroup>
5155
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
5256
<DebugSymbols>true</DebugSymbols>
@@ -62,25 +66,16 @@
6266
<MtouchFloat32>true</MtouchFloat32>
6367
<MtouchDebug>true</MtouchDebug>
6468
<DeviceSpecificBuild>true</DeviceSpecificBuild>
65-
<CodesignKey>iPhone Developer</CodesignKey>
66-
<MtouchSdkVersion>9.3</MtouchSdkVersion>
69+
<CodesignKey>Apple Development: Vitaly Sokolov (U6WDWK9N3Q)</CodesignKey>
70+
<MtouchSdkVersion>13.6</MtouchSdkVersion>
6771
<MtouchLink>Full</MtouchLink>
72+
<CodesignProvision>VS: com.appsflyer.xamarinsample Development</CodesignProvision>
6873
</PropertyGroup>
6974
<ItemGroup>
7075
<Reference Include="System" />
7176
<Reference Include="System.Xml" />
7277
<Reference Include="System.Core" />
7378
<Reference Include="Xamarin.iOS" />
74-
<Reference Include="AppsFlyerXamarinBinding">
75-
<HintPath>..\AppsFlyerXamarinBinding\bin\Release\AppsFlyerXamarinBinding.dll</HintPath>
76-
</Reference>
77-
</ItemGroup>
78-
<ItemGroup>
79-
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
80-
<ImageAsset Include="Resources\Images.xcassets\Image.imageset\Contents.json" />
81-
<ImageAsset Include="Resources\Images.xcassets\Image.imageset\af_logo.png" />
82-
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\appIcon.png" />
83-
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\appIcon180.png" />
8479
</ItemGroup>
8580
<ItemGroup>
8681
<InterfaceDefinition Include="Resources\LaunchScreen.xib" />
@@ -99,5 +94,11 @@
9994
</Compile>
10095
<Compile Include="AppsFlyerConversionDataDelegate.cs" />
10196
</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>
102103
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
103104
</Project>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" ?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>aps-environment</key>
6+
<string>development</string>
7+
<key>com.apple.developer.associated-domains</key>
8+
<array>
9+
<string>applinks:sdk-test.onelink.me</string>
10+
</array>
511
</dict>
612
</plist>

AppsFlyerSampleApp/Info.plist

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleName</key>
6-
<string>AppsFlyerSampleApp</string>
6+
<string>Xamarin Sample App</string>
77
<key>CFBundleShortVersionString</key>
88
<string>1.0</string>
99
<key>CFBundleVersion</key>
@@ -46,7 +46,7 @@
4646
<dict>
4747
<key>CFBundleURLSchemes</key>
4848
<array>
49-
<string>aftest</string>
49+
<string>sdktest</string>
5050
</array>
5151
</dict>
5252
</array>
@@ -55,6 +55,8 @@
5555
<string>remote-notification</string>
5656
</array>
5757
<key>CFBundleIdentifier</key>
58-
<string>com.appsflyer.sampleapp</string>
58+
<string>com.appsflyer.xamarinsample</string>
59+
<key>CFBundleDisplayName</key>
60+
<string>Xamarin Sample App</string>
5961
</dict>
6062
</plist>

0 commit comments

Comments
 (0)