Skip to content

Commit

Permalink
Merge pull request #436 from jamesmontemagno/dotnet6
Browse files Browse the repository at this point in the history
Prepare for .NET 6
  • Loading branch information
jamesmontemagno committed Jan 14, 2022
2 parents d76373a + 8370343 commit cfc43ec
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 367 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,6 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/
src/Plugin.InAppBilling/.DS_Store
src/.DS_Store
.DS_Store
4 changes: 2 additions & 2 deletions nuget/readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
In App Billing Plugin for Xamarin & Windows
In App Billing Plugin for .NET MAUI, Xamarin, & Windows

Version 5.0 has more significant updates!
Version 5.0+ has more significant updates!
1.) We have removed IInAppBillingVerifyPurchase from all methods. All data required to handle this yourself is returned.
2.) iOS ReceiptURL data is avaialble via ReceiptData
3.) We are now using Android Billing version 4
Expand Down
285 changes: 3 additions & 282 deletions src/InAppBilling.sln

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/Plugin.InAppBilling/InAppBilling.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
using System.Text;
using Android.BillingClient.Api;
using Android.Content;
#if NET6ANDROID
using Microsoft.Maui.Essentials;
#else
using Xamarin.Essentials;
#endif

namespace Plugin.InAppBilling
{
Expand All @@ -29,7 +34,7 @@ public class InAppBillingImplementation : BaseInAppBilling
/// </summary>
/// <value>The context.</value>
Activity Activity =>
Xamarin.Essentials.Platform.CurrentActivity ?? throw new NullReferenceException("Current Activity is null, ensure that the MainActivity.cs file is configuring Xamarin.Essentials in your source code so the In App Billing can use it.");
Platform.CurrentActivity ?? throw new NullReferenceException("Current Activity is null, ensure that the MainActivity.cs file is configuring Xamarin.Essentials in your source code so the In App Billing can use it.");

Context Context => Android.App.Application.Context;

Expand Down
97 changes: 97 additions & 0 deletions src/Plugin.InAppBilling/Plugin.InAppBilling.Classic.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;MonoAndroid10.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.16299;</TargetFrameworks>
<AssemblyName>Plugin.InAppBilling</AssemblyName>
<RootNamespace>Plugin.InAppBilling</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<LangVersion>9.0</LangVersion>
<Authors>James Montemagno</Authors>
<PackageId>Plugin.InAppBilling</PackageId>
<PackOnBuild>true</PackOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://raw.githubusercontent.com/jamesmontemagno/InAppBillingPlugin/master/art/icon_128.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/jamesmontemagno/InAppBillingPlugin/blob/master/LICENSE</PackageLicenseUrl>
<Owners>JamesMontemagno</Owners>
<PackageProjectUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</PackageProjectUrl>
<Summary>Xamarin and Windows plugin to In-App Billing.</Summary>
<PackageTags>xamarin, xamarin.forms, android, ios, uwp, windows phone, In-App Billing, purchases, plugin</PackageTags>
<Title>In-App Billing Plugin for Xamarin and Windows</Title>
<Description>
Xamarin and Windows Plugin to In-App Billing. Get item information, purchase items, and restore purchases with a cross-platform API.
Read the full documenation on the projects page.
</Description>
<Copyright>Copyright 2022</Copyright>
<RepositoryUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</RepositoryUrl>
<PackageReleaseNotes>See: https://github.com/jamesmontemagno/InAppBillingPlugin </PackageReleaseNotes>

<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget\readme.txt" PackagePath="readme.txt" Pack="true" />
<Compile Include="**\*.shared.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<Compile Include="**\*.netstandard.cs" />
</ItemGroup>


<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Include="**\*.uwp.cs" />
</ItemGroup>

<!--<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')">
<ItemGroup>
<Compile Remove="$(AndroidResgenFile)" />
</ItemGroup>
</Target>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>-->

<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="**\*.android.cs" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="4.0.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>


<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.TVOS')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>
</Project>
208 changes: 127 additions & 81 deletions src/Plugin.InAppBilling/Plugin.InAppBilling.csproj
Original file line number Diff line number Diff line change
@@ -1,97 +1,143 @@
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;MonoAndroid10.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.16299;</TargetFrameworks>
<AssemblyName>Plugin.InAppBilling</AssemblyName>
<RootNamespace>Plugin.InAppBilling</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<Version>1.0.0.0</Version>
<Project Sdk="MSBuild.Sdk.Extras/3.0.44">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;MonoAndroid10.0;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);uap10.0.19041;net6.0-windows10.0.19041;</TargetFrameworks>
<AssemblyName>Plugin.InAppBilling</AssemblyName>
<RootNamespace>Plugin.InAppBilling</RootNamespace>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyFileVersion>6.0.0.0</AssemblyFileVersion>
<Version>6.0.0.0</Version>
<LangVersion>9.0</LangVersion>
<Authors>James Montemagno</Authors>
<PackageId>Plugin.InAppBilling</PackageId>
<PackOnBuild>true</PackOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://raw.githubusercontent.com/jamesmontemagno/InAppBillingPlugin/master/art/icon_128.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/jamesmontemagno/InAppBillingPlugin/blob/master/LICENSE</PackageLicenseUrl>
<Owners>JamesMontemagno</Owners>
<PackageProjectUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</PackageProjectUrl>
<Summary>Xamarin and Windows plugin to In-App Billing.</Summary>
<PackageTags>xamarin, xamarin.forms, android, ios, uwp, windows phone, In-App Billing, purchases, plugin</PackageTags>
<Title>In-App Billing Plugin for Xamarin and Windows</Title>
<Description>
Xamarin and Windows Plugin to In-App Billing. Get item information, purchase items, and restore purchases with a cross-platform API.
Read the full documenation on the projects page.
</Description>
<Copyright>Copyright 2019</Copyright>
<RepositoryUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</RepositoryUrl>
<PackageReleaseNotes>See: https://github.com/jamesmontemagno/InAppBillingPlugin </PackageReleaseNotes>

<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<Authors>James Montemagno</Authors>
<PackageId>Plugin.InAppBilling</PackageId>
<PackOnBuild>true</PackOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://raw.githubusercontent.com/jamesmontemagno/InAppBillingPlugin/master/art/icon_128.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/jamesmontemagno/InAppBillingPlugin/blob/master/LICENSE</PackageLicenseUrl>
<Owners>JamesMontemagno</Owners>
<PackageProjectUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</PackageProjectUrl>
<Summary>Xamarin, .NET MAUI, and Windows plugin to In-App Billing.</Summary>
<PackageTags>xamarin, xamarin.forms, android, ios, uwp, windows phone, In-App Billing, purchases, plugin</PackageTags>
<Title>In-App Billing Plugin for .NET MAUI, Xamarin, and Windows</Title>
<Description>
.NET MAUI, Xamarin, and Windows Plugin to In-App Billing. Get item information, purchase items, and restore purchases with a cross-platform API.
Read the full documenation on the projects page.
</Description>
<Copyright>Copyright 2022</Copyright>
<RepositoryUrl>https://github.com/jamesmontemagno/InAppBillingPlugin</RepositoryUrl>
<PackageReleaseNotes>See: https://github.com/jamesmontemagno/InAppBillingPlugin </PackageReleaseNotes>

<NeutralLanguage>en</NeutralLanguage>
<LangVersion>default</LangVersion>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DefineConstants>$(DefineConstants);</DefineConstants>
</PropertyGroup>

<!-- platform version number information -->
<PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-tvos'))">
<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst'))">
<SupportedOSPlatformVersion>13.1</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-macos'))">
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-android'))">
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows10'))">
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' ">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\nuget\readme.txt" PackagePath="readme.txt" Pack="true" />
<Compile Include="**\*.shared.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<Compile Include="**\*.netstandard.cs" />
</ItemGroup>


<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Include="**\*.uwp.cs" />
</ItemGroup>

<!--<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')">

<ItemGroup>
<None Include="..\..\nuget\readme.txt" PackagePath="readme.txt" Pack="true" />
<Compile Include="**\*.shared.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<Compile Include="**\*.netstandard.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>


<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Include="**\*.uwp.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.Contains('-windows')) ">
<Compile Include="**\*.uwp.cs" />
</ItemGroup>

<!--<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')">
<ItemGroup>
<Compile Remove="$(AndroidResgenFile)" />
</ItemGroup>
</Target>
</Target>-->

<PropertyGroup Condition=" $(TargetFramework.Contains('-android')) ">
<UseMauiEssentials>true</UseMauiEssentials>
<DefineConstants>$(DefineConstants);NET6ANDROID</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>-->
<ItemGroup Condition=" $(TargetFramework.Contains('-android')) ">
<Compile Include="**\*.android.cs" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="4.0.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('MonoAndroid')) ">
<Compile Include="**\*.android.cs" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<Compile Include="**\*.android.cs" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="4.0.0" />
</ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="**\*.apple.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.Contains('-ios')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.TVOS')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.TVOS')) ">
<Compile Include="**\*.apple.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.Mac')) ">
<Compile Include="**\*.apple.cs" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>


<ItemGroup Condition=" $(TargetFramework.Contains('-mac')) ">
<Compile Include="**\*.apple.cs" />
</ItemGroup>
</Project>

0 comments on commit cfc43ec

Please sign in to comment.