Open tecomunico opened 4 days ago
Hello, I think I can confirm the bug. In my opinion the error lies with the InAppBillingImplementation class. The class is not implemented in IOS. Here is code to check it:
`
var inAppBillingImplementation = new InAppBillingImplementation(); // works
var inAppBillingImplementation = new InAppBillingImplementation(); // works
var inAppBillingImplementation = new InAppBillingImplementation(); // error: The type or namespace name 'InAppBillingImplementation' could not be found
`
If you write ios in lower case, it finds the class. Maybe an incorrect configuration in the InAppBilling.csproj for the *.apple.cs files. It worked with version 7.1.3.
Bug Information
Steps to reproduce the Behavior
Expected Behavior
The app should connect to the App Store, initiate the purchase, and handle any errors or completion events as expected.
Actual Behavior
The app throws a System.NotImplementedException with the message: "This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."
Code snippet
private async void OnSubscribeClicked(object sender, EventArgs e) { LogToFile("OnSubscribeClicked - User initiated subscription process.");
}
Error Message
Here is the error message displayed in the output:
System.NotImplementedException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation. at Plugin.InAppBilling.CrossInAppBilling.get_Current() at JabezTime.Views.SubscriptionPage.OnSubscribeClicked(Object sender, EventArgs e) in /Users/edgargarcia/Projects/Jabez Time/Jabez Time/Views/SubscriptionPage.xaml.cs:21 at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:176
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:58
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:94
at JabezTime.Program.Main(String[] args) in /Users/edgargarcia/Projects/Jabez Time/Jabez Time/Platforms/iOS/Program.cs:13
Screenshots
Additional Notes
To help trace the issue, I implemented a logging mechanism that writes to a log.txt file to track the execution flow within the app. Despite this, I have been unable to pinpoint the exact source of the error. I’ve tested the app on physical devices in both Debug and Release modes, utilizing all available debugging tools in Visual Studio for Mac and Xcode. However, the error persists without providing a clear trace to diagnose the cause.
I would appreciate any further guidance on resolving this issue, as I’ve followed the configuration steps outlined in the documentation and have double-checked that the plugin is correctly installed and referenced.