From 27b710c1781af71d44efe3f62b8d4267273d1bd2 Mon Sep 17 00:00:00 2001 From: Thomas Vidas Date: Wed, 26 Aug 2020 15:52:27 -0400 Subject: [PATCH] Xamarin 6.0.3 (#53) * Removed shared dependency * Remove faulty cross-platform code. Prep for 6.2.x releases * Version bump to 6.0.3 --- .../IPlatform.cs | 0 .../LandingPage.xaml | 0 .../LandingPage.xaml.cs | 0 .../Android/LocalyticsSample.Android.csproj | 21 +- .../LocalyticsSample.cs | 0 .../Android/LocalyticsXamarinForms.cs | 117 ++++++++ .../Android/LocalyticsXamarinFormsAndroid.cs | 36 +++ .../Assets/AboutAssets.txt | 19 -- .../InboxActivity.cs | 54 ---- .../InboxDetailActivity.cs | 44 --- .../LocalyticsAutoIntegrateApplication.cs | 164 ---------- .../LocalyticsMessagingSample.Android.csproj | 176 ----------- .../MainActivity.cs | 121 -------- .../Properties/AndroidManifest.xml | 44 --- .../Properties/AssemblyInfo.cs | 28 -- .../Resources/AboutResources.txt | 44 --- .../Resources/drawable-hdpi/Icon.png | Bin 2201 -> 0 bytes .../Resources/drawable-mdpi/Icon.png | Bin 1410 -> 0 bytes .../Resources/drawable-xhdpi/Icon.png | Bin 3237 -> 0 bytes .../Resources/drawable-xxhdpi/Icon.png | Bin 5414 -> 0 bytes .../Resources/drawable-xxxhdpi/Icon.png | Bin 7825 -> 0 bytes .../Resources/layout/Inbox.axml | 6 - .../Resources/layout/InboxDetail.axml | 6 - .../Resources/layout/Main.axml | 31 -- .../Resources/values/Strings.xml | 5 - .../THIRD-PARTY-NOTICES.txt | 74 ----- .../packages.config | 22 -- .../readme.txt | 8 - .../LocalyticsSample/LocalyticsSample.csproj | 70 ----- .../Properties/AssemblyInfo.cs | 27 -- .../LocalyticsSample/packages.config | 4 - .../LocalyticsXamarin.Android.csproj | 3 +- .../Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Localytics.NuGet.nuget.props | 2 +- .../Localytics.NuGet.nuget.targets | 2 +- .../Localytics.NuGet.nuproj | 9 +- .../LocalyticsXamarin.Shared.projitems | 3 - .../LocalyticsXamarinForms.cs | 183 ----------- .../Properties/AssemblyInfo.cs | 2 +- LocalyticsXamarin/LocalyticsXamarin.sln | 54 +--- LocalyticsXamarin/iOS/IPlatform.cs | 11 + LocalyticsXamarin/iOS/LandingPage.xaml | 134 +++++++++ LocalyticsXamarin/iOS/LandingPage.xaml.cs | 284 ++++++++++++++++++ LocalyticsXamarin/iOS/LocalyticsSample.cs | 218 ++++++++++++++ .../iOS/LocalyticsSample.iOS.csproj | 17 +- .../iOS/LocalyticsXamarinForms.cs | 117 ++++++++ .../iOS/LocalyticsXamarinFormsIOS.cs | 67 +++++ 48 files changed, 1030 insertions(+), 1201 deletions(-) rename LocalyticsXamarin/{LocalyticsSample => Android}/IPlatform.cs (100%) rename LocalyticsXamarin/{LocalyticsSample => Android}/LandingPage.xaml (100%) rename LocalyticsXamarin/{LocalyticsSample => Android}/LandingPage.xaml.cs (100%) rename LocalyticsXamarin/{LocalyticsSample => Android}/LocalyticsSample.cs (100%) create mode 100644 LocalyticsXamarin/Android/LocalyticsXamarinForms.cs create mode 100644 LocalyticsXamarin/Android/LocalyticsXamarinFormsAndroid.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Assets/AboutAssets.txt delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxActivity.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/InboxDetailActivity.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsAutoIntegrateApplication.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/LocalyticsMessagingSample.Android.csproj delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/MainActivity.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Properties/AndroidManifest.xml delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Properties/AssemblyInfo.cs delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/AboutResources.txt delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/drawable-hdpi/Icon.png delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/drawable-mdpi/Icon.png delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/drawable-xhdpi/Icon.png delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/drawable-xxhdpi/Icon.png delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/drawable-xxxhdpi/Icon.png delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/layout/Inbox.axml delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/layout/InboxDetail.axml delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/layout/Main.axml delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/Resources/values/Strings.xml delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/THIRD-PARTY-NOTICES.txt delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/packages.config delete mode 100644 LocalyticsXamarin/LocalyticsMessagingSample.Android/readme.txt delete mode 100644 LocalyticsXamarin/LocalyticsSample/LocalyticsSample.csproj delete mode 100644 LocalyticsXamarin/LocalyticsSample/Properties/AssemblyInfo.cs delete mode 100644 LocalyticsXamarin/LocalyticsSample/packages.config delete mode 100644 LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsXamarinForms.cs create mode 100644 LocalyticsXamarin/iOS/IPlatform.cs create mode 100644 LocalyticsXamarin/iOS/LandingPage.xaml create mode 100644 LocalyticsXamarin/iOS/LandingPage.xaml.cs create mode 100644 LocalyticsXamarin/iOS/LocalyticsSample.cs create mode 100644 LocalyticsXamarin/iOS/LocalyticsXamarinForms.cs create mode 100644 LocalyticsXamarin/iOS/LocalyticsXamarinFormsIOS.cs 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