diff --git a/LocalyticsXamarin/LocalyticsSample/IPlatform.cs b/LocalyticsXamarin/Android/IPlatform.cs
similarity index 100%
rename from LocalyticsXamarin/LocalyticsSample/IPlatform.cs
rename to LocalyticsXamarin/Android/IPlatform.cs
diff --git a/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml b/LocalyticsXamarin/Android/LandingPage.xaml
similarity index 100%
rename from LocalyticsXamarin/LocalyticsSample/LandingPage.xaml
rename to LocalyticsXamarin/Android/LandingPage.xaml
diff --git a/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs b/LocalyticsXamarin/Android/LandingPage.xaml.cs
similarity index 100%
rename from LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs
rename to LocalyticsXamarin/Android/LandingPage.xaml.cs
diff --git a/LocalyticsXamarin/Android/LocalyticsSample.Android.csproj b/LocalyticsXamarin/Android/LocalyticsSample.Android.csproj
index f7d10ae..c1ddd4e 100644
--- a/LocalyticsXamarin/Android/LocalyticsSample.Android.csproj
+++ b/LocalyticsXamarin/Android/LocalyticsSample.Android.csproj
@@ -16,7 +16,7 @@
Resources\Resource.designer.cs
True
LocalyticsSample.Android
- v10.0
+ v11.0
@@ -154,10 +154,6 @@
-
- {E291B500-93AB-423A-874D-29DB2CA50526}
- LocalyticsSample
-
{BF2D2C42-B115-4B4B-A27E-B20DD0D7E207}
LocalyticsXamarin.Common
@@ -172,11 +168,15 @@
-
- LocalyticsXamarinForms.cs
-
+
+
+
+ LandingPage.xaml
+
+
+
@@ -198,6 +198,11 @@
+
+
+ MSBuild:UpdateDesignTimeXaml
+
+
diff --git a/LocalyticsXamarin/LocalyticsSample/LocalyticsSample.cs b/LocalyticsXamarin/Android/LocalyticsSample.cs
similarity index 100%
rename from LocalyticsXamarin/LocalyticsSample/LocalyticsSample.cs
rename to LocalyticsXamarin/Android/LocalyticsSample.cs
diff --git a/LocalyticsXamarin/Android/LocalyticsXamarinForms.cs b/LocalyticsXamarin/Android/LocalyticsXamarinForms.cs
new file mode 100644
index 0000000..6493348
--- /dev/null
+++ b/LocalyticsXamarin/Android/LocalyticsXamarinForms.cs
@@ -0,0 +1,117 @@
+using System;
+using LocalyticsSample.Shared;
+using LocalyticsXamarin.Common;
+using LocalyticsXamarin.Shared;
+
+
+[assembly: Xamarin.Forms.Dependency(typeof(LocalyticsSample.Shared.LocalyticsXamarinForms))]
+namespace LocalyticsSample.Shared
+{
+ public class LocalyticsXamarinForms : LocalyticsSDK, ILocalytics, IPlatform
+ {
+ protected bool inappShouldDisplay = true;
+ protected bool placesShouldDisplay = true;
+ protected bool shouldDeepLink = true;
+
+ public void SetPlacesShouldDisplay(bool display)
+ {
+ placesShouldDisplay = display;
+ }
+
+ public void SetInAppShouldDisplay(bool display)
+ {
+ inappShouldDisplay = display;
+ }
+
+ public void SetShouldDeeplink(bool display)
+ {
+ shouldDeepLink = display;
+ }
+
+
+ public virtual bool InAppShouldShowHandler(object inAppCampaign) { return true; }
+ public virtual bool PlacesShouldDisplay(object placesCampaign) { return true; }
+
+ public bool ShouldDeepLinkHandler(string url)
+ {
+ // Console.WriteLine("XamarinEvent ShouldDeepLink Url:{0}", url);
+ return shouldDeepLink;
+ }
+
+ public virtual void RegisterEvents()
+ {
+ LocalyticsSDK.LocalyticsDidTriggerRegions += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidTriggerRegions " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidUpdateLocation += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidUpdateLocation " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidUpdateMonitoredGeofences += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidUpdateMonitoredGeofences " + e);
+ };
+
+ // Analytics Events
+ LocalyticsSDK.LocalyticsSessionDidOpen += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionDidOpenEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidTagEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionDidTagEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsSessionWillClose += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionWillCloseEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsSessionWillOpen += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionWillOpenEvent: " + e);
+ };
+
+ LocalyticsSDK.InAppDidDismissEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppDidDismissEvent " + e);
+ };
+
+ LocalyticsSDK.InAppDidDisplayEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppDidDisplayEvent " + e);
+ };
+
+ LocalyticsSDK.InAppWillDismissEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppWillDismissEvent " + e);
+ };
+
+ LocalyticsSDK.InAppWillDisplayDelegate = (campaign, configuration) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsWillDisplayInAppMessage " + campaign + "," + configuration);
+ return configuration;
+ };
+
+ LocalyticsSDK.CallToActionShouldDeepLinkDelegate = (string deeplink, ICampaignBase campaign) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsCallToActionShouldDeepLinkDelegate " + deeplink + "," + campaign);
+ return true;
+ };
+
+ LocalyticsSDK.DidOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidOptOut " + optOutEventArgs);
+ };
+
+ LocalyticsSDK.DidPrivacyOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidPrivacyOptOut " + optOutEventArgs);
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/LocalyticsXamarin/Android/LocalyticsXamarinFormsAndroid.cs b/LocalyticsXamarin/Android/LocalyticsXamarinFormsAndroid.cs
new file mode 100644
index 0000000..bc1f858
--- /dev/null
+++ b/LocalyticsXamarin/Android/LocalyticsXamarinFormsAndroid.cs
@@ -0,0 +1,36 @@
+using System;
+using LocalyticsXamarin.Android;
+
+[assembly: Xamarin.Forms.Dependency(typeof(LocalyticsSample.Shared.LocalyticsXamarinForms))]
+namespace LocalyticsSample.Shared
+{
+ public class LocalyticsXamarinFormsAndroid : LocalyticsXamarinForms
+ {
+
+ public bool InAppShouldShowHandler(InAppCampaign inAppCampaign)
+ {
+ Console.WriteLine("XamarinEvent LLInAppCampaign campaign:{0}", (InAppCampaign)inAppCampaign);
+ return inappShouldDisplay;
+ }
+
+ public bool PlacesShouldDisplay(PlacesCampaign placesCampaign)
+ {
+ Console.WriteLine("XamarinEvent PlacesShouldDisplay campaign:{0}", (PlacesCampaign)placesCampaign);
+ return placesShouldDisplay;
+ }
+
+
+ public override void RegisterEvents()
+ {
+ base.RegisterEvents();
+
+ // LocalyticsSDK.InAppShouldShowDelegate = InAppShouldShowHandler;
+ // LocalyticsSDK.ShouldDeepLinkDelegate = ShouldDeepLinkHandler;
+
+ Localytics.ShouldPromptForLocationPermission = (Campaign campaign) => {
+ Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationPermission " + campaign);
+ return true;
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/Assets/AboutAssets.txt b/LocalyticsXamarin/LocalyticsMessagingSample.Android/Assets/AboutAssets.txt
deleted file mode 100644
index a9b0638..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/Assets/AboutAssets.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Any raw assets you want to be deployed with your application can be placed in
-this directory (and child directories) and given a Build Action of "AndroidAsset".
-
-These files will be deployed with your package and will be accessible using Android's
-AssetManager, like this:
-
-public class ReadAsset : Activity
-{
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate (bundle);
-
- InputStream input = Assets.Open ("my_asset.txt");
- }
-}
-
-Additionally, some Android functions will automatically load asset files:
-
-Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxActivity.cs b/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxActivity.cs
deleted file mode 100644
index ff74561..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxActivity.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Android.App;
-using Android.Content;
-using Android.OS;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-
-using LocalyticsXamarin.Android;
-
-namespace LocalyticsMessagingSample.Android
-{
- [Activity(Label = "InboxActivity")]
- public class InboxActivity : Activity
- {
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- SetContentView(Resource.Layout.Inbox);
-
- ListView listView = FindViewById(Resource.Id.lv_inbox);
- InboxListAdapter listAdapter = new InboxListAdapter(this, listView);
- listView.Adapter = listAdapter;
- listView.ItemClick += delegate (object sender, AdapterView.ItemClickEventArgs e)
- {
- InboxCampaign campaign = (InboxCampaign)listAdapter.GetItem(e.Position);
- campaign.Read = true;
-
- listAdapter.NotifyDataSetChanged();
-
- if (campaign.HasCreative)
- {
- Intent intent = new Intent(this, typeof(InboxDetailActivity));
- intent.PutExtra("campaign", campaign);
- StartActivity(intent);
- }
- };
-
- listAdapter.GetData(null);
- }
-
- protected override void OnResume()
- {
- base.OnResume();
-
- LocalyticsXamarin.Shared.LocalyticsSDK.SharedInstance.TagScreen("Inbox");
- }
- }
-}
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxDetailActivity.cs b/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxDetailActivity.cs
deleted file mode 100644
index 38f2249..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxDetailActivity.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Android.App;
-using Android.Content;
-using Android.OS;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-
-using LocalyticsXamarin.Android;
-
-namespace LocalyticsMessagingSample.Android
-{
- [Activity(Label = "InboxDetailActivity")]
- public class InboxDetailActivity : Activity
- {
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
-
- SetContentView(Resource.Layout.InboxDetail);
-
- if (savedInstanceState == null)
- {
- InboxCampaign campaign = (InboxCampaign)Intent.GetParcelableExtra("campaign");
- InboxDetailFragment fragment = InboxDetailFragment.NewInstance(campaign);
- FragmentTransaction transaction = FragmentManager.BeginTransaction();
- transaction.Add(Resource.Id.container, fragment);
- transaction.Commit();
- }
- }
-
- protected override void OnResume()
- {
- base.OnResume();
-
- LocalyticsAutoIntegrateApplication.localyticsXamarin.TagScreen("Inbox Detail");
- }
- }
-}
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsAutoIntegrateApplication.cs b/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsAutoIntegrateApplication.cs
deleted file mode 100644
index bcc22ad..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsAutoIntegrateApplication.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Android.App;
-using Android.Locations;
-using Android.Runtime;
-using Android.Support.V4.App;
-
-using LocalyticsXamarin.Android;
-using LocalyticsXamarin.Common;
-using LocalyticsXamarin.Shared;
-
-namespace LocalyticsMessagingSample.Android
-{
- [Application]
- public class LocalyticsAutoIntegrateApplication : Application
- {
- public static LocalyticsXamarin.Shared.LocalyticsSDK localyticsXamarin;
-
- public LocalyticsAutoIntegrateApplication(IntPtr handle, JniHandleOwnership ownerShip) : base(handle, ownerShip)
- {
- }
- override public void OnCreate()
- {
- base.OnCreate();
- localyticsXamarin = LocalyticsXamarin.Shared.LocalyticsSDK.SharedInstance;
-
- Localytics.SetOption("ll_app_key", "f737ce58a68aea90b4c79fc-0bc951b0-b42b-11e3-429f-00a426b17dd8");
-#if DEBUG
- localyticsXamarin.LoggingEnabled = true;
-#endif
-
- Localytics.AutoIntegrate(this);
- Localytics.SetLocationMonitoringEnabled(true);
-
- //// Analytics callbacks
- LocalyticsSDK.LocalyticsDidTagEvent += LL_OnLocalyticsDidTagEvent;
- LocalyticsSDK.LocalyticsSessionWillOpen += LL_OnLocalyticsSessionWillOpen;
- LocalyticsSDK.LocalyticsSessionDidOpen += LL_OnLocalyticsSessionDidOpen;
- LocalyticsSDK.LocalyticsSessionWillClose += LL_OnLocalyticsSessionWillClose;
-
- //// Messaging callbacks
- LocalyticsSDK.InAppDidDismissEvent += LL_OnLocalyticsDidDismissInAppMessage;
- LocalyticsSDK.InAppDidDisplayEvent += LL_OnLocalyticsDidDisplayInAppMessage;
- LocalyticsSDK.InAppWillDismissEvent += LL_OnLocalyticsWillDismissInAppMessage;
- LocalyticsSDK.InAppWillDisplayDelegate += LL_OnLocalyticsWillDisplayInAppMessage;
-
- Localytics.ShouldShowPushNotification += LL_OnLocalyticsShouldShowPushNotification;
- LocalyticsSDK.PlacesShouldDisplayCampaignDelegate += LL_OnLocalyticsShouldShowPlacesPushNotification;
-
- Localytics.WillShowPushNotification += LL_OnLocalyticsWillShowPushNotification;
- Localytics.WillShowPlacesPushNotification += LL_OnLocalyticsWillShowPlacesPushNotification;
-
- //// Location callbacks
- LocalyticsSDK.LocalyticsDidUpdateLocation += LL_OnLocalyticsDidUpdateLocation;
- LocalyticsSDK.LocalyticsDidTriggerRegions += (sender, e) => {
- Console.WriteLine("XamarinEvent LocalyticsDidTriggerRegions " + e);
- };
- LocalyticsSDK.LocalyticsDidUpdateMonitoredGeofences += LL_OnLocalyticsDidUpdateMonitoredGeofences;
-
- Localytics.ShouldPromptForLocationPermission += (arg) => {
- Console.WriteLine("XamarinEvent ShouldPromptForLocationPermission " + arg);
- return true;
- };
-
- Localytics.DeeplinkToSettings += (i, c) =>
- {
- Console.WriteLine("XamarinEvent ShouldPromptForLocationPermission " + i + c);
- return true;
- };
-
- }
-
- void LL_OnLocalyticsDidTagEvent(object sender, LocalyticsDidTagEventEventArgs eventArgs)
- {
- string eventName = eventArgs.EventName;
- IDictionary attributes = eventArgs.Attributes;
- double? customerValueIncrease = eventArgs.CustomerValue;
- if (attributes != null)
- {
- Console.WriteLine("Did tag event: name: " + eventName + " attributes.Count: " + attributes.Count + " customerValueIncrease: " + customerValueIncrease);
- }
- else
- {
- Console.WriteLine("Did tag event: name: " + eventName + " attributes.Count: " + 0 + " customerValueIncrease: " + customerValueIncrease);
- }
- }
-
- void LL_OnLocalyticsSessionWillClose(object sender, EventArgs eventArgs)
- {
- Console.WriteLine("Session will close");
- }
-
- void LL_OnLocalyticsSessionDidOpen(object sender, LocalyticsSessionDidOpenEventArgs args)
- {
- Console.WriteLine("Session did open: isFirst: " + args.First + " isUpgrade: " + args.Upgrade + " isResume: " + args.Resume);
- }
-
- void LL_OnLocalyticsSessionWillOpen(object sender, LocalyticsSessionWillOpenEventArgs args)
- {
- Console.WriteLine("Session will open: isFirst: " + args.First + " isUpgrade: " + args.Upgrade + " isResume: " + args.Resume);
- }
-
- void LL_OnLocalyticsDidDismissInAppMessage(object sender, InAppDidDismissEventArgs eventArgs)
- {
- Console.WriteLine("DidDismissInAppMessage");
- }
-
- void LL_OnLocalyticsDidDisplayInAppMessage(object sender, InAppDidDisplayEventArgs eventArgs)
- {
- Console.WriteLine("DidDisplayInAppMessage");
- }
-
- void LL_OnLocalyticsWillDismissInAppMessage(object sender, InAppWillDismissEventArgs eventArgs)
- {
- Console.WriteLine("WillDismissInAppMessage");
- }
-
- InAppConfiguration LL_OnLocalyticsWillDisplayInAppMessage(InAppCampaign campaign, InAppConfiguration configuration)
- {
- Console.WriteLine("WillDisplayInAppMessage");
- return configuration;
- }
-
- bool LL_OnLocalyticsShouldShowPushNotification(PushCampaign campaign)
- {
- Console.WriteLine("Should show push notification. Name: " + campaign.Name + ". Campaign Id: " + campaign.CampaignId + ". Message: " + campaign.Message);
- return true;
- }
-
- NotificationCompat.Builder LL_OnLocalyticsWillShowPushNotification(NotificationCompat.Builder builder, PushCampaign campaign)
- {
- Console.WriteLine("Will show push notification. Name: " + campaign.Name + ". Campaign Id: " + campaign.CampaignId + ". Message: " + campaign.Message);
- return builder;
- }
-
- bool LL_OnLocalyticsShouldShowPlacesPushNotification(PlacesCampaign campaign)
- {
- Console.WriteLine("Should show places notification. Name: " + campaign.Name + ". Campaign Id: " + campaign.CampaignId + ". Message: " + campaign.Message);
- return true;
- }
-
- NotificationCompat.Builder LL_OnLocalyticsWillShowPlacesPushNotification(NotificationCompat.Builder builder, PlacesCampaign campaign)
- {
- Console.WriteLine("Will show places push notification. Name: " + campaign.Name + ". Campaign Id: " + campaign.CampaignId + ". Message: " + campaign.Message);
- return builder;
- }
-
- void LL_OnLocalyticsDidUpdateLocation(object sender, LocalyticsDidUpdateLocationEventArgs eventArgs)
- {
- Console.WriteLine("Did update location: " + eventArgs.Location);
- }
-
- void LL_OnLocalyticsDidTriggerRegions(object sender, LocalyticsDidTriggerRegionsEventArgs eventArgs)
- {
- Console.WriteLine("Did trigger regions: " + eventArgs.Regions + " with event: " + eventArgs.RegionEvent);
- }
-
- void LL_OnLocalyticsDidUpdateMonitoredGeofences(object sender, LocalyticsDidUpdateMonitoredGeofencesEventArgs eventArgs)
- {
- Console.WriteLine("Did update monitored geofences. Added: " + eventArgs.AddedRegions + " and removed: " + eventArgs.RemovedRegions);
- }
- }
-}
-
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsMessagingSample.Android.csproj b/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsMessagingSample.Android.csproj
deleted file mode 100644
index b8a978e..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsMessagingSample.Android.csproj
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}
- Library
- LocalyticsMessagingSample.Android
- Assets
- Resources
- Resource
- Resources\Resource.designer.cs
- True
- LocalyticsMessagingSample.Android
- Properties\AndroidManifest.xml
- v9.0
-
-
- true
- full
- false
- bin\Debug
- DEBUG;
- prompt
- 4
- None
- false
-
-
- full
- true
- bin\Release
- prompt
- 4
- false
- false
-
-
-
-
-
-
-
- ..\packages\Xamarin.Firebase.Common.60.1142.1\lib\MonoAndroid80\Xamarin.Firebase.Common.dll
-
-
- ..\packages\Xamarin.Firebase.Iid.60.1142.1\lib\MonoAndroid80\Xamarin.Firebase.Iid.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Maps.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Maps.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Ads.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Ads.dll
-
-
- ..\packages\Xamarin.Android.Support.v4.27.0.2\lib\MonoAndroid81\Xamarin.Android.Support.v4.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Basement.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Basement.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Gass.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Gass.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Tasks.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Tasks.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Base.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Base.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Iid.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Iid.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Gcm.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Gcm.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Ads.Lite.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Ads.Lite.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Ads.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Ads.dll
-
-
- ..\packages\Xamarin.GooglePlayServices.Location.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Location.dll
- False
-
-
- ..\packages\Xamarin.Android.Arch.Core.Common.26.1.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll
-
-
- ..\packages\Xamarin.Android.Arch.Lifecycle.Common.26.1.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll
-
-
- ..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.26.1.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll
-
-
- ..\packages\Xamarin.Android.Support.Annotations.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Annotations.dll
-
-
- ..\packages\Xamarin.Android.Support.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Compat.dll
-
-
- ..\packages\Xamarin.Android.Support.Core.UI.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.UI.dll
-
-
- ..\packages\Xamarin.Android.Support.Core.Utils.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.Utils.dll
-
-
- ..\packages\Xamarin.Android.Support.Fragment.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Fragment.dll
-
-
- ..\packages\Xamarin.Android.Support.Media.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Media.Compat.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {BF2D2C42-B115-4B4B-A27E-B20DD0D7E207}
- LocalyticsXamarin.Common
-
-
- {8D4D1584-55B7-4E32-9373-9D1DA7D9A209}
- LocalyticsXamarin.Android
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/LocalyticsXamarin/LocalyticsMessagingSample.Android/MainActivity.cs b/LocalyticsXamarin/LocalyticsMessagingSample.Android/MainActivity.cs
deleted file mode 100644
index 8dccdc5..0000000
--- a/LocalyticsXamarin/LocalyticsMessagingSample.Android/MainActivity.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-using System;
-using System.Threading;
-
-using Android.App;
-using Android.Content;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-using Android.OS;
-using Android;
-using Android.Content.PM;
-
-using LocalyticsXamarin.Android;
-using Android.Support.V4.App;
-
-namespace LocalyticsMessagingSample.Android
-{
- [Activity(Label = "LocalyticsMessagingSample.Android", MainLauncher = true, Icon = "@drawable/icon")]
- [IntentFilter(new[] { Intent.ActionView }, DataScheme = "ampYOUR-LOCALYTICS-APP-KEY", Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable })]
- public class MainActivity : FragmentActivity
- {
- readonly string[] PermissionsLocation = {
- Manifest.Permission.AccessCoarseLocation,
- Manifest.Permission.AccessFineLocation
- };
-
- const int RequestLocationId = 1;
-
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
-
- SetContentView(Resource.Layout.Main);
- LocalyticsAutoIntegrateApplication.localyticsXamarin.CustomerId = "ms_test_user";
-
- // Register Push
- Localytics.RegisterPush(); //"YOUR_GCM_PROJECT_NUMBER");
- Localytics.SetOption("session_timeout", 1); // Shorten for testing purpose only
-
- Button tagEventButton = FindViewById
true
diff --git a/LocalyticsXamarin/LocalyticsXamarin.Android/Properties/AssemblyInfo.cs b/LocalyticsXamarin/LocalyticsXamarin.Android/Properties/AssemblyInfo.cs
index e0ef820..1c7fb69 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.Android/Properties/AssemblyInfo.cs
+++ b/LocalyticsXamarin/LocalyticsXamarin.Android/Properties/AssemblyInfo.cs
@@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion ("6.0.2.*")]
+[assembly: AssemblyVersion ("6.0.3.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/LocalyticsXamarin/LocalyticsXamarin.Common/Properties/AssemblyInfo.cs b/LocalyticsXamarin/LocalyticsXamarin.Common/Properties/AssemblyInfo.cs
index d69569d..daa08db 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.Common/Properties/AssemblyInfo.cs
+++ b/LocalyticsXamarin/LocalyticsXamarin.Common/Properties/AssemblyInfo.cs
@@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion ("6.0.2.*")]
+[assembly: AssemblyVersion ("6.0.3.*")]
// The following attributes are used to specify the signing key for the assembly,
diff --git a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.props b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.props
index 78efda8..53cb616 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.props
+++ b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.props
@@ -1,7 +1,7 @@
- /Users/druiz/.nuget/packages/
+ /Users/avidas/.nuget/packages/
diff --git a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.targets b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.targets
index 9359952..abec17f 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.targets
+++ b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuget.targets
@@ -1,7 +1,7 @@
- /Users/druiz/.nuget/packages/
+ /Users/avidas/.nuget/packages/
diff --git a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuproj b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuproj
index 30f2a47..a900b88 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuproj
+++ b/LocalyticsXamarin/LocalyticsXamarin.NuGet/Localytics.NuGet.nuproj
@@ -7,7 +7,7 @@
{3D21B247-4672-466E-9F96-616FC955F033}
Localytics Xamarin SDK for Android and iOS
LocalyticsXamarin
- 6.0.2
+ 6.0.3
Localytics
false
false
@@ -15,7 +15,7 @@
Localytics
false
Localytics.NuGet
- v4.5.1
+ v4.5.2
Localytics
Localytics/Open Source
Localytics Xamarin iOS Android
@@ -52,11 +52,6 @@
All
-
-
- LocalyticsXamarinForms.cs
-
-
Localytics.framework\Modules\module.modulemap
diff --git a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarin.Shared.projitems b/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarin.Shared.projitems
index c6edb76..387bcbb 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarin.Shared.projitems
+++ b/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarin.Shared.projitems
@@ -13,7 +13,4 @@
-
-
-
\ No newline at end of file
diff --git a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarinForms.cs b/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarinForms.cs
deleted file mode 100644
index 6ee07e0..0000000
--- a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarinForms.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-using System;
-using System.Diagnostics;
-using LocalyticsSample.Shared;
-using LocalyticsXamarin.Common;
-
-#if __IOS__
-using Foundation;
-using UIKit;
-using LocalyticsXamarin.IOS;
-using NativeInAppCampaign = LocalyticsXamarin.IOS.LLInAppCampaign;
-using NativePlacesCampaign = LocalyticsXamarin.IOS.LLPlacesCampaign;
-#else
-using Android.Support.V4.App;
-using LocalyticsXamarin.Android;
-using NativeInAppCampaign = LocalyticsXamarin.Android.InAppCampaign;
-using NativePlacesCampaign = LocalyticsXamarin.Android.PlacesCampaign;
-#endif
-
-[assembly: Xamarin.Forms.Dependency(typeof(LocalyticsXamarin.Shared.LocalyticsXamarinForms))]
-namespace LocalyticsXamarin.Shared
-{
- public class LocalyticsXamarinForms : LocalyticsSDK, ILocalytics, IPlatform
- {
- bool inappShouldDisplay = true;
- bool placesShouldDisplay = true;
- bool shouldDeepLink = true;
-
- public void SetPlacesShouldDisplay(bool display)
- {
- placesShouldDisplay = display;
- }
-
- public void SetInAppShouldDisplay(bool display)
- {
- inappShouldDisplay = display;
- }
-
- public void SetShouldDeeplink(bool display)
- {
- shouldDeepLink = display;
- }
-
-#if __IOS__
- public UILocalNotification PlacesWillDisplayNotification(UILocalNotification localNotification, LLPlacesCampaign placesCampaign)
- {
- Console.WriteLine("XamarinEvent PlacesWillDisplayNotification {0}", placesCampaign);
- return localNotification;
- }
-
-
- public UserNotifications.UNMutableNotificationContent PlacesWillDisplayNotificationContent(UserNotifications.UNMutableNotificationContent notificationContent, LLPlacesCampaign placesCampaign)
- {
- Console.WriteLine("XamarinEvent PlacesWillDisplayNotificationContent {0}", placesCampaign);
- return notificationContent;
- }
-#endif
-
- public bool InAppShouldShowHandler(NativeInAppCampaign inAppCampaign)
- {
- Console.WriteLine("XamarinEvent LLInAppCampaign campaign:{0}", inAppCampaign);
- return inappShouldDisplay;
- }
-
- public bool PlacesShouldDisplay(NativePlacesCampaign placesCampaign)
- {
- Console.WriteLine("XamarinEvent PlacesShouldDisplay campaign:{0}", placesCampaign);
- return placesShouldDisplay;
- }
-
- public bool ShouldDeepLinkHandler(string url)
- {
- Console.WriteLine("XamarinEvent ShouldDeepLink Url:{0}", url);
- return shouldDeepLink;
- }
-
- public void RegisterEvents()
- {
- LocalyticsSDK.InAppShouldShowDelegate = InAppShouldShowHandler;
- LocalyticsSDK.ShouldDeepLinkDelegate = ShouldDeepLinkHandler;
-
- LocalyticsSDK.LocalyticsDidTriggerRegions += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsDidTriggerRegions " + e);
- };
-
- LocalyticsSDK.LocalyticsDidUpdateLocation += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsDidUpdateLocation " + e);
- };
-
- LocalyticsSDK.LocalyticsDidUpdateMonitoredGeofences += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsDidUpdateMonitoredGeofences " + e);
- };
-
- // Analytics Events
- LocalyticsSDK.LocalyticsSessionDidOpen += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent SessionDidOpenEvent: " + e);
- };
-
- LocalyticsSDK.LocalyticsDidTagEvent += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent SessionDidTagEvent: " + e);
- };
-
- LocalyticsSDK.LocalyticsSessionWillClose += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent SessionWillCloseEvent: " + e);
- };
-
- LocalyticsSDK.LocalyticsSessionWillOpen += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent SessionWillOpenEvent: " + e);
- };
-
- LocalyticsSDK.InAppDidDismissEvent += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent InAppDidDismissEvent " + e);
- };
-
- LocalyticsSDK.InAppDidDisplayEvent += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent InAppDidDisplayEvent " + e);
- };
-
- LocalyticsSDK.InAppWillDismissEvent += (sender, e) =>
- {
- Console.WriteLine("XamarinEvent InAppWillDismissEvent " + e);
- };
-
- LocalyticsSDK.InAppWillDisplayDelegate = (campaign, configuration) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsWillDisplayInAppMessage " + campaign + "," + configuration);
- return configuration;
- };
-
- LocalyticsSDK.CallToActionShouldDeepLinkDelegate = (string deeplink, ICampaignBase campaign) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsCallToActionShouldDeepLinkDelegate " + deeplink + "," + campaign);
- return true;
- };
-
- LocalyticsSDK.DidOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsDidOptOut " + optOutEventArgs);
- };
-
- LocalyticsSDK.DidPrivacyOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
- {
- Console.WriteLine("XamarinEvent LocalyticsDidPrivacyOptOut " + optOutEventArgs);
- };
-
-#if __IOS__
- Localytics.PlacesWillDisplayNotification = PlacesWillDisplayNotification;
- Localytics.PlacesWillDisplayNotificationContent = PlacesWillDisplayNotificationContent;
- Localytics.ShouldPromptForLocationWhenInUsePermission = (LLCampaignBase campaign) => {
- Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationWhenInUsePermission " + campaign);
- return true;
- };
-
- Localytics.ShouldPromptForLocationAlwaysPermission = (LLCampaignBase campaign) => {
- Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationAlwaysPermission " + campaign);
- return true;
- };
-
- Localytics.ShouldPromptForNotificationPermission = (LLCampaignBase campaign) => {
- Console.WriteLine("XamarinEvent LocalyticsShouldPromptForNotificationPermission " + campaign);
- return true;
- };
- Localytics.ShouldDeepLinkToSettings = (LLCampaignBase campaign) => {
- Console.WriteLine("XamarinEvent ShouldDeepLinkToSettings " + campaign);
- return true;
- };
-#else
- Localytics.ShouldPromptForLocationPermission = (Campaign campaign) => {
- Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationPermission " + campaign);
- return true;
- };
-#endif
- }
- }
-}
diff --git a/LocalyticsXamarin/LocalyticsXamarin.iOS/Properties/AssemblyInfo.cs b/LocalyticsXamarin/LocalyticsXamarin.iOS/Properties/AssemblyInfo.cs
index 510230d..8d17c2c 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.iOS/Properties/AssemblyInfo.cs
+++ b/LocalyticsXamarin/LocalyticsXamarin.iOS/Properties/AssemblyInfo.cs
@@ -25,7 +25,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion ("6.0.2.*")]
+[assembly: AssemblyVersion ("6.0.3.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/LocalyticsXamarin/LocalyticsXamarin.sln b/LocalyticsXamarin/LocalyticsXamarin.sln
index 2275e98..d5b5a2b 100644
--- a/LocalyticsXamarin/LocalyticsXamarin.sln
+++ b/LocalyticsXamarin/LocalyticsXamarin.sln
@@ -11,13 +11,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalyticsXamarin.iOS", "Lo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalyticsSample.iOS", "iOS\LocalyticsSample.iOS.csproj", "{E7C583A9-10C1-4776-AD86-7E0821F86989}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalyticsSample", "LocalyticsSample\LocalyticsSample.csproj", "{E291B500-93AB-423A-874D-29DB2CA50526}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalyticsSample.Android", "Android\LocalyticsSample.Android.csproj", "{9C9948B0-EC28-4454-98BB-471C6BA02ABF}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalyticsMessagingSample.Android", "LocalyticsMessagingSample.Android\LocalyticsMessagingSample.Android.csproj", "{AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}"
-EndProject
-Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Localytics.NuGet", "LocalyticsXamarin.NuGet\Localytics.NuGet.nuproj", "{261B24C2-8634-4401-A81A-CCB3A52D17C4}"
+Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "Localytics.NuGet", "LocalyticsXamarin.NuGet\Localytics.NuGet.nuproj", "{3D21B247-4672-466E-9F96-616FC955F033}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -77,18 +73,6 @@ Global
{E7C583A9-10C1-4776-AD86-7E0821F86989}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{E7C583A9-10C1-4776-AD86-7E0821F86989}.Debug|iPhone.ActiveCfg = Debug|iPhone
{E7C583A9-10C1-4776-AD86-7E0821F86989}.Debug|iPhone.Build.0 = Debug|iPhone
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|Any CPU.Build.0 = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|iPhone.ActiveCfg = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|iPhone.Build.0 = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {E291B500-93AB-423A-874D-29DB2CA50526}.Debug|iPhone.Build.0 = Debug|Any CPU
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -101,30 +85,18 @@ Global
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{9C9948B0-EC28-4454-98BB-471C6BA02ABF}.Debug|iPhone.Build.0 = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|Any CPU.Build.0 = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|iPhone.ActiveCfg = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|iPhone.Build.0 = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {AB9BD7B2-6E6D-4C72-911F-ECF85D72776D}.Debug|iPhone.Build.0 = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|Any CPU.Build.0 = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|iPhone.ActiveCfg = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|iPhone.Build.0 = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {261B24C2-8634-4401-A81A-CCB3A52D17C4}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|iPhone.Build.0 = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {3D21B247-4672-466E-9F96-616FC955F033}.Debug|iPhone.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
diff --git a/LocalyticsXamarin/iOS/IPlatform.cs b/LocalyticsXamarin/iOS/IPlatform.cs
new file mode 100644
index 0000000..5df844d
--- /dev/null
+++ b/LocalyticsXamarin/iOS/IPlatform.cs
@@ -0,0 +1,11 @@
+using System;
+namespace LocalyticsSample.Shared
+{
+ public interface IPlatform
+ {
+ void RegisterEvents();
+ void SetPlacesShouldDisplay(bool display);
+ void SetInAppShouldDisplay(bool display);
+ void SetShouldDeeplink(bool display);
+ }
+}
diff --git a/LocalyticsXamarin/iOS/LandingPage.xaml b/LocalyticsXamarin/iOS/LandingPage.xaml
new file mode 100644
index 0000000..3f5942f
--- /dev/null
+++ b/LocalyticsXamarin/iOS/LandingPage.xaml
@@ -0,0 +1,134 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/LocalyticsXamarin/iOS/LandingPage.xaml.cs b/LocalyticsXamarin/iOS/LandingPage.xaml.cs
new file mode 100644
index 0000000..99b4edf
--- /dev/null
+++ b/LocalyticsXamarin/iOS/LandingPage.xaml.cs
@@ -0,0 +1,284 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Threading;
+
+using Xamarin.Forms;
+using LocalyticsXamarin.Common;
+
+namespace LocalyticsSample.Shared
+{
+ public partial class LandingPage : ContentPage
+ {
+ void LoggingToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ Task.Run(() =>
+ {
+ localytics.LoggingEnabled = ((Switch)sender).IsToggled;
+ RefreshBackgroundProperties(1);
+ });
+ }
+
+ void OptOutToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ App.localytics.OptedOut = ((Switch)sender).IsToggled;
+ RefreshBackgroundProperties();
+ }
+
+ void TestModeToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ Task.Run(() =>
+ {
+ var t = ((Switch)sender).IsToggled;
+ App.localytics.TestModeEnabled = t;
+ RefreshBackgroundProperties(1);
+ });
+ }
+
+ void PlacesDisplayToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ App.platform.SetPlacesShouldDisplay(((Switch)sender).IsToggled);
+ }
+
+ void InappDisplayToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ App.platform.SetInAppShouldDisplay(((Switch)sender).IsToggled);
+ }
+
+ void DeepLinkToggled(object sender, Xamarin.Forms.ToggledEventArgs e)
+ {
+ App.platform.SetShouldDeeplink(((Switch)sender).IsToggled);
+ }
+
+ void OnTestMode(object sender, System.EventArgs e)
+ {
+ Task.Run(() =>
+ {
+ App.localytics.TestModeEnabled = true;
+ });
+ }
+
+ void OffTestMode(object sender, System.EventArgs e)
+ {
+ App.localytics.TestModeEnabled = false;
+ }
+
+ void TriggerInAppSessionStart(object sender, System.EventArgs e)
+ {
+ App.localytics.TriggerInAppMessagesForSessionStart();
+ }
+
+ void TriggerInAppLang(object sender, System.EventArgs e)
+ {
+ App.localytics.TriggerInAppMessage("lang");
+ }
+
+ void OnDismissButtonRight(object sender, System.EventArgs e)
+ {
+ localytics.InAppMessageDismissButtonLocation = XFLLInAppMessageDismissButtonLocation.Right;
+ this.dismissBtnLocation.Text = localytics.InAppMessageDismissButtonLocation.ToString();
+ }
+
+ void OnDismissButtonLeft(object sender, System.EventArgs e)
+ {
+ localytics.InAppMessageDismissButtonLocation = XFLLInAppMessageDismissButtonLocation.Left;
+ this.dismissBtnLocation.Text = localytics.InAppMessageDismissButtonLocation.ToString();
+ }
+
+ void OnPauseDataUpload(object sender, System.EventArgs e)
+ {
+ localytics.PauseDataUploading(true);
+ }
+
+ void OnResumeDataUpload(object sender, System.EventArgs e)
+ {
+ localytics.PauseDataUploading(false);
+ }
+
+ void OnPrivacyOptOut(object sender, System.EventArgs e)
+ {
+ localytics.PrivacyOptedOut = true;
+ RefreshBackgroundProperties();
+ }
+
+ void OnPrivacyOptIn(object sender, System.EventArgs e)
+ {
+ localytics.PrivacyOptedOut = false;
+ RefreshBackgroundProperties();
+ }
+
+ void OnTriggerInApp(object sender, System.EventArgs e)
+ {
+ localytics.TriggerInAppMessage(this.triggerName.Text);
+ }
+
+ public LandingPage()
+ {
+ InitializeComponent();
+ localytics = DependencyService.Get();
+ }
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+
+ RefreshInfo();
+ }
+
+ void OnRefresh(object sender, EventArgs e)
+ {
+ RefreshInfo();
+ }
+
+ void OnDelete(object sender, System.EventArgs e)
+ {
+ Task.Run(() =>
+ {
+ var campaigns = localytics.DisplayableInboxCampaigns();
+ foreach (IInboxCampaign campaign in campaigns)
+ {
+ localytics.DeleteInboxCampaign(campaign);
+ break;
+ }
+ });
+ }
+
+ ILocalytics localytics;
+
+ void RefreshBackgroundProperties(int delay = 0)
+ {
+ Task.Run(() =>
+ {
+ if (delay != 0)
+ {
+ Task.Delay(10000);
+ }
+ var privacyOptout = localytics.PrivacyOptedOut;
+ var optout = localytics.OptedOut;
+ var testMode = localytics.TestModeEnabled;
+ var logging = localytics.LoggingEnabled;
+ Device.BeginInvokeOnMainThread(delegate
+ {
+ this.privacyoptout.Text = privacyOptout.ToString();
+ if (this.OptOut.IsToggled != optout)
+ {
+ this.OptOut.IsToggled = optout;
+ }
+ if (this.TestMode.IsToggled != testMode)
+ {
+ this.TestMode.IsToggled = testMode;
+ }
+ if (this.Logging.IsToggled != logging)
+ {
+ this.Logging.IsToggled = logging;
+ }
+ });
+ });
+ }
+ void RefreshInfo()
+ {
+ localytics.LoggingEnabled = true;
+ System.Threading.Tasks.Task.Factory.StartNew(() =>
+ {
+ string value0 = "AppKey: " + localytics.AppKey;
+ string value1 = "CustomerId: " + localytics.CustomerId;
+ string value2 = "InstallId: " + localytics.InstallId;
+ string value3 = "LibraryVersion: " + localytics.LibraryVersion;
+ string value4 = "LocalAuthenticationToken: " + localytics.LocalAuthenticationToken;
+ string value5 = "";
+ string value6 = "Push Token/RegID: " + localytics.PushTokenInfo;
+ string value7 = "";
+
+ RefreshBackgroundProperties();
+ var btnLoc = localytics.InAppMessageDismissButtonLocation;
+
+ Device.BeginInvokeOnMainThread(delegate
+ {
+ this.dismissBtnLocation.Text = btnLoc.ToString();
+ info0.Text = value0;
+ info1.Text = value1;
+ info2.Text = value2;
+ info3.Text = value3;
+ info4.Text = value4;
+ info5.Text = value5;
+ info6.Text = value6;
+ info7.Text = value7;
+ });
+ });
+ }
+
+ void OnOpenSession(object sender, EventArgs e)
+ {
+ localytics.OpenSession();
+ }
+
+ void OnCloseSession(object sender, EventArgs e)
+ {
+ localytics.CloseSession();
+ }
+
+ void OnUpload(object sender, EventArgs e)
+ {
+ localytics.Upload();
+ }
+
+ void OnEnableLoguana(object sender, EventArgs e)
+ {
+ localytics.EnableLiveDeviceLogging();
+ }
+
+
+ void OnTagEvent(object sender, EventArgs e)
+ {
+ localytics.TagEvent(eventText.Text);
+ }
+
+ void OnTagScreen(object sender, EventArgs e)
+ {
+ localytics.TagScreen(screenText.Text);
+ }
+
+ void OnGetCD(object sender, EventArgs e)
+ {
+ System.Threading.Tasks.Task.Factory.StartNew(() =>
+ {
+ string cd = localytics.GetCustomDimension(Convert.ToUInt32(cdNumber.Text));
+
+ Device.BeginInvokeOnMainThread(delegate
+ {
+ cdValue.Text = cd;
+ });
+ });
+ }
+
+ void OnSetCD(object sender, EventArgs e)
+ {
+ localytics.SetCustomDimension(cdValue.Text, Convert.ToUInt32(cdNumber.Text));
+ }
+
+ void OnSetProfile(object sender, EventArgs e)
+ {
+ localytics.SetProfileAttribute(profileAttribute.Text, XFLLProfileScope.Application, profileValue.Text);
+ localytics.SetProfileAttribute(profileAttribute.Text + "_ORG", XFLLProfileScope.Organization, profileValue.Text);
+ }
+
+ void OnGetIdentifier(object sender, EventArgs e)
+ {
+ System.Threading.Tasks.Task.Factory.StartNew(() =>
+ {
+ string id = localytics.GetIdentifier(identifier.Text);
+
+ Device.BeginInvokeOnMainThread(delegate
+ {
+ identifierValue.Text = id;
+ });
+ });
+ }
+
+ void OnSetIdentifier(object sender, EventArgs e)
+ {
+ localytics.SetIdentifier(identifierValue.Text, identifier.Text);
+ }
+ }
+}
+
diff --git a/LocalyticsXamarin/iOS/LocalyticsSample.cs b/LocalyticsXamarin/iOS/LocalyticsSample.cs
new file mode 100644
index 0000000..c8fe6cc
--- /dev/null
+++ b/LocalyticsXamarin/iOS/LocalyticsSample.cs
@@ -0,0 +1,218 @@
+using Xamarin.Forms;
+using System.Collections.Generic;
+using System.Diagnostics;
+using LocalyticsXamarin.Common;
+using System.Threading.Tasks;
+
+namespace LocalyticsSample.Shared
+{
+ public class App : Application
+ {
+ public static ILocalytics localytics;
+ public static IPlatform platform;
+ void HandleInboxCampaignsDelegate(IInboxCampaign[] campaigns)
+ {
+ foreach (IInboxCampaign a in campaigns)
+ {
+ try
+ {
+ Debug.WriteLine("HandleInboxCampaignsDelegate inbox campaign " + a);
+
+ }
+ catch (System.Exception ex)
+ {
+ Debug.WriteLine(ex.Message);
+ Debug.WriteLine(ex.StackTrace);
+ }
+ }
+ }
+
+ public App()
+ {
+ // The root page of your application
+ MainPage = new NavigationPage(new LandingPage());
+ localytics = DependencyService.Get();
+ platform = DependencyService.Get();
+ }
+
+ protected override void OnStart()
+ {
+ platform.RegisterEvents();
+ Task.Run(() =>
+ {
+ CommonSmokeTest();
+ });
+ }
+
+ private void CommonSmokeTest()
+ {
+
+ localytics.SetOptions(new Dictionary
+ {
+ {"ll_wifi_upload_interval_seconds", 15},
+ {"ll_session_timeout_seconds", 10}
+ });
+
+ localytics.TestModeEnabled = true;
+ localytics.OpenSession();
+ localytics.CloseSession();
+ localytics.TagEvent("Event bEfore opting out");
+ localytics.PrivacyOptedOut = true;
+ localytics.PrivacyOptedOut = false;
+
+ localytics.OptedOut = true;
+ localytics.TagEvent("EventWhenOptedOut");
+ localytics.OptedOut = false;
+
+ localytics.TagEvent("TagEvent");
+ localytics.Upload();
+ localytics.TagEvent("TagEventWithEmptyAttribs", new Dictionary());
+ localytics.PauseDataUploading(true);
+ Dictionary dict = new Dictionary
+ {
+ { "attr1", "1" }
+ };
+ localytics.TagEvent("TagEventWithAttribs", dict);
+ localytics.Upload();
+ localytics.TagEvent("TagEventWithAttribsWithValue", dict, 0);
+ localytics.Upload();
+ localytics.TagEvent("TagEventWithAttribsWithValue", dict, 10);
+ localytics.PauseDataUploading(false);
+
+
+ localytics.TagPurchased("item", "id", "sample", null, null);
+ localytics.TagPurchased("item1", "1", "item", 100, new Dictionary());
+ localytics.TagAddedToCart("item1", "1", "item", 100, new Dictionary());
+ localytics.TagStartedCheckout(100, 5, new Dictionary());
+ localytics.TagCompletedCheckout(100, 5, new Dictionary());
+ localytics.TagContentViewed("name", "is", "type", new Dictionary());
+ localytics.TagSearched("query", "type", 5, new Dictionary());
+ localytics.TagShared("name", "id", "type", "method", new Dictionary());
+ localytics.TagContentRated("name", "id", "type", 1, new Dictionary());
+ Customer customer = new Customer("!234", "John", "Appleseed", "John Appleseed", "jappleseed@localytics.com");
+
+ localytics.TagCustomerRegistered(customer, "method", new Dictionary());
+
+ localytics.TagCustomerLoggedIn(customer, null, null);
+ localytics.TagInvited("invited With no attribs", null);
+ localytics.TagInvited("method", new Dictionary());
+ var dictTagInvited = new Dictionary();
+ dictTagInvited.Add("key1", "value1");
+ localytics.TagInvited("method", dictTagInvited);
+ localytics.TagCustomerLoggedOut(new Dictionary {
+ {"customerId", "1234"}
+ });
+ localytics.CloseSession();
+
+
+ localytics.CustomerId = "XamarinFormIOS CustomerId";
+ //localytics.TagCustomerLoggedIn(null, "method", new Dictionary());
+ localytics.SetProfileAttribute("Age", XFLLProfileScope.Organization, "83");
+ localytics.SetProfileAttribute("Age", XFLLProfileScope.Application, "3");
+
+ localytics.SetProfileAttribute("Ticker", XFLLProfileScope.Application, "CHAR", "LCTS");
+
+
+
+ localytics.AddProfileAttribute("Lucky numbers Set Int", XFLLProfileScope.Application, new int[] { 2221, 3331 } );
+ localytics.AddProfileAttribute("Lucky numbers Set Long", XFLLProfileScope.Application, new long[] { 2222, 3332 });
+ localytics.AddProfileAttribute("Lucky String Set", XFLLProfileScope.Application, new string[] { "2342", "3452" });
+ localytics.AddProfileAttribute("Lucky String", XFLLProfileScope.Application, "234", "345");
+ localytics.AddProfileAttribute("Lucky numbers", XFLLProfileScope.Application, 222, 333);
+ localytics.AddProfileAttribute("Lucky Strings Mixed", XFLLProfileScope.Application, "222", "333", "abc");
+ localytics.RemoveProfileAttribute("Lucky numbers", XFLLProfileScope.Application, 222);
+ localytics.SetProfileAttribute("Age", XFLLProfileScope.Application, 32);
+ localytics.IncrementProfileAttribute(1, "Age");
+ localytics.IncrementProfileAttribute(1, "Age");
+ localytics.SetProfileAttribute("Age", XFLLProfileScope.Organization, 32);
+ localytics.DecrementProfileAttribute(2, "Age", XFLLProfileScope.Organization);
+
+ // Need Data based Profile tests
+
+
+ localytics.DeleteProfileAttribute("TestDeleteProfileAttribute", XFLLProfileScope.Application);
+
+ localytics.SetCustomerEmail("XamarinFormIOSEmail@localytics.com");
+ localytics.SetCustomerFirstName("XamarinFormIOS FirstName");
+ localytics.SetCustomerLastName("XamarinFormIOS LastName");
+ localytics.SetCustomerFullName("XamarinFormIOS Full Name");
+
+ for (int i = 0; i < 20; i++)
+ {
+ localytics.SetCustomDimension("XamarinFormIOSCD" + i, (uint)i);
+ Task.Run(() =>
+ {
+ try
+ {
+ string dimensionVal = localytics.GetCustomDimension((uint)i);
+ Debug.WriteLine("Dimension " + i + ":" + dimensionVal == null ? "(null)" : dimensionVal);
+
+ }
+ catch (System.Exception ex)
+ {
+ Debug.WriteLine("Failed to get Dimension " + i + ":" + ex.Message + "\n" + ex.StackTrace);
+
+ }
+ });
+ }
+
+ localytics.SetIdentifier("test", "id1");
+ Debug.WriteLine("Identifier 1:" + localytics.GetIdentifier("id1"));
+
+ localytics.TagEvent("XamarinFormIOS Start");
+ localytics.TagScreen("XamarinFormIOS Landing");
+ localytics.TagCustomerLoggedOut(new Dictionary());
+ localytics.Upload();
+
+ localytics.SetInAppMessageDismissButtonHidden(true);
+ localytics.SetInAppMessageDismissButtonHidden(false);
+
+ localytics.TriggerInAppMessage("lang");
+ localytics.TriggerInAppMessagesForSessionStart();
+ localytics.DismissCurrentInAppMessage();
+
+ localytics.RefreshInboxCampaigns(HandleInboxCampaignsDelegate);
+ localytics.RefreshAllInboxCampaigns(HandleInboxCampaignsDelegate);
+
+ IInboxCampaign firstInboxCampaign = null;
+ localytics.LoggingEnabled = false;
+ Task.Run(() =>
+ {
+ var campaigns = localytics.DisplayableInboxCampaigns();
+ foreach (IInboxCampaign campaign in campaigns)
+ {
+ if (firstInboxCampaign == null)
+ {
+ firstInboxCampaign = campaign;
+ }
+ Debug.WriteLine("inbox campaign " + campaign);
+ }
+
+ localytics.LoggingEnabled = false;
+ localytics.InboxListItemTapped(firstInboxCampaign);
+ localytics.TagImpression(firstInboxCampaign, "custom");
+ localytics.DeleteInboxCampaign(firstInboxCampaign);
+ });
+
+ //localytics.TagImpressionForInAppCampaign(null, "custom");
+ // localytics.TagImpressionForPushToInboxCampaign(null, true);
+
+ //localytics.TagPlacesPushReceived(null);
+ //localytics.TagPlacesPushOpened(null);
+ //localytics.TagPlacesPushOpened(null, "123");
+ //localytics.TriggerPlacesNotificationForCampaign(null);
+ localytics.TriggerPlacesNotificationForCampaignId(1, "1");
+ }
+
+ protected override void OnSleep()
+ {
+ // Handle when your app sleeps
+ }
+
+ protected override void OnResume()
+ {
+ // Handle when your app resumes
+ }
+ }
+}
+
diff --git a/LocalyticsXamarin/iOS/LocalyticsSample.iOS.csproj b/LocalyticsXamarin/iOS/LocalyticsSample.iOS.csproj
index 0230994..024fa37 100644
--- a/LocalyticsXamarin/iOS/LocalyticsSample.iOS.csproj
+++ b/LocalyticsXamarin/iOS/LocalyticsSample.iOS.csproj
@@ -91,10 +91,6 @@
-
- {E291B500-93AB-423A-874D-29DB2CA50526}
- LocalyticsSample
-
{BF2D2C42-B115-4B4B-A27E-B20DD0D7E207}
LocalyticsXamarin.Common
@@ -132,9 +128,13 @@
-
- LocalyticsXamarinForms.cs
+
+
+
+ LandingPage.xaml
+
+
@@ -147,6 +147,11 @@
AdSupport
+
+
+ MSBuild:UpdateDesignTimeXaml
+
+
diff --git a/LocalyticsXamarin/iOS/LocalyticsXamarinForms.cs b/LocalyticsXamarin/iOS/LocalyticsXamarinForms.cs
new file mode 100644
index 0000000..6493348
--- /dev/null
+++ b/LocalyticsXamarin/iOS/LocalyticsXamarinForms.cs
@@ -0,0 +1,117 @@
+using System;
+using LocalyticsSample.Shared;
+using LocalyticsXamarin.Common;
+using LocalyticsXamarin.Shared;
+
+
+[assembly: Xamarin.Forms.Dependency(typeof(LocalyticsSample.Shared.LocalyticsXamarinForms))]
+namespace LocalyticsSample.Shared
+{
+ public class LocalyticsXamarinForms : LocalyticsSDK, ILocalytics, IPlatform
+ {
+ protected bool inappShouldDisplay = true;
+ protected bool placesShouldDisplay = true;
+ protected bool shouldDeepLink = true;
+
+ public void SetPlacesShouldDisplay(bool display)
+ {
+ placesShouldDisplay = display;
+ }
+
+ public void SetInAppShouldDisplay(bool display)
+ {
+ inappShouldDisplay = display;
+ }
+
+ public void SetShouldDeeplink(bool display)
+ {
+ shouldDeepLink = display;
+ }
+
+
+ public virtual bool InAppShouldShowHandler(object inAppCampaign) { return true; }
+ public virtual bool PlacesShouldDisplay(object placesCampaign) { return true; }
+
+ public bool ShouldDeepLinkHandler(string url)
+ {
+ // Console.WriteLine("XamarinEvent ShouldDeepLink Url:{0}", url);
+ return shouldDeepLink;
+ }
+
+ public virtual void RegisterEvents()
+ {
+ LocalyticsSDK.LocalyticsDidTriggerRegions += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidTriggerRegions " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidUpdateLocation += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidUpdateLocation " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidUpdateMonitoredGeofences += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidUpdateMonitoredGeofences " + e);
+ };
+
+ // Analytics Events
+ LocalyticsSDK.LocalyticsSessionDidOpen += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionDidOpenEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsDidTagEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionDidTagEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsSessionWillClose += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionWillCloseEvent: " + e);
+ };
+
+ LocalyticsSDK.LocalyticsSessionWillOpen += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent SessionWillOpenEvent: " + e);
+ };
+
+ LocalyticsSDK.InAppDidDismissEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppDidDismissEvent " + e);
+ };
+
+ LocalyticsSDK.InAppDidDisplayEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppDidDisplayEvent " + e);
+ };
+
+ LocalyticsSDK.InAppWillDismissEvent += (sender, e) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent InAppWillDismissEvent " + e);
+ };
+
+ LocalyticsSDK.InAppWillDisplayDelegate = (campaign, configuration) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsWillDisplayInAppMessage " + campaign + "," + configuration);
+ return configuration;
+ };
+
+ LocalyticsSDK.CallToActionShouldDeepLinkDelegate = (string deeplink, ICampaignBase campaign) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsCallToActionShouldDeepLinkDelegate " + deeplink + "," + campaign);
+ return true;
+ };
+
+ LocalyticsSDK.DidOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidOptOut " + optOutEventArgs);
+ };
+
+ LocalyticsSDK.DidPrivacyOptOut = (object sender, DidOptOutEventArgs optOutEventArgs) =>
+ {
+ System.Diagnostics.Debug.WriteLine("XamarinEvent LocalyticsDidPrivacyOptOut " + optOutEventArgs);
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/LocalyticsXamarin/iOS/LocalyticsXamarinFormsIOS.cs b/LocalyticsXamarin/iOS/LocalyticsXamarinFormsIOS.cs
new file mode 100644
index 0000000..4eb81e9
--- /dev/null
+++ b/LocalyticsXamarin/iOS/LocalyticsXamarinFormsIOS.cs
@@ -0,0 +1,67 @@
+using System;
+
+using UIKit;
+using LocalyticsXamarin.IOS;
+
+[assembly: Xamarin.Forms.Dependency(typeof(LocalyticsSample.Shared.LocalyticsXamarinForms))]
+namespace LocalyticsSample.Shared
+{
+ public class LocalyticsXamarinFormsIOS : LocalyticsXamarinForms
+ {
+
+ public UILocalNotification PlacesWillDisplayNotification(UILocalNotification localNotification, LLPlacesCampaign placesCampaign)
+ {
+ Console.WriteLine("XamarinEvent PlacesWillDisplayNotification {0}", placesCampaign);
+ return localNotification;
+ }
+
+
+ public UserNotifications.UNMutableNotificationContent PlacesWillDisplayNotificationContent(UserNotifications.UNMutableNotificationContent notificationContent, LLPlacesCampaign placesCampaign)
+ {
+ Console.WriteLine("XamarinEvent PlacesWillDisplayNotificationContent {0}", placesCampaign);
+ return notificationContent;
+ }
+
+ public override bool InAppShouldShowHandler(object inAppCampaign)
+ {
+ Console.WriteLine("XamarinEvent LLInAppCampaign campaign:{0}", (LLInAppCampaign) inAppCampaign);
+ return inappShouldDisplay;
+ }
+
+ public override bool PlacesShouldDisplay(object placesCampaign)
+ {
+ Console.WriteLine("XamarinEvent PlacesShouldDisplay campaign:{0}", (LLPlacesCampaign) placesCampaign);
+ return placesShouldDisplay;
+ }
+
+
+ public override void RegisterEvents()
+ {
+ base.RegisterEvents();
+
+ // LocalyticsSDK.InAppShouldShowDelegate = InAppShouldShowHandler;
+ // LocalyticsSDK.ShouldDeepLinkDelegate = ShouldDeepLinkHandler;
+
+ Localytics.PlacesWillDisplayNotification = PlacesWillDisplayNotification;
+ Localytics.PlacesWillDisplayNotificationContent = PlacesWillDisplayNotificationContent;
+ Localytics.ShouldPromptForLocationWhenInUsePermission = (LLCampaignBase campaign) => {
+ Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationWhenInUsePermission " + campaign);
+ return true;
+ };
+
+ Localytics.ShouldPromptForLocationAlwaysPermission = (LLCampaignBase campaign) => {
+ Console.WriteLine("XamarinEvent LocalyticsShouldPromptForLocationAlwaysPermission " + campaign);
+ return true;
+ };
+
+ Localytics.ShouldPromptForNotificationPermission = (LLCampaignBase campaign) => {
+ Console.WriteLine("XamarinEvent LocalyticsShouldPromptForNotificationPermission " + campaign);
+ return true;
+ };
+ Localytics.ShouldDeepLinkToSettings = (LLCampaignBase campaign) => {
+ Console.WriteLine("XamarinEvent ShouldDeepLinkToSettings " + campaign);
+ return true;
+ };
+ }
+ }
+}
\ No newline at end of file