Code Monkey home page Code Monkey logo

ti.inappbilling's Introduction

Titanium InAppBilling Module Build Status

The InAppBilling Module for Appcelerator Titanium

Contributors

  • Alexander Conway (Logical Labs)
  • Jon Alter

Interested in contributing? Read the contributors/committer's guide.

Legal

This module is Copyright (c) 2010-2014 by Appcelerator, Inc. All Rights Reserved. Usage of this module is subject to the Terms of Service agreement with Appcelerator, Inc.

ti.inappbilling's People

Contributors

ashcoding avatar hansemannn avatar ingo avatar jonalter avatar m1ga avatar nitrag avatar sgtcoolguy avatar sriks 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

Watchers

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

ti.inappbilling's Issues

Restore Purchases (queryInventory) Failing with 20+ Purchases: responseCode 5 (FIXED - Need Help Committing Fix).

Turns out my previous 'failing on Newer Samsung Devices' issue was just a coincidence - queryInventory is failing if users have more than 20 purchases. I tested this behavior and can replicate it every time. I created 20 promo codes for 20 different in-app products, purchased 15 items with the codes, restored fine on all my devices... Purchased 5 more to get to 20, fails on all my devices (Samsung S5, HTC ONE, LG G4).

I tried passing only 5 SKUS at a time into queryInventory with moreItems, but it still fails with ResponseCode 5. I actually tried this before I knew what the problem was and it was still returning ALL purchased SKUS, not info on just the ones sent.

InAppBilling.queryInventory({
           queryDetails:"true",
           moreItems:SKUS //string Array of 5 SKUS
        });

edit: Could this help? I'm not very seasoned in Titanium Module development, so I don't know how to implement this to test: http://stackoverflow.com/questions/20862280/googles-iab-api3-getskudetails-method-returns-failed-5-developer-error

Detect closing the purchase dialog

Hello,
Is there a way to detect if the user closed the purchase dialog without purchasing?
Edit
This issue manly happen in the DEV environment and I don't think it will be a problem in the PROD.

When try to call android test purchase

[ERROR] : E/IABUtil/Security: Purchase verification failed: missing data.
[ERROR] : IabHelper: In-app billing error: Purchase signature verification FAILED for sku android.test.purchased

Can you tell me what's wrong there ?

Possible Error in Android 4.0.4

I have no devices with this version of Android on it, but I've gotten about 6 or 7 emails from users staying they cannot purchase in-app products since I've updated to the latest ti.inappbilling build. They all have 4.0.4 - it works fine on every other version of Android I've tested and I know I've seen some purchases from users under 4.0. The weird thing is, restoring works fine for them, they just cannot purchase. The Google Play pop up never appears.

I've tried getting logs from these users, but that's not been going so well :) Has anyone else ran into this?

Thanks for this great module! Let me know if I can provide any more information. It's been working great for me otherwise!

"queryinventorycomplete" does not return the available products

No matter the params of queryInventory(), it always return the same json, with no products at all. I have already bought the product but I can't restore my purchase because of it.
It have been ten days since I created the products and I don't know what else to try.

Quering all the products

InAppBilling.queryInventory({
    queryDetails: true
});

returns:

"inventory" : {
    "bubbleParent":true,
    "apiName":"Ti.Proxy"
}

Quering with product name

InAppBilling.queryInventory({
    queryDetails: true,
    moreItems: ['product']
});

also returns:

"inventory" : {
    "bubbleParent":true,
    "apiName":"Ti.Proxy"
}

Failing on Newer Samsung Devices (S5, S6, Note Edge)

I don't have access to any of these devices at the moment, but I've been getting a flurry of people who cannot purchase or restore purchases on newer Samsung devices. The biggest culprit has been the S5.

2 questions:

  1. Has this module been abandoned? (kind of random, but thought I'd ask)
  2. Has anybody seen this issue and have they gotten an error that I can work with to track this down?

Not working

I am bit of a newbie but I am sure this module does not work with Appcelerator and SDK 7.1. Keeps on giving me a error on the device screen whenever I try to buy something. Checked my google play configuration - all seems fine, using an actual phone as well. Just does not seem to work.

Fails on Nexus 5 with Android 6.0

On the device in Subj, el app fails without starting with this error (on Genymotion with same params, it works). So far the % of devices with 6.0 is small, but for the future:

01-08 07:08:01.077: E/AndroidRuntime(23388): FATAL EXCEPTION: KrollRuntimeThread
01-08 07:08:01.077: E/AndroidRuntime(23388): Process: com.womala.womalaandroid, PID: 23388
01-08 07:08:01.077: E/AndroidRuntime(23388): java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.womala.womalaandroid-2/lib/arm/libti.inappbilling.so: has text relocations
01-08 07:08:01.077: E/AndroidRuntime(23388): at java.lang.Runtime.loadLibrary(Runtime.java:372)
01-08 07:08:01.077: E/AndroidRuntime(23388): at java.lang.System.loadLibrary(System.java:1076)
01-08 07:08:01.077: E/AndroidRuntime(23388): at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
01-08 07:08:01.077: E/AndroidRuntime(23388): at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
01-08 07:08:01.077: E/AndroidRuntime(23388): at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:185)
01-08 07:08:01.077: E/AndroidRuntime(23388): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109)
01-08 07:08:01.078: W/ActivityManager(777): Force finishing activity com.womala.womalaandroid/.BwomActivity

External Validation of Purchase

I can't seem to figure out how to validate the receipt externally.

?What is the proper structure for:

{
    "data": {},
    "signature": ""
}

because mine looks like this:

function purchaseCompleted(e) {
    if (e.success && e.purchase) {
        alert('Purchase completed successfully');
                Ti.API.info(JSON.stringify(e.purchase);

///result is:

{
    "receipt": {
        "bubbleParent": true,
        "developerPayload": "P4yl04d",
        "productId": "subscriptiontrails",
        "packageName": "com.eagledevelopers.appname",
        "type": "subs",
        "purchaseState": 0,
        "apiName": "Ti.Proxy",
        "token": "hidden",
        "signature": "hidden",
        "purchaseTime": 1460235642406,
        "orderId": ""
    }
}

I'm using this node module to validate and they have a web tool for testing on the fly. I can't get either to work.

http://iap.gracenode.org/

I've tried removing bubbleParent, apiName, and moving signature. No combo works.

App crash in startup

It is working fine in the old version of the android. But it is not working in the MarshMellow. I click the app icon it is showing flashscreen immediately it crash the app.

BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE

Hi,
I'm having a pb running the example, the returnCode from purchase method is 2 with a pop-up message Authentication is required which is not included in the Constants, I searched & found that it's BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE (was missing even in IAB docs).
What can i do to fix this (i did all the requested steps).
Thank you in advance.

inventory.getDetails doesn't seem to work so I can read price.

Everything seems to be working ok for me except I can't get the details of the inventory. I'd liek this so I can dynamically display the price from the inventory instead of hardcoding it.

On the queryInventoryComplete function this just produces a null instead of the expected details object.

var queryInventoryComplete = function(e) {
var inventory = e.inventory;
Ti.API.info("inventory.getDetails(purchaseIds[0]):" + JSON.stringify(inventory.getDetails(BlahID.com)));
}

Otherwise, things seem to work as far as purchases go...

Verification failed error after purchase

Hello, on clicking buy button the purchase pop up is shown and purchase continues but on console it gives following error :

E/IABUtil/Security: Purchase verification failed: missing data.
[ERROR] : IabHelper: In-app billing error: Purchase signature verification FAILED for sku com.xxx.xxxxx..xxxxxxxxx
Here I am using actual product id and not the android test ids.

Does not work, throws an error on startIntentSenderForResult

I am getting the below error when trying to make purchases. I am using titanium SDK 3.3.0 and the Android version on device is running 4.0.3. I added to the android manifest:

<android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
        <uses-permission android:name="com.android.vending.BILLING" />
        </manifest>
     </android>

Error:

[INFO] :   queryInventory
[INFO] :   Query Inventory response: OK
[INFO] :   subscriptionsSupported: true
[INFO] :   queryInventory
[INFO] :   Query Inventory response: OK
[INFO] :   purchase gas
[INFO] :   dalvikvm: Could not find method android.app.Activity.startIntentSenderForResult, referenced from method org.appcelerator.titanium.util.TiActivitySupportHelper.launchIntentSenderForResult
[WARN] :   dalvikvm: VFY: unable to resolve virtual method 146: Landroid/app/Activity;.startIntentSenderForResult (Landroid/content/IntentSender;ILandroid/content/Intent;IIILandroid/os/Bundle;)V
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x74 at 0x0016
[WARN] :   W/System.err: java.lang.NoSuchMethodError: android.app.Activity.startIntentSenderForResult
[WARN] :   W/System.err:    at org.appcelerator.titanium.util.TiActivitySupportHelper.launchIntentSenderForResult(TiActivitySupportHelper.java:92)
[WARN] :   W/System.err:    at org.appcelerator.titanium.TiBaseActivity.launchIntentSenderForResult(TiBaseActivity.java:615)
[WARN] :   W/System.err:    at ti.inappbilling.util.IabHelper.launchPurchaseFlow(IabHelper.java:425)
[WARN] :   W/System.err:    at ti.inappbilling.InappbillingModule.purchase(InappbillingModule.java:219)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[WARN] :   W/System.err:    at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:64)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:884)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1107)
[WARN] :   W/System.err:    at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:347)
[WARN] :   W/System.err:    at ti.modules.titanium.ui.TableViewProxy.handleMessage(TableViewProxy.java:942)
[WARN] :   W/System.err:    at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN] :   W/System.err:    at android.os.Looper.loop(Looper.java:154)
[WARN] :   W/System.err:    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
[ERROR] :  TiExceptionHandler: (main) [33724,33724] ----- Titanium Javascript Runtime Error -----
[ERROR] :  TiExceptionHandler: (main) [1,33725] - In app.js:89,26
[ERROR] :  TiExceptionHandler: (main) [3,33728] - Message: Uncaught Error: android.app.Activity.startIntentSenderForResult
[ERROR] :  TiExceptionHandler: (main) [1,33729] - Source:             InAppBilling.purchase({
[ERROR] :  V8Exception: Exception occurred at app.js:89: Uncaught Error: android.app.Activity.startIntentSenderForResult

Any ideas? I've seen other people with this same problem dating back several weeks, but I can't find any solutions at all.. or even anything pointing in the right direction!

UnsatisfiedLinkError

I am using this module with SDK 7.5.1.GA

Some devices with Android 8 doesn't start the app. I can see in the device logs:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN8titanium13TypeConverter18javaLongToJsNumberEPN2v87IsolateEx" referenced by "/data/app/com.myapp-B9qzXDFh5_Fnv9ruia5JsQ==/lib/arm64/libti.inappbilling.so"

Does anyone else have this problem? How to solve it?

Is it related to this issue?

https://jira.appcelerator.org/browse/TIMOB-26871

java.lang.IllegalStateException: Setup already completed.

I get this error the second time I want to open my window with in-app products.
java.lang.IllegalStateException: Setup already completed.

I run
InAppBilling.startSetup({publicKey: PUBLIC_KEY});
in my constructor when opening the window via
Alloy.createController('creditsAndroid').open();

Do I need to call a close method on the module? Although there is none to found - what am I missing?

SDK 7.1.1

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.