Giter VIP home page Giter VIP logo

androidinapppurchase's People

Contributors

orthographic-pedant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidinapppurchase's Issues

get purchased product

How do I retrieve what product was purchased from the onPurchaseSuccess function?

_iap.addEventListener(InAppPurchaseEvent.PURCHASE_SUCCESS, onPurchaseSuccess);
_iap.purchase("my.product.id", InAppPurchase.TYPE_INAPP);

function onPurchaseError(event:InAppPurchaseEvent):void
{
trace(); //trace the product id
}

thanks.

No events fired after purchase.

I init an InAppPurchase instance, all is ok. When I try to buy game currency on device, I see PlayMarket window, press buy. Get "Payment successful" message, after that PlayMarket activity closes but no event listeners called. Here's my code

            public static function makePurchase(product_id:String, onSuccess:Function, onError:Function):void
    {
        if (!initialized)
            return;
        Cc.log("make purchase " + product_id);
        onPurchaseSuccess = onSuccess;
        onPurchaseError = onError;
        iap.addEventListener(InAppPurchaseEvent.PURCHASE_SUCCESS, onPurchaseSuccessHandler);
        iap.addEventListener(InAppPurchaseEvent.PURCHASE_ERROR, onPurchaseErrorHandler);
        iap.addEventListener(InAppPurchaseEvent.PURCHASE_ALREADY_OWNED, onPurchaseSuccessOwned);
        iap.purchase(product_id, InAppPurchaseDetails.TYPE_INAPP);
    }

            private static function onPurchaseSuccessOwned(event:InAppPurchaseEvent):void
    {
        Cc.log("onPurchaseSuccessOwned " + event.data);
    }

        private static function onPurchaseErrorHandler(event:InAppPurchaseEvent):void
    {
        Cc.log("onPurchaseErrorHandler " + event.data);
        if (onPurchaseError != null)
            onPurchaseError(event.data);
        iap.removeEventListener(InAppPurchaseEvent.PURCHASE_SUCCESS, onPurchaseSuccessHandler);
        iap.removeEventListener(InAppPurchaseEvent.PURCHASE_ERROR, onPurchaseErrorHandler);
        onPurchaseError = null;
        onPurchaseSuccess = null;
    }

    private static function onPurchaseSuccessHandler(event:InAppPurchaseEvent):void
    {
        Cc.log("onPurchaseSuccessHandler " + event.data);
        if (onPurchaseSuccess != null)
            onPurchaseSuccess(event.data);
                    iap.removeEventListener(InAppPurchaseEvent.PURCHASE_SUCCESS, onPurchaseSuccessHandler);
        iap.removeEventListener(InAppPurchaseEvent.PURCHASE_ERROR, onPurchaseErrorHandler);
        onPurchaseError = null;
        onPurchaseSuccess = null;
    }

I see "make purchase" text in console and after purchasing no new messages are shown.

UPD. I dunno what a hell I've done, but now it works 0_o. Thanks to Pozirk.

Restore call does nothing

Hello,
When I call _iap.restore(); absolutely nothing happens.
I'm calling it when InAppPurchaseEvent.INIT_SUCCESS is fired.
InAppPurchaseEvent.RESTORE_SUCCESS is not called and also InAppPurchaseEvent.RESTORE_ERROR is not called.
But when I do call _iap.purchase(..) it shows the purchase window which has error "The item you were attempting to purchase could not be found" although I activeted the products.
Help me please

Small typo in the readme

In the readme.md, in the examples part there is a small typo where an Array is defined with generic type:

var items:Array<String> = ["my.product.id1", "my.product.id2", "my.product.id3"];
var subs:Array<String> = ["my.subs.id1", "my.subs.id2", "my.subs.id3"];

Type definition should be removed.

Crash : Launching app from app drawer while in app purchase popup is displayed

Hi,

We've noticed the app crashes if the app is put in the background when an in app purchase popup is displayed and is opened again from the app drawer. The app will show but the popup will be close and touching the screen will trigger a system popup saying the app has stopped.

This does not happen if the app is resumed through the Recent Apps screen.

initiation problem

Hello,

I'm trying to use this extension but no initiation event is dispatched.

I added the xml code,added the ane and swc to my library, added the event listeners before the init call, but the init handler isn't called.

Am I missing something?

I tried this with air 3.8.

isSupported()?

Is there any way to check if this ane isSupported so i can complie it for web without removing the the code for googleplay stuff.

Best regards Hampus

dear Programer writer

i had trouble with your code for 1 day and i think i need your help, i want to recompile the ane file but i can‘t find the libInAppPurchase.jar from the download zip file because i want to use the 3.1 air sdk. my email is [email protected] and my dear author , shell you send whole file with libInAppPurchase.jar to me so i recompile the ane or upload the whole. thanks a lot

getPurchaseDetails returning NULL

Attempting to debug this myself but I felt it would be worth letting people know that this doesn't seem to be working anymore.

Making a purchase and then requesting the purchase details from the data in the event results in null.

in app purchase with test

I have tried to make purchase with test id and it shows Signature verification failed for sku android.test.purchased (response: -1003:Purchase signature verification failed
and it dont call success method . Can you please guide me how to check if everything is fine.

How to get list of purchasable products?

Thanks for making this. Trying to integrate it with my game now. How can I get a list of available products?

Would really be helpful to get a sample app in the docs! Basically one that gets available products and their details (if it's already been purchased, title, description, price, etc)

Item you are attempting to purchase could not be found

I am getting an error while trying to use this extension on an Android device.
"The item you were attempting to purchase could not be found"

Is this a known issue? While testing using google static product ids everything seems to work fine

Cannot get detail on unowned item

Hi,

I'm doing the following to fetch the skus of an unowned item :

var instance:InAppPurchase; // this is pseudo code obviously

instance.addEventListener(InAppPurchaseEvent.RESTORE_SUCCESS, onRestoreSuccess);
instance.restore([MY_ITEM_ID]); // needless to say I've checked that the ID indeed exists

function onRestoreSuccess(event:InAppPurchaseEvent):void
{
  var detail:InAppSkuDetails = instance.getSkuDetails(MY_ITEM_ID);
  // detail is null
}

I've managed to track down the issue to this commit : ebbed6f

You added the following code to IABHelper.java

if (mSubscriptionsSupported) {
    r = queryPurchases(inv, ITEM_TYPE_SUBS);
    f (r != BILLING_RESPONSE_RESULT_OK) {
        throw new IabException(r, "Error refreshing inventory (querying owned subscriptions).");
    }

    if (querySkuDetails) {
        r = querySkuDetails(ITEM_TYPE_SUBS, inv, moreItemSkus);
        if (r != BILLING_RESPONSE_RESULT_OK) {
            throw new IabException(r, "Error refreshing inventory (querying prices of subscriptions).");
        }
    }
}

The side effect is that whenever one tries to call restore([MY_ID_1, MY_ID_2);, the IABHelper ends up filling the Inventory with the requested SKUs and THEN tries to fill it with the subscriptions. In my case there are none and I get an empty inventory. I'm unsure how to fix this. I deactivated subscriptions on my instance by changing if(mSubscriptionsSupported) to if (false), but I guess something better should be done.

Suspned/Resume make the system dialog appears twice

Hello,

Thank you for this great extension, it works perfect except that while displaying the system dialog of in app purchase, if I suspend/resume the application, the another dialog appears from step 1 over the previous dialog confusing the application and occasionally causing a crash.
For example if in the screen of adding credit/debit card, I suspend/resume, the first dialog of purchase confirmation appears over the dialog of adding credit/depit card.
I think it is similar to #14 but I am not sure.

Error : Authentication required.

Hi ,

I have a problem. I uploaded the apk to alpha version of the Developer Console with mail id : [email protected] and added Licence Tester account [email protected] and also Tester Group in alpha testors. And downloaded the apk after publishing directly from the app store. But still it gives error. I have only one Tester Account in my Tablet that too after Factory Data Reset. Still it gives error like - Authentication required. You need to sign into your google account Please tell me what is the problem and solve it soon.

Thanks...

How to get a login page to appear if the account hasn't been logged in?

I've added In-App billing function to my application using your ANE. The flow for the purchases when the users have already been logged-in to their account on their phones are working fine. However, if they haven't been logged in to their account prior to the app initialization, they will only get purchase failure. Is it possible to get the log in page to appear so that they can continue with their purchases?

x86 Arch Support?

Is it fairly easy to add x86 support to this ANE? Is it just rebuilding with that setting turned on?

Problems rebuilding the ane

Hello, I want to implement a serverside verification scheme for in app transactions, for that i need to get more info about the transaction, so i changed the purchase complete handler to return the original transaction JSON. The problem is that when i try to rebuild the extension i get slightly smaller filesizes for both the jar and the ane and the whole thing stops working. The error i get when trying to init the api is that ctx is null. Are there any more steps i need to take to rebuild the ane, other than updating the build.bat file with my filepaths?

Error #3500

Someone can help me fix this error?
ArgumentError: Error #3500: The extension context does not have a method with the name init.
at flash.external::ExtensionContext/_call()
at flash.external::ExtensionContext/call()
at com.pozirk.payment.android::InAppPurchase/init()[D:\Pozirk_projects\ANEInAppPurchase\air\InAppPurchase\com\pozirk\payment\android\InAppPurchase.as:46]

Consuming a Specific SKU by Order / Transaction code

We've been implementing this library for one of our apps that uses a shared currency with our iOS version - the intent is that the user purchases their "Coins" as an IAP from either Google Play or Apple Store, and the app sends a receipt ID and logged in account username that can be validated on our personal servers, and once confirmed tell the Phone Application to consume() the object - all fairly standard stuff for an online game with an in game currency.

These purchases are Unmanaged in the App Store (although since this API uses v3, this shouldn't be an issue).

What I'm currently concerned about is that if the user has purchased, say, a few blocks of coins (which will logically share the same SKU, but different order and signatures numbers), they will pass up any of the relevant orders to the server, but then this service will theoretically consume any of them - which might not be the same one sent up originally, making it impossible to send that next order number up for validation, translating into a loss of in app coins for the players and some very angry emails being sent to me regarding stealing people's money...

I might be wrong in that the orders are always sorted in a similar order, so that it will always be returning the earliest/latest of these Unmanaged consumables, or that it might literally be impossible to have multiple of the same consumable item in the Inventory, but on the off chance that I'm not, is there the functionality to consume an object by SKU and Order Number, just so that I can guarantee selecting the relevant option?

Force close on Lock N Then Unlock Screen when App on BUY screen

Add the following lines to your AIR Aplication-app.xml file inside section:

It works fine which prevents orientation of App .
But when i lock and unlock the device and app is at BUY screen, it creates multiple instances of "Google play inApp buy" and suddenly force close the App.

Error Refreshing Inventory

When calling any api using a real purchase product id I get the error "Error Refreshing Inventory (querying owned items) ErrorId -1003: Purchase signature verification failed"

Everywhere I've read online says the fix for this is including the correct public key but I am already doing this. Does the public key need to be passed differently in the underlying java code?

i.e. poiuytrez/AndroidInAppBilling#43

Is my product ID valid ?

I have published product set in play store with id of "coins".
I'm trying to cal purchase like this:
_iap.purchase("coins", InAppPurchaseDetails.TYPE_INAPP);

But unfortunatelly it says that the product can't be faund :(
Am I doing something wrong ? (The application is initialized with my key)

TypeError #1009 at InAppPurchase/onStatus() : 171

this is weird, I had no problems until now, everything was working fine. But since a few hours I get a #1009: Cannot access a property or method of a null object reference

caused at

com.pozirk.payment.android::InAppPurchase/onStatus()[D:\Pozirk\_projects\ANEInAppPurchase\air\InAppPurchase\com\pozirk\payment\android\InAppPurchase.as:171]

somewhere in my initialization code (basically init followed by a refresh including a specified product id).

not yet sure how exactly to reproduce this, but maybe you already know whats wrong in this line?

I can do further research tomorrow if necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.