Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 2a664ae

Browse files
Merge 4adc9d3 into a561db9
2 parents a561db9 + 4adc9d3 commit 2a664ae

File tree

7 files changed

+68
-17
lines changed

7 files changed

+68
-17
lines changed

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.400",
4+
"rollForward": "latestFeature",
5+
"allowPrerelease": true
6+
}
7+
}

src/ClassLibraryTest/Class1.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace ClassLibraryTest;
2+
3+
public class Class1
4+
{
5+
public void Test()
6+
{
7+
}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\Plugin.InAppBilling\Plugin.InAppBilling.csproj" />
11+
</ItemGroup>
12+
13+
</Project>

src/InAppBilling.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5124C265
3131
EndProject
3232
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InAppBillingMauiTest", "InAppBillingTests\InAppBillingMauiTest\InAppBillingMauiTest.csproj", "{BAE4393A-4E17-4E60-BF53-E916505F44E1}"
3333
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibraryTest", "ClassLibraryTest\ClassLibraryTest.csproj", "{766E2D00-352E-455F-9717-3F9864F3247A}"
35+
EndProject
3436
Global
3537
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3638
Debug|Any CPU = Debug|Any CPU
@@ -47,12 +49,17 @@ Global
4749
{BAE4393A-4E17-4E60-BF53-E916505F44E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
4850
{BAE4393A-4E17-4E60-BF53-E916505F44E1}.Release|Any CPU.Build.0 = Release|Any CPU
4951
{BAE4393A-4E17-4E60-BF53-E916505F44E1}.Release|Any CPU.Deploy.0 = Release|Any CPU
52+
{766E2D00-352E-455F-9717-3F9864F3247A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53+
{766E2D00-352E-455F-9717-3F9864F3247A}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{766E2D00-352E-455F-9717-3F9864F3247A}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{766E2D00-352E-455F-9717-3F9864F3247A}.Release|Any CPU.Build.0 = Release|Any CPU
5056
EndGlobalSection
5157
GlobalSection(SolutionProperties) = preSolution
5258
HideSolutionNode = FALSE
5359
EndGlobalSection
5460
GlobalSection(NestedProjects) = preSolution
5561
{BAE4393A-4E17-4E60-BF53-E916505F44E1} = {5124C265-C6EF-4415-9497-0EF227E43095}
62+
{766E2D00-352E-455F-9717-3F9864F3247A} = {5124C265-C6EF-4415-9497-0EF227E43095}
5663
EndGlobalSection
5764
GlobalSection(ExtensibilityGlobals) = postSolution
5865
SolutionGuid = {42D18242-8BA9-4238-9D59-10850E1C2C24}

src/Plugin.InAppBilling/InAppBilling.android.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ public override Task<bool> ConnectAsync(bool enablePendingPurchases = true, Canc
7878
BillingClientBuilder = NewBuilder(Context);
7979
BillingClientBuilder.SetListener(OnPurchasesUpdated);
8080
if (enablePendingPurchases)
81-
BillingClient = BillingClientBuilder.EnablePendingPurchases().Build();
81+
{
82+
var pendingParams = PendingPurchasesParams.NewBuilder().EnablePrepaidPlans().Build();
83+
BillingClient = BillingClientBuilder.EnablePendingPurchases(pendingParams).Build();
84+
}
8285
else
8386
BillingClient = BillingClientBuilder.Build();
8487

@@ -133,7 +136,6 @@ public override Task DisconnectAsync(CancellationToken cancellationToken)
133136
return Task.CompletedTask;
134137
}
135138

136-
137139
/// <summary>
138140
/// Gets or sets if in testing mode. Only for UWP
139141
/// </summary>
@@ -483,6 +485,7 @@ static bool ParseBillingResult(BillingResult result, bool ignoreInvalidProducts
483485
return result.ResponseCode switch
484486
{
485487
BillingResponseCode.Ok => true,
488+
BillingResponseCode.NetworkError => throw new InAppBillingPurchaseException(PurchaseError.NetworkError),
486489
BillingResponseCode.UserCancelled => throw new InAppBillingPurchaseException(PurchaseError.UserCancelled),//User Cancelled, should try again
487490
BillingResponseCode.ServiceUnavailable => throw new InAppBillingPurchaseException(PurchaseError.ServiceUnavailable),//Network connection is down
488491
BillingResponseCode.ServiceDisconnected => throw new InAppBillingPurchaseException(PurchaseError.ServiceDisconnected),//Network connection is down

src/Plugin.InAppBilling/Plugin.InAppBilling.csproj

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<AssemblyName>Plugin.InAppBilling</AssemblyName>
1010
<RootNamespace>Plugin.InAppBilling</RootNamespace>
1111
<Product>$(AssemblyName) ($(TargetFramework))</Product>
12-
<AssemblyVersion>7.0.0.0</AssemblyVersion>
13-
<AssemblyFileVersion>7.0.0.0</AssemblyFileVersion>
14-
<Version>7.0.0.0</Version>
12+
<AssemblyVersion>9.0.0.0</AssemblyVersion>
13+
<AssemblyFileVersion>9.0.0.0</AssemblyFileVersion>
14+
<Version>9.0.0.0</Version>
1515
<Authors>James Montemagno</Authors>
1616
<IsPackable>True</IsPackable>
1717
<PackageId>Plugin.InAppBilling</PackageId>
@@ -95,45 +95,57 @@
9595

9696
<ItemGroup Condition=" $(TargetFramework.Contains('-android')) ">
9797
<PackageReference Include="Microsoft.Maui.Essentials" Version="$(MauiVersion)" />
98-
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="6.2.1" />
98+
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="7.1.1" />
9999
<PackageReference Include="Xamarin.AndroidX.Activity">
100-
<Version>1.9.0.4</Version>
100+
<Version>1.9.2.1</Version>
101101
</PackageReference>
102102
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx">
103-
<Version>1.9.0.4</Version>
103+
<Version>1.9.2.1</Version>
104104
</PackageReference>
105105
<PackageReference Include="Xamarin.AndroidX.Collection">
106-
<Version>1.4.0.6</Version>
106+
<Version>1.4.4</Version>
107107
</PackageReference>
108108
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx">
109-
<Version>1.4.0.5</Version>
109+
<Version>1.4.4</Version>
110110
</PackageReference>
111111
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData">
112-
<Version>2.8.3.1</Version>
112+
<Version>2.8.6</Version>
113+
</PackageReference>
114+
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Ktx">
115+
<Version>2.8.6</Version>
113116
</PackageReference>
114117
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Ktx">
115118
<Version>2.8.3.1</Version>
116119
</PackageReference>
117120
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core">
118-
<Version>2.8.3.1</Version>
121+
<Version>2.8.6</Version>
122+
</PackageReference>
123+
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx">
124+
<Version>2.8.6</Version>
119125
</PackageReference>
120126
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx">
121127
<Version>2.8.3.1</Version>
122128
</PackageReference>
123129
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime">
124-
<Version>2.8.3.1</Version>
130+
<Version>2.8.6</Version>
131+
</PackageReference>
132+
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime.Ktx">
133+
<Version>2.8.6</Version>
125134
</PackageReference>
126135
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime.Ktx">
127136
<Version>2.8.3.1</Version>
128137
</PackageReference>
129138
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel">
130-
<Version>2.8.3.1</Version>
139+
<Version>2.8.6</Version>
140+
</PackageReference>
141+
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel.Ktx">
142+
<Version>2.8.6</Version>
131143
</PackageReference>
132144
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel.Ktx">
133145
<Version>2.8.3.1</Version>
134146
</PackageReference>
135147
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModelSavedState">
136-
<Version>2.8.3.1</Version>
148+
<Version>2.8.6</Version>
137149
</PackageReference>
138150
</ItemGroup>
139151

src/Plugin.InAppBilling/Shared/InAppBillingExceptions.shared.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ public enum PurchaseError
7070
FeatureNotSupported,
7171
ServiceDisconnected,
7272
ServiceTimeout,
73-
AppleTermsConditionsChanged
74-
}
73+
AppleTermsConditionsChanged,
74+
NetworkError
75+
}
7576

7677
/// <summary>
7778
/// Purchase exception

0 commit comments

Comments
 (0)