Code Monkey home page Code Monkey logo

poolakey's Introduction


Build Status CodeFactor

Android In-App Billing SDK for Cafe Bazaar App Store.

Getting Started

To start working with Poolakey, you need to add its dependency into your build.gradle file:

Dependency

dependencies {
    implementation "com.github.cafebazaar.Poolakey:poolakey:[latest_version]"
}

Then you need to add jitpack as your maven repository in build.gradle file:

repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }

How to use

For more information regarding the usage of Poolakey, please check out the wiki page.

Sample

There is a fully functional sample application that demonstrates the usage of Poolakey, all you have to do is cloning the project and running the app module.

Reactive Extension Support

Yes, you've read that right! Poolakey supports Reactive Extension framework. Just add its dependency into your build.gradle file:

dependencies {
    // RxJava 3
    implementation "com.github.cafebazaar.Poolakey:poolakey-rx3:[latest_version]"
    // RxJava 2
    implementation "com.github.cafebazaar.Poolakey:poolakey-rx:[latest_version]"
}

And instead of using Poolakey's callbacks, use the reactive fuctions:

payment.getPurchasedProducts()
    .subscribe({ purchasedProducts ->
        ...
    }, { throwable ->
        ...
    })

poolakey's People

Contributors

dhosseiny avatar mirbehnam avatar mrezanasirloo avatar msmoradi avatar phelat avatar shayanpourvatan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

poolakey's Issues

مشکل چرخش اتوماتیک صفحه در حال پرداخت بازی

وقتی در حال خرید در صفحه اکتیویتی بازار هستیم اگر به هر دلیلی گوشی بچرخه اکتویتی کافه بازار ریست میشه و کاربر باید خریدش رو از اول انجام بده و این تجربه بدی برای کاربر رقم میزنه.

خوبه امکانی وجود داشته باشه که بشه چرخش صفحه رو قفل کرد روی یک حالت خاصی.
من میدونم که توی مانیفست اکتویتی میشه عبارت android:screenOrientation="portrait" گذاشت و اینکارو انجام داد ولی وقتی داریم با پلاگین پولکی کار میکنیم مستقیما کنترلی روی اکتیویتی کافه بازار نداریم.
برای اینکار باید چه اقداماتی صورت بگیره؟
پیشاپیش متشکرم.

مشکل در پرداخت

برای من فقط یک صفحه ی سفید بدون هیچ اروری باز میشه واقعا مشکلش چیه ؟

Failing purchased

Describe the bug
Hi, recently I tried to implement my IAB using Poolakey library but I think something's wrong here.
After a successful purchase in payment onActivtyResult method, right in the purchaseFailed callback I faced with an odd error message in localizedMessage:
purchase was hijacked and it's not a valid purchase

Expected behavior
I thought that after a successful purchase I should back to purchaseSucceed callback but I didn't. though all thing are sounds good.

Versions

  • Version of the library that your are using: 1.0.0-alpha03
  • API Version of the Android device that you have tested on: API 28

purchasedItems برای دیتایل

سلام وقت بخیر purchasedItems که ازش ایتم هاشو میگیرم ایتم های خریده شده قبلی رو برمیگردنه فقط جدید هارو نمیده

IInAppBillingService$Default is defined multiple times

باسلام
ما در اپی که داریم از پرداخت درون برنامه ای مایکت و کافه بازار استفاده می کنیم.
با مهاجرت به پولکی مشکلی در خروجی release گرفتن پیش آمد و چنین اروری توسط gradle نمایش داده می شود.

Type com.android.vending.billing.IInAppBillingService$Default is defined multiple times: C:\Users\Roudi.gradle\caches\transforms-3\34dd8bb88a71d0c96e70d6e7721fb778\transformed\jetified-poolakey-1.3.0-runtime.jar:com/android/vending/billing/IInAppBillingService$Default.class, D:\dev\workspace\myproject\app\build\intermediates\asm_instrumented_project_classes\cafe_bazaarRelease\com\android\vending\billing\IInAppBillingService$Default.class

وقتی فایل C:\Users\Roudi.gradle\caches\transforms-3\34dd8bb88a71d0c96e70d6e7721fb778\transformed\jetified-poolakey-1.3.0-runtime.jar حذف می شود، بیلد signed apk با موفقیت صورت میگیرد ولی وقتی در اپ کاربر به آنجایی که از پرداخت درون برنامه ای استفاده شده است، منتقل می شود، برنامه کرش می کند.

لطفا این موضوع را بررسی فرمایید.

Add poolakey to poolakey-rx

poolakey-rx does not contain poolakey. It's desired to poolakey-rx contains poolakey itself. Like Rxandroid that contains RxJava and adds some tools.

Crash when CafeBazaar not installed on API 17

The app will crash when cafebazaar is not installed on the phone and connect method of Payment class being called.
Error description:
java.lang.IllegalStateException: context.packageManager.queryIntentServices(it, 0) must not be null
Library-Version: 1.0.0-alpha01
It occurred on Emulator Nexus 4 - API 17 but there is no such an error on an actual device with API 28

<< Get all products for show price of those before buy it inside app itself >>

Describe the bug
This library can't provide get all products for show price of those before buy it inside app itself (Querying for Items Available for Purchase)

Expected behavior
As you can get purchases product , get all products with details must be implemented
Like Java Payment API : https://developers.cafebazaar.ir/en/guidelines/in-app-billing/implementation/java#iab_class ->
Querying for Items Available for Purchase

Versions

  • Version of the library that your are using: 1.2.2

Caused by android.os.DeadObjectException

Describe the bug
We are using this library in our application. so few of our users have billing problem with this.
The error is : Caused by android.os.DeadObjectException with detail :

android.os.BinderProxy.transactNative (BinderProxy.java) android.os.BinderProxy.transact (BinderProxy.java:527) com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupported (IInAppBillingService.java:26) com.phelat.poolakey.BillingConnection.isPurchaseTypeSupported (BillingConnection.java:11) com.phelat.poolakey.BillingConnection.onServiceConnected (BillingConnection.java:8) android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:2067) android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:2099) android.os.Handler.handleCallback (Handler.java:883) android.os.Handler.dispatchMessage (Handler.java:100) android.os.Looper.loop (Looper.java:237) android.app.ActivityThread.main (ActivityThread.java:7811) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1068)

Versions

  • 1.0.0-alpha4
  • API Versions : 26, 27 ,28, 29

Inconsistent Behavior between poolakey and poolakey-rx error handling

When normal 'purchaseProduct' function called and an error happened 'failedToBeginFlow' called and because by default 'failedToBeginFlow' is doing nothing so no error is thrown.
But when poolakey-rx 'purchaseProduct' function called and an error happened Rx onError get called and if error not handled exception will be thrown.
This is inconsistent behavior.
This issue exists for 'onActivityResult', 'connect' and other Rx methods.
My recommendation is to force the client to handle errors in poolakey, Or throw an error and document it. I like the prior one.
What is your idea?

error in connection to bazzar

java.lang.NoSuchMethodError: No direct method <init>(ILjava/lang/Object;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V in class Lkotlin/jvm/internal/FunctionReferenceImpl; or its super classes (declaration of 'kotlin.jvm.internal.FunctionReferenceImpl' appears in /data/app/ir.b3b.vocabbox-1s3XfAF1nTv2n9hYJuWnEA==/base.apk) at ir.cafebazaar.poolakey.BillingConnection$startConnection$1.<init>(Unknown Source:10) at ir.cafebazaar.poolakey.BillingConnection.startConnection$poolakey_release(BillingConnection.kt:44) at ir.cafebazaar.poolakey.Payment.connect(Payment.kt:68)

this error occurs when trying to connect to bazzar with below code :
paymentConnection = payment.connect { connectionSucceed { } connectionFailed { } disconnected { } }

version : alpha08

Java sample code

dear it will be good to insert a java sample code too and also adding a documentation for it

Could not find com.github.cafebazaar.Poolakey:poolakey:2.0.0.

Execution failed for task ':app:checkCafebazaarDebugAarMetadata'.

Could not resolve all files for configuration ':app:cafebazaarDebugRuntimeClasspath'.
Could not find com.github.cafebazaar.Poolakey:poolakey:2.0.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/cafebazaar/Poolakey/poolakey/2.0.0/poolakey-2.0.0.pom
- https://repo.maven.apache.org/maven2/com/github/cafebazaar/Poolakey/poolakey/2.0.0/poolakey-2.0.0.pom
Required by:
project :app
وی پی ان هم زدم :)

Gradle can't find the library

Hi,I added the dependency and maven in my build.gradle files but the gradle coudn't find the library.
I checked my internet connection with another libraries and it was ok.

مشکل در خرید اشتراک پولکی

بعد از خرید اشتراک باز هم صفحه خرید برای کاربر باز میشه به جایی اینکه صفحه " شما این محصول را خریذاری کردین

عدم پشتیبانی از Jetpack Compose

سلام
من نرم افزار جدیدم رو کاملا بر پایه رو کامپوز نوشتم اما متاسفانه کتابخونه با اون سازگار نیست. ممنون میشم این مورد رو هم اضافه کنید

باز نشدن صفحه پرداخت

سلام. من کتابخونه رو به پروژه م که با زبان جاوا هست اضافه کردم و پیاده کردم، لاگ می گیرم purchaseFlowBegan انجام میشه ولی صفحه ای باز نمیشه. نباید BottomSheetDialogFragment بازار باز بشه؟

خطا در هنگام استفاده کردن محصول مصرفی

در هنگام فراخوانی متد consumeProduct بعضی مواقع با خطای زیر مواجح میشویم و هیچ یک از کال بک های consumeSucceed و consumeFailed فراخوانی نمی شود.
جزییات خطا :

Handler (android.os.Handler) {1c93f6c} sending message to a Handler on a dead thread java.lang.IllegalStateException: Handler (android.os.Handler) {1c93f6c} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:569) at android.os.Handler.enqueueMessage(Handler.java:778) at android.os.Handler.sendMessageAtTime(Handler.java:727) at android.os.Handler.sendMessageDelayed(Handler.java:697) at android.os.Handler.post(Handler.java:427) at ir.cafebazaar.poolakey.thread.BackgroundThread.execute(BackgroundThread.kt:15) at ir.cafebazaar.poolakey.thread.BackgroundThread.execute(BackgroundThread.kt:6) at ir.cafebazaar.poolakey.billing.connection.ServiceBillingConnection.consume(ServiceBillingConnection.kt:309) at ir.cafebazaar.poolakey.BillingConnection$consume$1.invoke(BillingConnection.kt:100) at ir.cafebazaar.poolakey.BillingConnection$consume$1.invoke(BillingConnection.kt:25) at ir.cafebazaar.poolakey.BillingConnection.runOnCommunicator(BillingConnection.kt:163) at ir.cafebazaar.poolakey.BillingConnection.consume(BillingConnection.kt:99) at ir.cafebazaar.poolakey.Payment.consumeProduct(Payment.kt:106)

how to get user has purchased product?

Hi
I created an application and want to get that user has purchased product or not, what's the method to do that?
I tried getPurchasedProducts() but it returns an empty success response.

استفاده از پولکی در کتابخانه LibGDX

سلام ، وقت بخیر

بنده میخوام پولکی رو روی یه بازی که با libgdx نوشتم، پیاده کنم. اکتیویتی ای که باید پولکی رو مدیریت کنه حتما باید از

com.badlogic.gdx.backends.android.AndroidApplication

ارث بری کنه.این کلاس نیز از Activity ارث بری میکنه نه AppCompatActivity. بخاطر همین در این متد

payment.purchaseProduct( registry = activityResultRegistry, request = purchaseRequest)

نمیتونم activityResultRegistry رو بگیرم. چون این نمونه فقط توی AppCompatActivity هستش.

درواقع برای استفاده از پولکی توی فریموورک LibGDX این مشکل برای همه پیش میاد.
لطفا راهنمایی کنید.

An exception was thrown for pulling subscribe history when you are not logged in to the bazaar appstore

Hello developer, in our application, there is a logic to determine whether the current account has a historical subscription record before subscribing to a product.
If there is, it will prompt that you cannot subscribe again; if there is not, you can start subscribing. During my test, if bazaar appstore has no problem with normal login,
However, if the bazaar appstore is not logged in, an error will be thrown when pulling the history record ir.cafebazaar.poolakey.exception.ResultNotOkayException: Failed to receive response from Bazaar. If you subscribe directly, the login interface will pop up to allow the user to log in to the bazaar appstore. operate,
I would like to ask how to detect whether bazaar appstore is logged in in my application. If not, can I call a method to jump to the bazaar appstore login page?

مشکل کتابخانه پولکی ری اکت نیتیو

سلام خسته نباشید من هر کاری میکنم نمیتونم پرداخت درون برنامه ای رو در ری اکت نیتیو انجام بده
بنظر پکیج مشکل داره ممنون میشم بررسی کنید و برطرف کنید
و اینکه اموزشش خیلی کم و ضعیفه لطفا یه اموزش جامع براش بزارید خیلی از برنامه نویس های اندروید از ری اکت نیتیو استفاده میکنن
تشکر

The integration documentation is out of date

Integration documentation is totally wrong and hasn't been updated with breaking changes.
I'm using the latest version of the library (v2.0.0).

Please review your integration documentation and fix these errors:

1- subscribeProduct:

Incorrect:

payment.subscribeProduct(activity = this, request = purchaseRequest) {...}

Correct

fun purchaseProduct(
        registry: ActivityResultRegistry,
        request: PurchaseRequest,
        callback: PurchaseCallback.() -> Unit
    ) {

2- PurchaseRequest

Incorrect:

val purchaseRequest = PurchaseRequest(
    productId = "subscriptionProduct",
    requestCode = 1234,
    payload = ""
)

Correct:

data class PurchaseRequest(
    val productId: String,
    val payload: String? = null,
    val dynamicPriceToken: String? = null
)

3- onActivityResult:

No longer exists:

payment.onActivityResult(requestCode, resultCode, data) {...}

android.os.DeadObjectException in ServiceBillingConnection.kt:121

Hello 👋🏻.
Describe the bug
Since we use both bazaar and myket billing we can't use poolakey dependency becuase project build failed with 2 IInAppBillingService.aidl files and android studio says they have conflict with each other.
So we imported Poolakey and myket-billing as a android module with single IInAppBillingService.aidl in our android project and every things fine and works.
But we have a crash log in our crash report service with this stacktrace:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:630)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620)
... 1 more
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupported(IInAppBillingService$Stub.java:326)
at ir.cafebazaar.poolakey.billing.connection.ServiceBillingConnection.isPurchaseTypeSupported(ServiceBillingConnection.kt:121)
at ir.cafebazaar.poolakey.billing.connection.ServiceBillingConnection.onServiceConnected(ServiceBillingConnection.kt:98)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1980)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2012)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7912)
... 3 more

To Reproduce
We can't reproduce it.

Screenshots
image

Screenshot 1401-10-20 at 13 12 24

This report is just for one week.

Versions

  • Version of the library that we are using: [eg: 2.0.0]
  • API Versions of the Android device that we crashes on: [eg: API 21,27,28,29,30,33]

getPurchasedProducts returns empty list sometimes

getPurchasedProducts returns empty list continuously right after a Bazaar login until next time users sign out of their account and sign in again. (I think this happens specially if login is done through 3rd party app and not the Bazaar app itself).

مشکل در TargetSdk 11

متاسفانه کتابخانه با targetsdk 11 سازگار نیست و با توجه به منقضی شدن onActivityResult نمی‌توان از آن استفاده نمود

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.