cafebazaar / trivialdrive Goto Github PK
View Code? Open in Web Editor NEWIn-app Purchase Sample
Home Page: http://pardakht.cafebazaar.ir/doc/?l=en
In-app Purchase Sample
Home Page: http://pardakht.cafebazaar.ir/doc/?l=en
in IabHelper.java when we try to connect to inapp service using context.bindService() it returns false meaning failure. Devices that have this issue seem to be mostly huawei phones running android api level 24.
I understood that in many devices this error occurred in some place of code. The problem is that MContext returns null.
My IabHelper initializing:
if (this.getContext() != null) {
mHelper = new IabHelper(this.getContext(), base64EncodedPublicKey);
mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
public void onIabSetupFinished(IabResult result) {
// list of all purchases
List additionalSkuList = new ArrayList();
additionalSkuList.add(SKU_UPDATE_AD);
mHelper.queryInventoryAsync(true, additionalSkuList, mGotInventoryListener);
}
});
}
and my crash report is:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
at com.app.mobile.utils.bazarUtils.IabHelper.queryPurchases(IabHelper.java:927)
at com.app.mobile.utils.bazarUtils.IabHelper.queryInventory(IabHelper.java:650)
at com.app.mobile.utils.bazarUtils.IabHelper.queryInventory(IabHelper.java:614)
at com.app.mobile.utils.bazarUtils.IabHelper$2.run(IabHelper.java:713)
at java.lang.Thread.run(Thread.java:764)
روی گوشی های شیائومی مثل ردمی 7 با کلیک روی خرید فوری برمیگردد و ناموفق است.
Hi , after adding aidl file , display error :
Error:Execution failed for task ':app:compileDebugAidl'.
java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing 'D:\ssdk\build-tools\25.0.2\aidl.exe' with arguments {-pD:\ssdk\platforms\android-25\framework.aidl -oE:\android_studio_workspace\8thin\app\build\generated\source\aidl\debug -IE:\android_studio_workspace\8thin\app\src\main\aidl -IE:\android_studio_workspace\8thin\app\src\debug\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\design\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\recyclerview-v7\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\transition\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\8thin\justifiedTextViewmaster\unspecified\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\org.adw.library\discrete-seekbar\1.0.1\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.asha.nightowllib\nightowllib\0.2\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\8thin\Appintro_library\unspecified\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-vector-drawable\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\cardview-v7\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-v4\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-fragment\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-media-compat\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-core-ui\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-core-utils\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.android.support\support-compat\25.3.0\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\com.daimajia.slider\library\1.1.5\aidl -IE:\android_studio_workspace\8thin\app\build\intermediates\exploded-aar\8thin\circleimageview\unspecified\aidl -dC:\Users\Pardis\AppData\Local\Temp\aidl149491410305225108.d E:\android_studio_workspace\8thin\app\src\main\aidl\com\android\vending\biling\IInAppBillingService.aidl}
بعضی موقع پیش میاد که سیستم پرداخت را درست پیاده سازی کردیم و بر روی دستگاه های مختلف امتحان کردیم و برنامه را منتشر میکنیم و عده زیادی از کاربران برنامه را دانلود و خرید میکنند و مشکلی براشون پیش نمیاد . اما بعضی موقع برای بعضی از کاربران پرداخت انجام و پول از حساب فرد کسر میشه اما بعد از برگشت به برنامه کرش به وجود میاد و برنامه آپدیت نمیشه و کاربر هر بار که برای چک کردن وضعیت خود به بازار متصل میشه همین مشکل تکرار میشه.
این مشکل در یکی از برنامه های من به وجود آمد که برنامه من بالای 2000 تا خرید شد اما 4 نفر پیام دادن که برنامه را خریداری کردیم اما برنامه آپدیت نشد و هر بار هر که وصل به بازار وصل میشوند همین وضعیت به وجود میاید.
من در انجمن برنامه نویسی اندروید این موضوع را بیان کردم و دیدم برای چند توسعه دهنده دیگر این اتفاق افتاده است
حالا الان که در حال پیاده سازی و تست بر روی امولاتور جنی موشن بودم یه اتفاق مشابه رخ داد
پرداخت بر روی امولاتور ورژن 2.3 و 4.2.2 به درستی انجام میشه اما بر روی ورژن 4.4.2 دیالاگ پرداخت بالا میاد و در هنگام لود شدن آن کرش به وجود میاد و در بعضی مواقع صفحه پرداخت کامل بالا میاد و پرداخت انجام میشه اما موقع آپدیت برنامه کرش به وجود میاد
خطایی که رخ میدهد این است :
Error purchasing: Iabresult : null data in IAB Result (response:1002:bad response received)
در اینترنت سرچ کردم اما مثل اینکه هنوز جوابی برای این مشکل پیدا نشده که فقط یک نفر گفت من این مشکل را در فراگمنت داشتم و وقتی پرداخت را در اکتیویتی قرار دادم این مشکل حل شد که جواب این نیست
http://stackoverflow.com/questions/16393747/
من فکر میکنم مشکل این قضیه ای که تعریف کردم همین خطا باشه و اگر جوابی برای این خطا پیدا بشه قطعا این مشکل حل میشود.
با تشکر و احترام
running application on devices without bazaar client, will cause NullPointerException.
hello,
I see a bug in my app that related to the in-app billing of Cafebazaar. so I decided to test in TrivialDrive and see this bug in TrivialDrive also.
If in the step "خرید با موفقیت انجام شد" instead of pressing "باشه" button, close the app, it will be impossible to purchase again or consume that product.
By the way, if I clear data of the CafeBazaar app, in my app this error disappears untile the next incompleted purchase but in TrivialDrive, it crashes the app.
I will be grateful if there is a solution. our app is near to release and we need to fix this problem as soon as possible.
کتابخونه مال 6سال پیشه
به نظرتون الان وقتش نیست که آپدیتش کنید و یه ورژن مخصوص اندروید استادیو ارائه کنید؟
Wouldn't it be better to have the Helper libraries as a separate project available on JCenter?
i try to test IAP of cafebazaar before publishing my app. so i upload my app and create a product and import helper class and libs and set everythings that need.but when i start my activity that has IAP codes is force stop the app and the log say :
Not allowed to bind to service Intent { act=ir.cafebazaar.pardakht.InAppBillingService.BIND pkg=com.farsitel.bazaar }
i search and find it's need permission on manifest but i set this permission :
<uses-permission android:name="com.farsitel.bazaar.permission.PAY_THROUGH_BAZAAR" />
but the error still happen on genymotion and real device.
hello,
why your intent for buy is different from others markets
Intent serviceIntent = new Intent("ir.cafebazaar.pardakht.InAppBillingService.BIND");
serviceIntent.setPackage("com.farsitel.bazaar");
all other markets is same but for yours is ir.cafebazaar.pardakht
and com.farsitel.bazaar
what is the need to do this?
Only the first time you enter the game, the first click will pop up the payment button, the second click will not pop up (the payment success or failure is the same will not pop up), restart the game, the first click will pop up, But the second time will not pop up
سلام
بنده برنامه ای با متدی که نام پکیج مارکت را بر میگرداند در بازار منتشر کردم
getInstallerPackageName
https://developer.android.com/reference/android/content/pm/PackageManager.html#getInstallerPackageName(java.lang.String)
اما برنامه مقدار null را برگشت داد
میخواستم بدونم آیا مارکت بازار همچین قابلیتی را پشتیبانی میکند؟
بنده برای ساخت لایبری برای محافظت از برنامه و جلوگیری استفاده از نسخه های غیر قانونی به این مورد نیاز دارم
خط زیر برای ورژن های قدیمی بازار باعث خطا می شود چون configBundle نال است:
Bundle configBundle = mService.getPurchaseConfig(apiVersion, packageName, itemType); if (configBundle.getBoolean(INTENT_V2_SUPPORT)) { logDebug("launchBuyIntentV2 for " + sku + ", item type: " + itemType); launchBuyIntentV2(act, sku, itemType, requestCode, listener, extraData); } else { logDebug("launchBuyIntent for " + sku + ", item type: " + itemType); launchBuyIntent(act, sku, itemType, requestCode, listener, extraData); }
برای کسانی که با ورژن حدید بازار دارند تست می کنند احتمالا مشکل درست می کند.
I was looking for a way to contact with bazaar developers, so that's why I've open this issue, this is things that seems good in your iap REST API implementation:
orderId
orderId
is unique and didn't proceeded already, but this is DANGEROUS.orderId
to a random value and send it back to the server, as server does not know it has been changed, will considers it as new order and will proceed it as valid orderorderId
via REST API we can use that instead, otherwise orderId
is redundant and we have to save and check purchaseToken
instead which is up to 1000 characters.Due to the fact that Android Studio uses gradle files to build projects and this source doesn't have any, We cannot build it anymore. Please add gradle build files.
Bundle configBundle = mService.getPurchaseConfig(apiVersion) ;
configBundle == null mishe
Xiaomi mi 9
Xiaomi 7 redmi
caffebazar version 8.12.1
سلام تو گوشی های شیائومی هنوز این مشکل وجود داره لطفا راهنمایی کنید
قبلا هم در این مورد تیکت زده شده ولی همچنان به این مشکل برمیخورم
null configBundle #22
اشتباه شد
خواهشا حذف شود
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.