Skip to content

Commit

Permalink
Xamarin 6.0.3 (#53)
Browse files Browse the repository at this point in the history
* Removed shared dependency
* Remove faulty cross-platform code. Prep for 6.2.x releases
* Version bump to 6.0.3
  • Loading branch information
thomasvidas authored Aug 26, 2020
1 parent da1fffc commit 27b710c
Show file tree
Hide file tree
Showing 48 changed files with 1,030 additions and 1,201 deletions.
File renamed without changes.
File renamed without changes.
21 changes: 13 additions & 8 deletions LocalyticsXamarin/Android/LocalyticsSample.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidApplication>True</AndroidApplication>
<AssemblyName>LocalyticsSample.Android</AssemblyName>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<AndroidTlsProvider></AndroidTlsProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -154,10 +154,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LocalyticsSample\LocalyticsSample.csproj">
<Project>{E291B500-93AB-423A-874D-29DB2CA50526}</Project>
<Name>LocalyticsSample</Name>
</ProjectReference>
<ProjectReference Include="..\LocalyticsXamarin.Common\LocalyticsXamarin.Common.csproj">
<Project>{BF2D2C42-B115-4B4B-A27E-B20DD0D7E207}</Project>
<Name>LocalyticsXamarin.Common</Name>
Expand All @@ -172,11 +168,15 @@
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LocalyticsAutoIntegrateApplication.cs" />
<Compile Include="..\LocalyticsXamarin.Shared\LocalyticsXamarinForms.cs">
<Link>LocalyticsXamarinForms.cs</Link>
</Compile>
<Compile Include="RegistrationIntentService.cs" />
<Compile Include="InstanceIdListenerService.cs" />
<Compile Include="LocalyticsXamarinFormsAndroid.cs" />
<Compile Include="IPlatform.cs" />
<Compile Include="LandingPage.xaml.cs">
<DependentUpon>LandingPage.xaml</DependentUpon>
</Compile>
<Compile Include="LocalyticsSample.cs" />
<Compile Include="LocalyticsXamarinForms.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
Expand All @@ -198,6 +198,11 @@
<ItemGroup>
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LandingPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Build.Download.0.4.11\build\Xamarin.Build.Download.targets" Condition="Exists('..\packages\Xamarin.Build.Download.0.4.11\build\Xamarin.Build.Download.targets')" />
<Import Project="..\packages\Xamarin.GooglePlayServices.Basement.60.1142.1\build\MonoAndroid80\Xamarin.GooglePlayServices.Basement.targets" Condition="Exists('..\packages\Xamarin.GooglePlayServices.Basement.60.1142.1\build\MonoAndroid80\Xamarin.GooglePlayServices.Basement.targets')" />
Expand Down
117 changes: 117 additions & 0 deletions LocalyticsXamarin/Android/LocalyticsXamarinForms.cs
Original file line number Diff line number Diff line change
@@ -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);
};
}
}
}
36 changes: 36 additions & 0 deletions LocalyticsXamarin/Android/LocalyticsXamarinFormsAndroid.cs
Original file line number Diff line number Diff line change
@@ -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;
};
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 27b710c

Please sign in to comment.