From caae96ad0a89963463b29028d781c9afe9d6d0e4 Mon Sep 17 00:00:00 2001 From: Thomas Vidas Date: Mon, 15 Jul 2019 12:43:49 -0400 Subject: [PATCH] Fixed local auth token being funky: --- LocalyticsXamarin/Android/MainActivity.cs | 1 + .../LocalyticsSample/LandingPage.xaml.cs | 2 +- .../Additions/Localytics.cs | 5 ----- .../Transforms/Metadata.xml | 2 +- .../LocalyticsXamarin.Common/ILocalytics.cs | 5 +++++ .../LocalyticsXamarin.Shared/LocalyticsSDK.cs | 13 +++++++++++-- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/LocalyticsXamarin/Android/MainActivity.cs b/LocalyticsXamarin/Android/MainActivity.cs index 12e11e3..5246aba 100644 --- a/LocalyticsXamarin/Android/MainActivity.cs +++ b/LocalyticsXamarin/Android/MainActivity.cs @@ -28,6 +28,7 @@ protected override void OnCreate(Bundle bundle) global::Xamarin.Forms.Forms.Init(this, bundle); // Sample Code for Docs. + LocalyticsSDK localytics = LocalyticsSDK.SharedInstance; localytics.SetOption("ll_session_timeout_seconds", 10); localytics.CustomerId = "Sample Customer"; diff --git a/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs b/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs index bf91ce0..e73cfce 100644 --- a/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs +++ b/LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs @@ -206,7 +206,7 @@ void RefreshInfo() string value1 = "CustomerId: " + localytics.CustomerId; string value2 = "InstallId: " + localytics.InstallId; string value3 = "LibraryVersion: " + localytics.LibraryVersion; - string value4 = ""; + string value4 = "LocalAuthenticationToken: " + localytics.LocalAuthenticationToken; string value5 = ""; string value6 = "Push Token/RegID: " + localytics.PushTokenInfo; string value7 = ""; diff --git a/LocalyticsXamarin/LocalyticsXamarin.Android/Additions/Localytics.cs b/LocalyticsXamarin/LocalyticsXamarin.Android/Additions/Localytics.cs index ee74046..a4a25a8 100644 --- a/LocalyticsXamarin/LocalyticsXamarin.Android/Additions/Localytics.cs +++ b/LocalyticsXamarin/LocalyticsXamarin.Android/Additions/Localytics.cs @@ -46,11 +46,6 @@ internal static Localytics SharedInstance() public static Func WillShowPlacesPushNotification; public static Func WillShowPushNotification; - public string getLocalAuthenticationToken() - { - Localytics.getLocalAuthenticationToken(); - } - [global::Android.Runtime.Register("mono/com/localytics/android/MessagingListenerV2Implementor")] internal sealed partial class IMessagingListenerV2Implementor : global::Java.Lang.Object, IMessagingListenerV2 { diff --git a/LocalyticsXamarin/LocalyticsXamarin.Android/Transforms/Metadata.xml b/LocalyticsXamarin/LocalyticsXamarin.Android/Transforms/Metadata.xml index 5470927..6ab9c7a 100644 --- a/LocalyticsXamarin/LocalyticsXamarin.Android/Transforms/Metadata.xml +++ b/LocalyticsXamarin/LocalyticsXamarin.Android/Transforms/Metadata.xml @@ -69,7 +69,7 @@ internal internal internal - internal + internal internal internal diff --git a/LocalyticsXamarin/LocalyticsXamarin.Common/ILocalytics.cs b/LocalyticsXamarin/LocalyticsXamarin.Common/ILocalytics.cs index 2d83748..5517ee5 100644 --- a/LocalyticsXamarin/LocalyticsXamarin.Common/ILocalytics.cs +++ b/LocalyticsXamarin/LocalyticsXamarin.Common/ILocalytics.cs @@ -462,6 +462,11 @@ public interface ILocalytics /// The library version. string LibraryVersion { get; } /// + /// Gets the local authentication token from the Localytics SDK. + /// + /// The local authentication token. + string LocalAuthenticationToken { get; } + /// /// Gets the app key. /// /// The app key. diff --git a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsSDK.cs b/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsSDK.cs index 5a4cf6b..f8d9377 100644 --- a/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsSDK.cs +++ b/LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsSDK.cs @@ -411,6 +411,15 @@ public string LibraryVersion get => Localytics.LibraryVersion; } + public string LocalAuthenticationToken + { +#if __IOS__ + get => ""; +#else + get => Localytics.LocalAuthenticationToken; +#endif + } + public string AppKey { get => Localytics.AppKey; @@ -944,7 +953,7 @@ public void DeleteProfileAttribute(string attribute, XFLLProfileScope scope = XF #endif } - #region Platform specific code +#region Platform specific code #if __IOS__ public void AddProfileAttributes(string attribute, LLProfileScope scope, params NSDate[] values) { @@ -957,6 +966,6 @@ public void AddDateProfileAttributes(string attribute, LLProfileScope scope, par } #endif - #endregion +#endregion } }