Xamarin In App Billing Plugin could not connect
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.
android xamarin in-app-purchase in-app-billing
|
show 4 more comments
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.
android xamarin in-app-purchase in-app-billing
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10
|
show 4 more comments
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.
android xamarin in-app-purchase in-app-billing
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.
android xamarin in-app-purchase in-app-billing
android xamarin in-app-purchase in-app-billing
asked Nov 15 '18 at 7:45
Jen143Jen143
198322
198322
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10
|
show 4 more comments
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314588%2fxamarin-in-app-billing-plugin-could-not-connect%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314588%2fxamarin-in-app-billing-plugin-could-not-connect%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Yes. I can browse apps in Play Store in the emulator through the browser. It doesn't have "Play Store" installed. And it has internet access
– Jen143
Nov 15 '18 at 7:56
do you have an idea how to install google play store in the emulator? I have used Emulator in VS 2017 for android
– Jen143
Nov 15 '18 at 8:21
I have now installed the google play store and still could not connect.
– Jen143
Nov 15 '18 at 12:44
Try your code on a physical device to confirm whether your emulator is configured properly or it is the code at this point.
– SushiHangover
Nov 15 '18 at 14:04
Have you tried testing in emulator before? I checked it here: jamesmontemagno.github.io/InAppBillingPlugin/… but it said emulator will not work
– Jen143
Nov 16 '18 at 1:10