Reputation: 835
I have used this plugin: https://github.com/jamesmontemagno/InAppBillingPlugin to implement the in app billing since the component was removed. I have installed the nuget: Plugin.InAppBilling
In the Android, I have create a class called InAppBillingService where I implement here to get the products and purchase an item. Here are the codes:
var billing = CrossInAppBilling.Current;
var connected = await billing.ConnectAsync();
And it returns false everytime. I could not connect.
I have added in my AndroidManifest this:
uses-permission android:name="com.android.vending.BILLING" />
And in the MainActivity:
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
InAppBillingImplementation.HandleActivityResult(requestCode, resultCode, data);
}
And in onCreate: CrossCurrentActivity.Current.Init(this, bundle);
Please advice what else I should do so that I could connect. And what are other reasons why it always return false when tried to connect. I'm testing in emulator. Thank you.
Upvotes: 3
Views: 683