-
Notifications
You must be signed in to change notification settings - Fork 171
FAQ
Almost every store requires a certain permission to work with it. If the corresponding permission is not granted, a security exception is thrown by a store. E.g if you don't have a granted pemission for Yandex.Store, the log will show something like
java.lang.SecurityException: Not allowed to bind to service Intent { act=org.onepf.oms.openappstore.BIND cmp=com.yandex.store/.service.YandexStoreService } at android.app.ContextImpl.bindService(ContextImpl.java:1508) at android.app.ContextImpl.bindService(ContextImpl.java:1479)
Do not worry about crashes, the library handles such cases for you, preventing an application to stop, but the library will not be able to work with the store without the granted permission.
- If the app manifest doesn't use the required permission, just add it.
- If your app was installed before the target store, and the permission, declared by the store, was not granted, then uninstall your app and install it again. Do not use
-r
adb option.
There is no suitable app stores to provide billing for your application.
Currently there 3 ways to say the library how it should work with the supported stores:
installer
- work only with your app installers
installer then best fit
- if the app installer is null or was uninstalled from the device the next suitable billing provider will be chosen
best fit
- a choice is based on an options set
If your app is supposed to work with store - installers, try to emulate it using adb
adb install -i storepackage /path/to/yourapk
where -i
makes the system think that a store with the passed name in the installer of your app.
Also make sure, that if you've set options.availableStoreNames
\ options.availableStores
and the tested store is not included to any of them, the library will not work with the store.
Note! Some store do not work with the billing SDK, if the user is not logged in. In terms of the library it means that billing is nor supported for the app.
- Declare and active the required SKU in Dev Console.
- For test mode add you account to the test ones, for production mode - publish the app.
The short answer is yes.
- instantiate an
OpenIABHelper
instance - call
setup
- if setup is successful, call
queryInventory()
to synchronize user purchases. - if 2. was successful and the obtained inventory contains purchased that need to be consumed,
consume()
them. - in case of purchase call
launchPurchaseFlow
for the selected item. - if 4. was successful and the item needs to be consumed, consume it.