简体   繁体   中英

In App Purchase in xamarin.forms

I'm building an app using Xamarin.forms and I'd like to implement In-App-Purchase for AppStore and Playstore.

I already have a look on Xamarin.InAppPurchase and Xamarin.Inappbilling components. But they seem do not working well, and I need a complete solution for both platforms.

Has anybody got the solution?

Using a component like InAppBilling is certainly the way to do it.

Look at this example using the plugin to see if that solves your problem.

https://forums.xamarin.com/discussion/45937/inapp-billing

In App Billing is very specific to each platform and hence you are only ever using Dependency Injection of some sort to handle each platform. Hence if no one component does it does both you need to install each component in each individual component into each project

  1. Xamarin.InAppPurchase for iOS
  2. Xamarin.InAppBilling for Android

If you want to then call them from Xamarin Forms, they need a common interface and then injected into a container (dependency injection).

If you want to know more about dependency injection do a Google search for dependency injection in Xamarin Forms and you can follow any of the top few articles there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM