Skip to content

Commit

Permalink
Fixed local auth token being funky:
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Vidas committed Jul 15, 2019
1 parent c1f927e commit caae96a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions LocalyticsXamarin/Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion LocalyticsXamarin/LocalyticsSample/LandingPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ internal static Localytics SharedInstance()
public static Func<NotificationCompat.Builder, NativePlacesCampaign, NotificationCompat.Builder> WillShowPlacesPushNotification;
public static Func<NotificationCompat.Builder, NativePushCampaign, NotificationCompat.Builder> 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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='setCallToActionListener']" name="visibility">internal</attr>
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='setCustomerId']" name="visibility">internal</attr>
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='getCustomerId']" name="visibility">internal</attr>
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='getLocalAuthenticationToken']" name="visibility">internal</attr>
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='getLocalAuthenticationToken']" name="visibility">internal</attr>

<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='setCustomerEmail']" name="visibility">internal</attr>
<attr path="/api/package[@name='com.localytics.android']/class[@name='Localytics']/method[@name='setCustomerFirstName']" name="visibility">internal</attr>
Expand Down
5 changes: 5 additions & 0 deletions LocalyticsXamarin/LocalyticsXamarin.Common/ILocalytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ public interface ILocalytics
/// <value>The library version.</value>
string LibraryVersion { get; }
/// <summary>
/// Gets the local authentication token from the Localytics SDK.
/// </summary>
/// <value>The local authentication token.</value>
string LocalAuthenticationToken { get; }
/// <summary>
/// Gets the app key.
/// </summary>
/// <value>The app key.</value>
Expand Down
13 changes: 11 additions & 2 deletions LocalyticsXamarin/LocalyticsXamarin.Shared/LocalyticsSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand All @@ -957,6 +966,6 @@ public void AddDateProfileAttributes(string attribute, LLProfileScope scope, par
}

#endif
#endregion
#endregion
}
}

0 comments on commit caae96a

Please sign in to comment.