Coder Social home page Coder Social logo

onepf / openiab-unity-plugin Goto Github PK

View Code? Open in Web Editor NEW
145.0 145.0 58.0 3 MB

OpenIAB Unity Plugin for Android (Google Play, Samsung Apps, Amazon Appstore, SlideME, Nokia Store, Appland, Aptoide, AppMall, Yandex.Store, Fortumo), Windows Phone and iOS.

License: Apache License 2.0

Java 13.39% C# 76.03% Objective-C++ 10.12% Objective-C 0.46%

openiab-unity-plugin's People

Contributors

akarimova avatar andreipetrashkevich avatar avl93 avatar delanir avatar grimreio avatar mozgoid avatar p1cachu 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openiab-unity-plugin's Issues

Game can't get PurchaseSucceed event from 2.0 version updated after publishing as beta

Help me with this issue plz @_@
I'm using openiab for IAP on game.
Everything's fine on 1.0 version name and version code but something wrong from 2.0 version @@
Here is my AndroidManifest, it's as same as one on Google Play.

    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
  android:installLocation="preferExternal"
  android:theme="@android:style/Theme.NoTitleBar"
    android:versionCode="2"
    android:versionName="1.2"
  <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>   
  <application
  android:icon="@drawable/app_icon"
      android:label="@string/app_name"
      android:debuggable="true">
    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
              android:launchMode="singleTask"
              android:label="@string/app_name"           android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerActivity"
              android:launchMode="singleTask"
              android:label="@string/app_name"              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
              android:launchMode="singleTask"
              android:label="@string/app_name"              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <activity android:name="org.onepf.openiab.UnityProxyActivity"
              android:launchMode="singleTask"
              android:label="@string/app_name"         android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
    </activity>
    <receiver android:name="com.amazon.inapp.purchasing.ResponseReceiver">
      <intent-filter>
        <action
                android:name="com.amazon.inapp.purchasing.NOTIFY"
                android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY"/>
      </intent-filter>
    </receiver>
  </application>
  <uses-feature android:name="android.hardware.telephony" android:required="false"/>
  <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false"/>
  <uses-permission android:name="com.android.vending.BILLING"/>
  <uses-permission android:name="android.permission.RECEIVE_SMS"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <uses-permission android:name="com.tmoney.vending.INBILLING"/>
  <uses-permission android:name="com.yandex.store.permission.BILLING"/>
  <uses-permission android:name="com.sec.android.iap.permission.BILLING"/>
  <uses-permission android:name="org.onepf.openiab.permission.BILLING"/>
  <uses-permission android:name="com.nokia.payment.BILLING"/>
  <permission android:name="com.tmoney.vending.INBILLING"/>

Thanks for reading. ^_^

IOS demo Help

Hello,

Have sample initialize code for iOS?
I keep getting error itunes not connected.

im not understand this code
myappid= com.xxx.zzz
productid=remove_ads
what's where I'll write my= OpenIAB.mapSku(SKU, OpenIAB_iOS.STORE, "sku");

Please Help
Thanks

Queryinventory = FATAL EXCEPTION (OpenIAB Unity plug-in)

edit: should have mentioned the following info: I'm using the latest stable version of Unity 4 (4.6.4) and the latest (pre-compiled?) version of the OpenIAB Unity plug-in (0.9.8.6). Targeting Android.

Hello. This problem probably has a simple solution, and I've spent a lot of time Googling it, but the answers didn't really make sense to me (as a hobbyist, mostly). Any help would be extremely appreciated. For the most part, I just copied/pasted the example code. Actual purchases work fine, but calling OpenIAB.queryInventory() in the billingSupportedEvent() function always causes this exception.

From the log:

E/AndroidRuntime( 6427): FATAL EXCEPTION: main
E/AndroidRuntime( 6427): Process: com.myfakecompany.myterribleapp, PID: 6427
E/AndroidRuntime( 6427): java.lang.Error: FATAL EXCEPTION [main]
E/AndroidRuntime( 6427): Unity version : 4.6.2f1
E/AndroidRuntime( 6427): Device model : Dell Venue 7 3730
E/AndroidRuntime( 6427): Device fingerprint: (blah)
E/AndroidRuntime( 6427):
E/AndroidRuntime( 6427): Caused by: java.lang.IllegalStateException: IAB helper setup failed. Can't perform operation: queryInventory
E/AndroidRuntime( 6427): at org.onepf.oms.OpenIabHelper.checkSetupDone(OpenIabHelper.java:1517)
E/AndroidRuntime( 6427): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1413)
E/AndroidRuntime( 6427): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1395)
E/AndroidRuntime( 6427): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1386)
E/AndroidRuntime( 6427): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1378)
E/AndroidRuntime( 6427): at org.onepf.openiab.UnityPlugin$2.run(UnityPlugin.java:147)
E/AndroidRuntime( 6427): at android.os.Handler.handleCallback(Handler.java:733)
E/AndroidRuntime( 6427): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 6427): at android.os.Looper.loop(Looper.java:149)
E/AndroidRuntime( 6427): at android.app.ActivityThread.main(ActivityThread.java:5061)
E/AndroidRuntime( 6427): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6427): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 6427): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
E/AndroidRuntime( 6427): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603)
E/AndroidRuntime( 6427): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 4143): Force finishing activity (etc.)

An Error when I try to test Yandex.store

Hello
I want to use Unity-Plugin for Yandex.store.
I get an error when i try to initialize OpenIAB.

The error is
Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

I installed Yandex.store on my phone and it can work.
So what does the error mean?Did I miss something to set up?

Apple iOS restore always successful

Hello,
I'm currently working on implementing a restore Button for Non consumable products.
My Problem is that the restore process is always successful even if the User didnt bought the product before. I've put my Code into the restoreSucceededEvent. Is this the wrong way?

I'm testing in the sandbox enviroment.

Best regards
Dennis

Restore on Android

How i can make a restore on android or check if the sku is purchased on startup (after reinstalled app)?

“Restoring Purchase Products” error?

After submit for review my app i get an error message : "We found that your app offers In-App Purchase(s) that can be restored but does not include a “Restore Purchases" feature to allow users to restore the previously purchased In-App Purchase(s), as specified in the “Restoring Purchase Products” . Could someone give me some idea to fix this problem? Thanks.

Iphone6 ios 8.1.3

I'm using the SIS and the OpenIAB to my shop to test the iphone 5 ios 8.1.3 okay. To arrange for apple they rejeitao the app saying that when you click the buy nothing happens (in this iphone 6). The openIAB already is compatible with iphone6? Or the problem is something else?

public void restoreTransactions()

As I understand, to make purchase twice (or more) i must to call restoreTransactions() after purchaseSucceededEvent. But this is code of this method in OpenIAB_Android :
public void restoreTransactions()
{
}

It's empty.

Unity - Google Play Store - No suitable appstore was found (response: 3:Billing Unavailable)

Hey guys, thanks for the plugin,
but unfortunately it does not work for me.
I'm a unity developer, actually trying to publish it on the android play store. During the edit mode everything worked well, but after trying it on mobile (also with published APK at play store), I get the following error code all time on multiple devices (I also tried different verifyModes and/or other options):

05-02 15:23:26.470: D/OpenIAB(9219): checkOptions() Options={availableStores=[], availableStoreNames=[com.google.play], preferredStoreNames=[com.google.play], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtb6grdtuviC3SS8Ei0WlahCX4Nygf3LnNNImPGFkxMEjiYkERB0rA/VrO3J4G014xVJQFq8VMsMcKqBN9oy3tr6EFKLKAmo9PIcpOXt8MM6MNwmxHA7Q0+Xu9bGoHgW97ivb1eyJy9vRpOCRwKbVtBBK/OSbqLjIUbv6PJDnnYe/Zl790h9J4O43JJNKKQ8bghXMR1GOpHdntyW2kefFP92f/SyBVEaallEFerpSrLIH6MdkPiqQgSkPKOV4SuJmzNL3WGarj4w5PaqqASrOQr9gpxY+dqz3yARQnxvVZgTLoudFwkJ0RFq1z+Rfp9uQQmzivTEIwLejUz55i9f+dQIDAQAB}, samsungCertificationRequestCode=899}
05-02 15:23:26.470: D/OpenIAB(9219): checkGoogle() verify mode = 0
05-02 15:23:26.470: D/OpenIAB(9219): checkGoogle() google key available = true
05-02 15:23:26.470: D/OpenIAB(9219): checkSamsung() activity = com.unity3d.player.UnityPlayerNativeActivity@e2c526e
05-02 15:23:26.470: D/OpenIAB(9219): hasRequestedPermission() is false for com.nokia.payment.BILLING
05-02 15:23:26.470: D/OpenIAB(9219): checkNokia() has permission = false
05-02 15:23:26.470: D/OpenIAB(9219): checkNokia() ignoring Nokia wrapper
05-02 15:23:26.470: D/OpenIAB(9219): checkFortumo() fortumo sdk available: false
05-02 15:23:26.470: D/OpenIAB(9219): checkFortumo() fortumo billing required: false
05-02 15:23:26.470: D/OpenIAB(9219): checkFortumo() ignoring fortumo wrapper.
05-02 15:23:26.470: D/OpenIAB(9219): checkAmazon() Android Lollipop not supported, ignoring amazon wrapper.
05-02 15:23:26.490: D/OpenIAB-UnityPlugin(9219): createBroadcasts
05-02 15:23:26.490: D/OpenIAB-UnityPlugin(9219): Starting setup.
05-02 15:23:26.490: D/OpenIAB(9219): startSetup() options = Options={availableStores=[], availableStoreNames=[com.google.play], preferredStoreNames=[com.google.play], discoveryTimeoutMs=0, checkInventory=false, checkInventoryTimeoutMs=0, verifyMode=0, storeSearchStrategy=0, storeKeys={com.google.play=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtb6grdtuviC3SS8Ei0WlahCX4Nygf3LnNNImPGFkxMEjiYkERB0rA/VrO3J4G014xVJQFq8VMsMcKqBN9oy3tr6EFKLKAmo9PIcpOXt8MM6MNwmxHA7Q0+Xu9bGoHgW97ivb1eyJy9vRpOCRwKbVtBBK/OSbqLjIUbv6PJDnnYe/Zl790h9J4O43JJNKKQ8bghXMR1GOpHdntyW2kefFP92f/SyBVEaallEFerpSrLIH6MdkPiqQgSkPKOV4SuJmzNL3WGarj4w5PaqqASrOQr9gpxY+dqz3yARQnxvVZgTLoudFwkJ0RFq1z+Rfp9uQQmzivTEIwLejUz55i9f+dQIDAQAB}, samsungCertificationRequestCode=899}
05-02 15:23:26.490: D/OpenIAB(9219): setupWithStrategy() store search strategy = 0
05-02 15:23:26.490: D/OpenIAB(9219): setupWithStrategy() package name = com.deathwingStudios.countdoku
05-02 15:23:26.490: D/OpenIAB(9219): setupWithStrategy() package installer = null
05-02 15:23:26.490: D/OpenIAB(9219): finishSetup() === SETUP DONE === result: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable) Appstore: null
05-02 15:23:26.490: D/OpenIAB-UnityPlugin(9219): Setup finished.
05-02 15:23:26.490: E/OpenIAB-UnityPlugin(9219): Problem setting up in-app billing: IabResult: 3, No suitable appstore was found (response: 3:Billing Unavailable)

Thanks for help.

Greetings

Problem with Amazon store

I'm using version 0.9.6.1 of the plugin to connect to the AmazonSDKTester on my phone. I can make a purchase just fine, but there is a bit of a problem at the end. The purchase window comes up over a black screen with my game icon and title at the top. I'm assuming this is the expected behavior because the Google store does it as well. The problem is, unlike the Google store, the Amazon store (or at least the SDKTester app) doesn't close that black window after a purchase is complete. I have to manually press the back button on the phone to get it to close. Is there a way around this behavior, or is it a bug of some sort?

[Securing Transactions] QueryInventory, RestoreTransactions

I need to fetch following information:

  1. Inventory details - existing inventory price, title, etc..
  2. User owned Consumable items
  3. User owned non-consumable items(which are yet to be consumed).

Please help me in understanding the platform specific behavior with following methods:

QueryInventory on GooglePlay and IOS - Does it fetch all data - (1, 2 and 3) from server or from it's own local cache?
To Add extra security in my app - After every successful purchase, I call query inventory and then award purchased item from queryinventory response. I would like to confirm that QueryInventory will fetch purchased data (2 and 3) from apple server and not local cache.

Restore Transactions on IOS - I believe it will fetch (2) and (3) from apple server and add it to local inventory. If I call QueryInventory after RestoreTransactions, I will get all non-consumable purchased item. Please correct me if my understanding is wrong?

CheckInventory-option when connecting (only on android): What does it exactly do? Does it query the store for both (2) and (3). If so, can this be simulated on ios via RestoreTransactions?

VertifyEverything-option : Does it verify purchase receipts?

Thank you for your time and help

"Test: " prefix to product name in Google Play Receipt

I tested it first in Alpha. I thought there's "Test: " prefix attached to product name/details because it's published as Alpha. But I tested it again when I pushed it to Prod, it's still there. Did I miss anything with the configuration? Thanks!

OpenIAB.queryInventory();

Hi im try to implement Open IAB ,
how this command is used exactly? : OpenIAB.queryInventory() , is there any example of this?

When to call OpenIAB.restoreTransactions() function on IOS?

Hello, i'm a trying to add OPENIAB plugin to my IOS platform project and all i want to know is where i can put restoreTransactions() funtion on my project?
I need to put this function on Start() function or create a button to call restoreTransactions() or something else?

billingNotSupportedEvent not fired when offline

Hi

I just noticed, that billingNotSupportedEvent is not fired if the phone (on iOS) is in airplane mode.
Happens also if the network is really week.

Do I need to check for network before calling OpenIAB.init(options)?
What is the best practice to have a "restore purchased products" button which needs OpenIAB to be initialized to fire transactionRestoredEvent or restoreFailedEvent?

Greetings from Switzerland

apple app store support

Здравствуйте, спасибо за замечательный плагин. Я успешно добавил его в андроид версию нашей игры и теперь пытаюсь сделать тоже самое для ios версии. Скажите пожалуйста, на сколько хорошо работает ios версия? После беглого просмотра показалось что во многих местах стоят просто заглушки. Большая часть информации которая попадает в экземпляры класса Purchase на самом деле пустая. Никак не получить transactionReceipt, который мне нужен для валидации платежа на сервере.
Собираетесь ли вы дорабатывать эти вещи, есть ли у вас конкретный план работ, и могу ли я заняться этим? :)

Amazone InApp integration

hi,
am running the demo scene for amazone ,but its is not Initialize

here is the code

if (Button ("Initialize OpenIAB")) {
// Application public key
var publicKey = "cfffdec9f06b4c279e561c7fc9e54d92";

                    var options = new Options ();
                    options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
                    options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
                    options.checkInventory = false;
                    options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
                    options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };
                    options.availableStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };
                    options.storeKeys = new Dictionary<string, string>{{OpenIAB_Android.STORE_AMAZON,publicKey}};
                    //  options.storeKeys = new Dictionary<string, string> { {OpenIAB_Android.STORE_GOOGLE, publicKey} };
                    options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

                    // Transmit options and start the service
                    OpenIAB.init (options);
            }

Google Play purchase succeeded problem

Hello, the plugin for unity works. But after i purchase the same item again i get this.

D/OpenIAB-UnityPlugin(29613): Purchase finished: IabResult: 7, Unable to buy item (response: 7:Item Already Owned), purchase: null
E/OpenIAB-UnityPlugin(29613): Error purchasing: IabResult: 7, Unable to buy item (response: 7:Item Already Owned)

How to handle this message?? Its an unmanaged item.

call back method purchaseSucceededEvent is private

Thanks for help!

OpenIAB purchaseSucceedEvente error

Good Night,

I'm having with the OpenIAB in IOS that is getting me frustated because i use the same code in Android and works.

I have a item in the store named SwagPack and its product id is 921175603.
Until here its all normal.

If i put i my code the following lines of code:

OpenIAB.mapSku ("921175603", OpenIAB_iOS.STORE, "SwagPack");
OpenIAB.queryInventory(new string[] { "921175603" });

The app detects that the item exists in the store and I can get the price for it.
The problems start when I buy the item:

OpenIAB.purchaseProduct ("921175593");

The pluggin makes all the calls correctly but when the response comes back in this method

OnPurchaseSucceeded(string sku), the string sku is null and therefore i can't confirm the purchase.

But if put:

OpenIAB.mapSku ("SwagPack", OpenIAB_iOS.STORE, "921175603");
OpenIAB.queryInventory(new string[] { "921175603" });

The query result is empty and therefore I can't do anything.

I don't know what I'm doing wrong.

iOS "Cannot connect to iTunes Store"

Hi,

I am getting a "Cannot connect to iTunes Store" error when trying to purchase. I dont know why this is happening now, I used it for the first release of my app and everything worked fine. Now am I am doing an update with more IAP in it, I am getting this error. Any suggestions?

Adam

inventory.GetSkuDetails(SKU)

Hi i have the openiab plugin for Unity working fine in the google play store , and i received some purchases , but i´m try to get the item price before the people
buy the item . I try with ---> inventory.GetSkuDetails(SKU) , but this return null , the game is in the google play store 1 mont ago .

Regarding Amazon IAP Purchase event Listener

I am implementing Inapp purchase for amazon using openIAB 0.9.8.6 unitypackage , I am able to initialize it properly and see the AmazonSDK popup for buying particular item using AmazonSDK tester now the issue that I am facing is when I buy that item AmazonSDK popup shows Thank you for purchasing the item and after that when I close that popup I do not get the callback in

void purchaseSuccessfulEvent( AmazonReceipt receipt )

Wherease if I close that PopUp without purchasing I do get the callback properly
purchaseFailedEvent( string reason )

What am I doing wrong ? or is there anything that I am missing
Here's my code

   private static string tier1ProductIdentifier = "sku_lives10";
private static string tier2ProductIdentifier = "sku_lives30";
private static string tier3ProductIdentifier = "sku_lives50";
private static string tier4ProductIdentifier = "sku_removeads";
private UIScript uimanager;

void Awake(){
    exploreWorldButton = BtnExploreWorld;
}


private void OnEnable()
{
    // Listen to all events for illustration purposes
    OpenIABEventManager.billingSupportedEvent += billingSupportedEvent;
    OpenIABEventManager.billingNotSupportedEvent += billingNotSupportedEvent;
    OpenIABEventManager.queryInventorySucceededEvent += queryInventorySucceededEvent;
    OpenIABEventManager.queryInventoryFailedEvent += queryInventoryFailedEvent;
    OpenIABEventManager.purchaseSucceededEvent += purchaseSucceededEvent;
    OpenIABEventManager.purchaseFailedEvent += purchaseFailedEvent;
    OpenIABEventManager.consumePurchaseSucceededEvent += consumePurchaseSucceededEvent;
    OpenIABEventManager.consumePurchaseFailedEvent += consumePurchaseFailedEvent;
}

private void OnDisable()
{
    // Remove all event handlers
    OpenIABEventManager.billingSupportedEvent -= billingSupportedEvent;
    OpenIABEventManager.billingNotSupportedEvent -= billingNotSupportedEvent;
    OpenIABEventManager.queryInventorySucceededEvent -= queryInventorySucceededEvent;
    OpenIABEventManager.queryInventoryFailedEvent -= queryInventoryFailedEvent;
    OpenIABEventManager.purchaseSucceededEvent -= purchaseSucceededEvent;
    OpenIABEventManager.purchaseFailedEvent -= purchaseFailedEvent;
    OpenIABEventManager.consumePurchaseSucceededEvent -= consumePurchaseSucceededEvent;
    OpenIABEventManager.consumePurchaseFailedEvent -= consumePurchaseFailedEvent;
}


// Use this for initialization
void Start () {
    //AndroidMessage.Create ("IAP", "Start");
    // Map SKUs for Amazon
    OpenIAB.mapSku(tier1ProductIdentifier, OpenIAB_Android.STORE_AMAZON, "sku_lives10");
    OpenIAB.mapSku(tier2ProductIdentifier, OpenIAB_Android.STORE_AMAZON, "sku_lives30");
    OpenIAB.mapSku(tier3ProductIdentifier, OpenIAB_Android.STORE_AMAZON, "sku_lives50");
    OpenIAB.mapSku(tier4ProductIdentifier, OpenIAB_Android.STORE_AMAZON, "sku_removeads");

    var options = new Options();
    options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
    options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
    options.checkInventory = true;
    options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
    options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };
    options.availableStoreNames = new string[] { OpenIAB_Android.STORE_AMAZON };

    // Transmit options and start the service
    OpenIAB.init(options);

    this.tier1Price.text = "";
    this.tier2Price.text = "";
    this.tier3Price.text = "";
    this.tier4Price.text = "";

    uimanager = GameObject.Find ("UIManager").GetComponent<UIScript> ();


}

private void billingSupportedEvent()
{
    _isInitialized = true;

    OpenIAB.queryInventory(new string[] { tier1ProductIdentifier,tier2ProductIdentifier,tier3ProductIdentifier,tier4ProductIdentifier});

    Debug.Log("billingSupportedEvent");
}
private void billingNotSupportedEvent(string error)
{
    Debug.Log("billingNotSupportedEvent: " + error);
}
private void queryInventorySucceededEvent(Inventory inventory)
{
    Debug.Log("queryInventorySucceededEvent: " + inventory);
    if (inventory != null)
    {
        _inventory = inventory;
        skuDetails = inventory.GetAllAvailableSkus();

        for(int i=0; i< skuDetails.Count;i++){

            if(skuDetails[i].Sku == tier1ProductIdentifier){

                stier1Price=skuDetails[i].Price;
            }
            else if (skuDetails[i].Sku == tier2ProductIdentifier){
                stier2Price =skuDetails[i].Price;
            }
            else if (skuDetails[i].Sku == tier3ProductIdentifier){
                stier3Price =  skuDetails[i].Price;
            }
            else if (skuDetails[i].Sku == tier4ProductIdentifier){
                stier4Price =  skuDetails[i].Price;

                if(inventory.HasPurchase(tier4ProductIdentifier)) {
                    PlayerPrefs.SetInt ("DISABLEADS", 1);
                    exploreWorldButton.GetComponent<MoveButtonScriot>().removeAdsButton();

                    GA.API.Design.NewEvent ("Purchase" + ":" + "Get RemoveAds");
                }
            }
        }

    }
}
private void queryInventoryFailedEvent(string error)
{
    Debug.Log("queryInventoryFailedEvent: " + error);
}
private void purchaseSucceededEvent(Purchase purchase)
{
    Debug.Log("purchaseSucceededEvent: " + purchase);
    OpenIAB.consumeProduct(purchase);       

}
private void purchaseFailedEvent(int errorCode, string errorMessage)
{
    Debug.Log("purchaseFailedEvent: " + errorMessage);
}
private void consumePurchaseSucceededEvent(Purchase purchase)
{
    Debug.Log("consumePurchaseSucceededEvent: " + purchase);
    int diamondstoAdd = 0;

    if(purchase.Sku == tier1ProductIdentifier)
    {
        diamondstoAdd = 10;
        GA.API.Design.NewEvent("Purchase" + ":" + "Get 10");
    }
    else if(purchase.Sku == tier2ProductIdentifier)
    {
        diamondstoAdd = 30;
        GA.API.Design.NewEvent("Purchase" + ":" + "Get 30");
    }
    else if(purchase.Sku == tier3ProductIdentifier)
    {
        diamondstoAdd = 50;
        GA.API.Design.NewEvent("Purchase" + ":" + "Get 50");
    }
    else if(purchase.Sku == tier4ProductIdentifier)
    {
        PlayerPrefs.SetInt ("DISABLEADS", 1);
        exploreWorldButton.GetComponent<MoveButtonScriot>().removeAdsButton();
        GA.API.Design.NewEvent ("Purchase" + ":" + "Get RemoveAds");
        androidIAPScript sc = new androidIAPScript();
        sc.closeAds();
    }

    PlayerPrefs.SetInt("LIVES",PlayerPrefs.GetInt("LIVES") + diamondstoAdd);
    PlayerPrefs.Save();
}
private void consumePurchaseFailedEvent(string error)
{
    Debug.Log("consumePurchaseFailedEvent: " + error);
}

public void purchaseProduct (string sku){

    OpenIAB.purchaseProduct(sku);
}

Additional to that have few more questions , How to get prices of the items before hand I am trying in queryInvetory but unable to get the price of the items ?

And Whenever I click to buy item , it opens the new Activity is there any way I can make that activity transparent so it remains in my game only. ?

Events are not being triggered

I'm trying to use openIAB unity plugin but the events are not being triggered. I have the following code equal to the examples and none of the events are called:

private void OnEnable()
{
// Listen to all events for illustration purposes
OpenIABEventManager.billingSupportedEvent += billingSupportedEvent;
OpenIABEventManager.queryInventorySucceededEvent += queryInventorySucceededEvent;
OpenIABEventManager.purchaseSucceededEvent += purchaseSucceededEvent;
OpenIABEventManager.purchaseFailedEvent += purchaseFailedEvent;
OpenIABEventManager.consumePurchaseSucceededEvent += consumePurchaseSucceededEvent;
OpenIABEventManager.consumePurchaseFailedEvent += consumePurchaseFailedEvent;
}

Can someone tell me what I might be doing wrong?

Plugins colliding with each other?

I just downloaded OpenIAB into a new project and attempted to make a build of the 'OpenIAB-demo' scene, but got the following errors:

Plugin 'OpenIAB_W8Plugin.dll' is used from several locations:
Assets/Plugins/WP8/OpenIAB_W8Plugin.dll would be copied to <PluginPath>/OpenIAB_W8Plugin.dll
Assets/Plugins/OpenIAB_W8Plugin.dll would be copied to <PluginPath>/OpenIAB_W8Plugin.dll
Please fix plugin settings and try again.

Plugins colliding with each other.

This is using the latest 0.9.8.6 release, with Unity 5.0.0f4, and set to the Windows Phone 8 target.

Amazon IAP v2.0

Hello OpenIAB Team,

when will the unity plugin be updated for Amazon IAP v2.0?
I saw that Roman Zhilich developed something according that topic.
Can I integrate it by myself? If yes, how?

Thanks for the plugin. You did a great job 👍

best regards
Dennis

FAILURE: Build failed with an exception

I'm trying to build the Unity Plugin but the following error occurs:


FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':Unity Plugin:lintVitalRelease'.

    Illegal UTF8 string in constant pool in class file com/android/tools/lint/chec
    ks/SharedPrefsDetector$CommitFinder


I'm following the build instrunctions under Windows 8.1.
I'd like to give this plugin a try in my game.

Always have "billing is NOT supported" event

Dear developers,
I try to user you OpenIAB for Unity, but can't make it work for a long time. I used 9.7.1 before and at least queryInventory worked well, but purchaseProduct didn't lead to anything.
After upgrading to 9.8.6 it doesn't work at all! I always have "billing is not supported" event. I see that both my manager with OnePF working and your EventManager are alive, but nothing happens.

Amazon iap 1.0 and 2.0 mixed attributes

Hi all.

Im a bit confused.
OpenIAB is using the in-app-purchasing-2.0.1. But still is receiving responses as you are using the in-app-purchasing-1.x.
I mind:
After doing a purchase, the response is:
{"purchaseToken":"xxxxx","purchaseStatus":"SUCCESSFUL","orderId":"xxxxx","itemType":"CONSUMABLE","userId":"xxxxx","productId":"xxxxx"}

but according to https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/migrate-iapv1-apps-to-iapv2

purchaseToken should call receiptId (seems like your using v1.x)
BUT
your using productId instead of sku (seems your using v2.x)

Then, there are a mix of v1.x and v.2.x attributes and im getting errors on verify the purchase on amazon servers.

Any light you can shed here? Thanks!!!

Samsung store: 'No suitable app store was found'

We have successfully implemented iOS and Google Play IAP into our app, but we're having trouble getting Samsung IAP to work.
We're using the latest Unity plugin, the correct manifest permissions, the following options:

options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
options.availableStoreNames = new string[] {OpenIAB_Android.STORE_SAMSUNG};

Our app is on the Samsung store now, we have added IAP to it and purchased it ourselves, but when we look at the monitor we see the 'No suitable app store was found' error message.

Inconsistent SkuDetails from Google and Amazon stores

I was trying to show localized currency and price in my game and noticed a minor issue with inconsistent SkuDetails from Google and Amazon stores. While a hack-ish fix can be applied in the Unity Plugin code, the problem should probably be fixed in core OpenIAB.

SkuDetails from GOOGLE:

[SkuDetails: type = inapp, SKU = tree_1, title = Some Tree, price = $0.99, description = Unlock the premium tree, priceValue=0.99, currency=USD]

SkuDetails from AMAZON:

[SkuDetails: type = inapp, SKU = tree_1, title = Bruce Spruce, price = { "value": 0.99, "currency": "USD" }, description = Unlock the premium tree, priceValue=, currency=]

Problem with samsung app store

When I try to initialize the samsung app store via a plugin openIAB unity, a black screen appears, hangs a small amount of time and then disappears. At the next attempt to execute QueryInventroy exception occurs. Here is the text:

08-16 18:02:33.475: E/AndroidRuntime(14022): FATAL EXCEPTION: main
08-16 18:02:33.475: E/AndroidRuntime(14022): java.lang.Error: FATAL EXCEPTION [main]
08-16 18:02:33.475: E/AndroidRuntime(14022): Unity version     : 4.2.0f4
08-16 18:02:33.475: E/AndroidRuntime(14022): Device model      : samsung GT-I9300
08-16 18:02:33.475: E/AndroidRuntime(14022): Device fingerprint: samsung/m0xx/m0:4.1.2/JZO54K/I9300XXEMG4:user/release-keys
08-16 18:02:33.475: E/AndroidRuntime(14022): Caused by: java.lang.IllegalStateException: Wrong setup state: 3
08-16 18:02:33.475: E/AndroidRuntime(14022):    at org.onepf.oms.OpenIabHelper.setupStateToString(OpenIabHelper.java:1155)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at org.onepf.oms.OpenIabHelper.checkSetupDone(OpenIabHelper.java:1120)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1039)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at org.onepf.openiab.UnityPlugin$2.run(UnityPlugin.java:147)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at android.os.Handler.handleCallback(Handler.java:615)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at android.os.Handler.dispatchMessage(Handler.java:92)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at android.os.Looper.loop(Looper.java:137)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at android.app.ActivityThread.main(ActivityThread.java:4898)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at java.lang.reflect.Method.invokeNative(Native Method)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at java.lang.reflect.Method.invoke(Method.java:511)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-16 18:02:33.475: E/AndroidRuntime(14022):    at dalvik.system.NativeStart.main(Native Method)

I have a feeling that does not pass initialization samsung app store.
Here is the code I'm trying to initialize OpenIAB:

using UnityEngine;
using System.Collections;
using OnePF;
public class testOpenIab : MonoBehaviour {
    private const string LIVES_5 = "lives_5";
    private float _buttonSize;
    // Use this for initialization
    void Start () 
    {
        _buttonSize = Screen.width / 5;
        OpenIAB.enableDebugLogging(true);
        OpenIAB.mapSku(LIVES_5, OpenIAB_Android.STORE_SAMSUNG, "100000104177/000002");
        Options options = new Options();
        options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
        options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_SAMSUNG };
        OpenIAB.init(options);
    }

    private void OnEnable()
    {
        OpenIABEventManager.purchaseSucceededEvent += OnPurchaseSucceded;
        OpenIABEventManager.consumePurchaseSucceededEvent += OnConsumeSucceded;
        OpenIABEventManager.queryInventorySucceededEvent += OnQueryInventorySucceded;
        OpenIABEventManager.queryInventoryFailedEvent += OpenIABEventManager_queryInventoryFailedEvent;
        OpenIABEventManager.purchaseFailedEvent += OpenIABEventManager_purchaseFailedEvent;
        OpenIABEventManager.billingSupportedEvent += OpenIABEventManager_billingSupportedEvent;
    }

    private void OnDisable()
    {
        OpenIABEventManager.purchaseSucceededEvent -= OnPurchaseSucceded;
        OpenIABEventManager.consumePurchaseSucceededEvent -= OnConsumeSucceded;
        OpenIABEventManager.queryInventorySucceededEvent -= OnQueryInventorySucceded;
        OpenIABEventManager.queryInventoryFailedEvent -= OpenIABEventManager_queryInventoryFailedEvent;
        OpenIABEventManager.purchaseFailedEvent -= OpenIABEventManager_purchaseFailedEvent;
        OpenIABEventManager.billingSupportedEvent -= OpenIABEventManager_billingSupportedEvent;
    }

    void OpenIABEventManager_billingSupportedEvent()
    {
        Debug.Log("supported!");
    }

    private void OpenIABEventManager_purchaseFailedEvent(int i, string obj)
    {
        Debug.Log(obj);
    }

    private void OpenIABEventManager_queryInventoryFailedEvent(string obj)
    {
        Debug.Log(obj);
    }

    private void OnQueryInventorySucceded(Inventory inventory)
    {
        Debug.Log(inventory.ToString());
    }

    private void OnPurchaseSucceded(Purchase purchase)
    {
        OpenIAB.consumeProduct(purchase);
    }

    private void OnConsumeSucceded(Purchase purchase)
    {
        Debug.Log(purchase.OriginalJson);
    }

    private void OnGUI()
    {
        if (GUI.Button(new Rect(0, 0, _buttonSize, _buttonSize / 2), "query inventory"))
        {
            OpenIAB.queryInventory();
        }
        if (GUI.Button(new Rect(0, _buttonSize/2, _buttonSize, _buttonSize / 2), "purchase"))
        {
            OpenIAB.purchaseProduct(LIVES_5);
        }
    }
}

Samsung app store (renamed in GALAXY Apps) is installed on the test device. The requested item is created in the developer console samsung app store.
Maybe I forgot something at initialization?

[iOS] EXC_BAD_ACESS on SKPaymentTransactionStateFailed (AppStoreDelegate.mm)

Hi! Got this EXC_BAD_ACESS on SKPaymentTransactionStateFailed event on some devices. Reason is unknown, but sometimes transaction.error is null but here is access to transaction.error.localizedDescription. Please reffer to:
ivanacostarubio/helu#10
http://stackoverflow.com/questions/15426056/skpaymenttransactionstatefailed-but-no-nserror

My proposal is to fix AppStoreDelegate.mm (check if null):
case SKPaymentTransactionStateFailed:
if (transaction.error != nil)
{
if (transaction.error.code == SKErrorPaymentCancelled)
UnitySendMessage(EventHandler, "OnPurchaseFailed", MakeStringCopy("Transaction cancelled"));
else
UnitySendMessage(EventHandler, "OnPurchaseFailed", MakeStringCopy([[transaction.error localizedDescription] UTF8String]));
}
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
break;

Can't set up Play Store. Unity 5

Here is logs from device (android 5.0 emulator):

I/Unity   ( 2720): ********** Android OpenIAB plugin initialized **********
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/dex2oat ( 2769): /system/bin/dex2oat --runtime-arg -classpath --runtime-arg  -
-instruction-set=x86 --instruction-set-features=default --runtime-arg -Xrelocate
 --boot-image=/system/framework/boot.art --dex-file=/data/data/com.natakids.icec
reamcafe/cache/ads-1337908387.jar --oat-fd=42 --oat-location=/data/data/com.nata
kids.icecreamcafe/cache/ads-1337908387.dex --runtime-arg -Xms64m --runtime-arg -
Xmx512m
I/Unity   ( 2720): OpenIAB inited
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/LibraryLoader( 2720): Loading: webviewchromium
I/LibraryLoader( 2720): Time to load native libraries: 74 ms (timestamps 4393-44
67)
I/LibraryLoader( 2720): Expected native library version number "",actual native
library version number ""
V/WebViewChromiumFactoryProvider( 2720): Binding Chromium to main looper Looper
(main, tid 1) {3c42d0e1}
I/LibraryLoader( 2720): Expected native library version number "",actual native
library version number ""
I/chromium( 2720): [INFO:library_loader_hooks.cc(106)] Chromium logging enabled:
 level = 0, default verbosity = 0
I/BrowserStartupController( 2720): Initializing chromium process, renderers=0
W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/dex2oat ( 2769): Compilation of void com.google.android.ads.zxxz.a.<init>() to
ok 111.435ms
W/dex2oat ( 2769): Compilation of void com.google.android.ads.zxxz.c.<init>() to
ok 111.670ms
W/dex2oat ( 2769): Compilation of void com.google.android.ads.zxxz.b.<init>() to
ok 112.061ms
W/dex2oat ( 2769): Compilation of void com.google.android.ads.zxxz.d.<init>() to
ok 110.240ms
W/AudioManagerAndroid( 2720): Requires BLUETOOTH permission
W/chromium( 2720): [WARNING:resource_bundle.cc(315)] locale_file_path.empty()
I/dex2oat ( 2769): dex2oat took 169.765ms (threads: 4)
I/chromium( 2720): [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful,
fd=53 off=46092 len=2953
I/chromium( 2720): [INFO:aw_browser_main_parts.cc(78)] Loading webviewchromium.p
ak from, fd:42 off:228796 len:643667
W/chromium( 2720): [WARNING:mailbox_synchronizer.cc(36)] MailboxSync not support
ed due to missing EGL image/fence support
I/Ads     ( 2720): CsiReporterFactory: CSI is not enabled. No CSI reporter creat
ed.
I/Ads     ( 2720): Starting ad request.
I/Ads     ( 2720): Use AdRequest.Builder.addTestDevice("2761986DECB3DFE3CB491C94
2400F289") to get test ads on this device.
I/Ads     ( 2720): Please set theme of AdActivity to @android:style/Theme.Transl
ucent to enable transparent background interstitial ad.
D/OpenIAB-UnityPlugin( 2720): createBroadcasts
D/OpenIAB-UnityPlugin( 2720): Starting setup.
D/OpenIAB-UnityPlugin( 2720): Setup finished.
E/OpenIAB-UnityPlugin( 2720): Problem setting up in-app billing: IabResult: 3, N
o suitable appstore was found (response: 3:Billing Unavailable)
I/Unity   ( 2720): billing not supported: No suitable appstore was found (respon
se: 3:Billing Unavailable)
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/Unity   ( 2720): IAB ANDROID GOOGLE : com.google.play
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/Ads     ( 2720): CsiReporterFactory: CSI is not enabled. No CSI reporter creat
ed.
W/chromium( 2720): [WARNING:proxy_service.cc(901)] PAC support disabled because
there is no system implementation
W/chromium( 2720): [WARNING:data_reduction_proxy_settings.cc(403)] SPDY proxy OF
F at startup
W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/AwContents( 2720): onDetachedFromWindow called when already detached. Ignoring

W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/FlurryAgent( 2720): Analytics report sent.
I/chromium( 2720): [INFO:CONSOLE(0)] "Document was loaded from Application Cache
 with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sd
k-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/ma
d/sdk/native/sdk-core-v40.html (0)
I/chromium( 2720): [INFO:CONSOLE(0)] "Application Cache Checking event", source:
 https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.htm
l (0)
I/chromium( 2720): [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source:
 https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.htm
l (0)
W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/AwContents( 2720): onDetachedFromWindow called when already detached. Ignoring

W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/art     ( 2720): Attempt to remove local handle scope entry from IRT, ignoring

W/ScreenOrientationListener( 2720): Removing an inexistent observer!
I/Ads     ( 2720): Ad finished loading.
D/InitAlarmsService( 2567): Clearing and rescheduling alarms.
I/Unity   ( 2720): purchase button pressed
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/ActivityManager( 1693): START u0 {cmp=com.natakids.icecreamcafe/org.onepf.open
iab.UnityProxyActivity (has extras)} from uid 10061 on display 0
E/OpenIAB ( 2720): Illegal state for operation (launchPurchaseFlow): IAB helper
setup failed.
D/OpenIAB-UnityPlugin( 2720): Purchase finished: IabResult: 3, Cannot start purc
hase process. Billing unavailable. (response: 3:Billing Unavailable), purchase:
null
E/OpenIAB-UnityPlugin( 2720): Error purchasing: IabResult: 3, Cannot start purch
ase process. Billing unavailable. (response: 3:Billing Unavailable)
W/FlurryAgent( 2720): Flurry session resumed for context:org.onepf.openiab.Unity
ProxyActivity@1b6070bc
D/OpenIAB-UnityPlugin( 2720): Finish broadcast was received
W/InputMethodManagerService( 1693): Window already focused, ignoring focus gain
of: com.android.internal.view.IInputMethodClient$Stub$Proxy@29c2952e attribute=n
ull, token = android.os.BinderProxy@3fafab1e
W/FlurryAgent( 2720): Flurry session paused for context:org.onepf.openiab.UnityP
roxyActivity@1b6070bc
I/Unity   ( 2720): purhase failed : Cannot start purchase process. Billing unava
ilable. (response: 3:Billing Unavailable) 3
I/Unity   ( 2720):
I/Unity   ( 2720): (Filename: ./artifacts/generated/common/runtime/UnityEngineDe
bug.gen.cpp Line: 56)
I/Unity   ( 2720):
I/MediaFocusControl( 1693):  AudioFocus  abandonAudioFocus() from android.media.
[email protected]$3@9d71234
I/ActivityManager( 1693): Start proc com.android.musicfx for broadcast com.andro
id.musicfx/.ControlPanelReceiver: pid=2828 uid=10009 gids={50009, 9997, 3003, 30
02} abi=x86
V/MusicFXControlPanelReceiver( 2828): onReceive
V/MusicFXControlPanelReceiver( 2828): Action: android.media.action.CLOSE_AUDIO_E
FFECT_CONTROL_SESSION
V/MusicFXControlPanelReceiver( 2828): Package name: com.android.music
V/MusicFXControlPanelReceiver( 2828): Audio session: 6
V/MusicFXControlPanelEffect( 2828): closeSession(android.app.ReceiverRestrictedC
ontext@2972eb9c, com.android.music, 6)
I/ActivityManager( 1693): Killing 2190:com.android.music/u0a42 (adj 15): empty #
17
W/libprocessgroup( 1693): failed to open /acct/uid_10042/pid_2190/cgroup.procs:
No such file or directory

I set up OpenIAB on Start like this:

OpenIAB.mapSku(SKU_ADV_DISABLE, OpenIAB_Android.STORE_GOOGLE, "...");

var options = new Options();
options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
options.availableStoreNames = new[] { OpenIAB_Android.STORE_GOOGLE };
options.prefferedStoreNames = new[] { OpenIAB_Android.STORE_GOOGLE };
options.storeKeys = new Dictionary<string, string> {
    {
        OpenIAB_Android.STORE_GOOGLE,
        "MIIBIjA..."
    }
};
options.checkInventory = false;
options.storeSearchStrategy = SearchStrategy.INSTALLER_THEN_BEST_FIT;

OpenIAB.init(options);

Tried installing via

adb install -i com.myapp.bundle /path/to/apk

and

adb install -i com.google.play /path/to/apk

and even

adb install -i com.android.vending /path/to/apk

still same result.

Tried signing app with valid keystore and with debug keystore.

OpenIAB Xcode Build Error

Hello,

Im using Simple IAP and OpenIAB system.

Not problem Android system but i tried Xcode for IOS I have an error.

Please see attach file.

xcode2

How can i fix this?

Thanks.

Android 5 crashing

Hi, i have latest version of plugin 0.9.8 and everytime im calling function OpenIAB.queryInventory() aplication is starting again. In Google play we have 1star reviews from people with nexus 5 and nexus 9 only so its probably related to android 5, in older versions its workin fine.
Any chance to solve it ?

When i click the purchase button, no buy dialog appears.

I dragged the prefab to my MainMenu Scene Hierarchy and then on my MissionOptionsScript(this is where my unlock extra stage button is) I added the ff codes:

const string SKU = "sku";
string _label = "";
bool _isInitialized = false;


private void OnEnable()
{
    // Listen to all events for illustration purposes
    OpenIABEventManager.billingSupportedEvent += billingSupportedEvent;
    OpenIABEventManager.billingNotSupportedEvent += billingNotSupportedEvent;
    OpenIABEventManager.queryInventorySucceededEvent += queryInventorySucceededEvent;
    OpenIABEventManager.queryInventoryFailedEvent += queryInventoryFailedEvent;
    OpenIABEventManager.purchaseSucceededEvent += purchaseSucceededEvent;
    OpenIABEventManager.purchaseFailedEvent += purchaseFailedEvent;
    OpenIABEventManager.consumePurchaseSucceededEvent += consumePurchaseSucceededEvent;
    OpenIABEventManager.consumePurchaseFailedEvent += consumePurchaseFailedEvent;
}

private void OnDisable()
{
    // Remove all event handlers
    OpenIABEventManager.billingSupportedEvent -= billingSupportedEvent;
    OpenIABEventManager.billingNotSupportedEvent -= billingNotSupportedEvent;
    OpenIABEventManager.queryInventorySucceededEvent -= queryInventorySucceededEvent;
    OpenIABEventManager.queryInventoryFailedEvent -= queryInventoryFailedEvent;
    OpenIABEventManager.purchaseSucceededEvent -= purchaseSucceededEvent;
    OpenIABEventManager.purchaseFailedEvent -= purchaseFailedEvent;
    OpenIABEventManager.consumePurchaseSucceededEvent -= consumePurchaseSucceededEvent;
    OpenIABEventManager.consumePurchaseFailedEvent -= consumePurchaseFailedEvent;
}

//Inside Fixed Update()..
if(unlockExtraStage){

            // Application public key
            var publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg7gQgIkgnshGs/nriOa40ecC+6qyzFQ15Ux8Z2URgvZlMi47Rbi4Pf9VPSnIqxYqmfn40qgo/DkSnObnPQT+QnHw/5otzXVAdTs+hXe9xCCXny8e/80Dbun1DCh8CQfg7bbvYF3SGcL+rK19OIlD261wZCt1UihYS62KbWM/765n3OXvQ44Qi0H4Xcmmvv+XtY6dZC5vM91yihPqHe7zFM3DnTq6J4+ZU+lO+xQNk7/ti6Rgk9XdzZ2bqZhacLx9XTbCjZe3TOF2Ta6vAxN6xO1rZl241b3yEkdJ7SUAiIx4Eh3beGSjCyA94GTX3tzzJwdgowIDAQAB";

            var options = new Options();
            options.checkInventoryTimeoutMs = Options.INVENTORY_CHECK_TIMEOUT_MS * 2;
            options.discoveryTimeoutMs = Options.DISCOVER_TIMEOUT_MS * 2;
            options.checkInventory = false;
            options.verifyMode = OptionsVerifyMode.VERIFY_SKIP;
            options.prefferedStoreNames = new string[] { OpenIAB_Android.STORE_GOOGLE};
            options.storeKeys = new Dictionary<string, string> { {OpenIAB_Android.STORE_GOOGLE, publicKey} };

            // Transmit options and start the service
            OpenIAB.init(options);


            OpenIAB.purchaseProduct("android.test.purchased");


            unlockExtraStage = false;
        }

OpenIAB not working on IOS.

After create items from itunesconnect.apple.com
In my Unity project i call:
const string noads_item2 = "2noads_item";
const string x2coin_item_stt_1 = "2x2coin_item_stt_2";
Start()
{
OpenIAB.mapSku(noads_item2, OpenIAB_iOS.STORE, noads_item2);
OpenIAB.mapSku (x2coin_item_stt_1, OpenIAB_iOS.STORE, x2coin_item_stt_1);
}
Void OnMouseDown()
{
if(gameobject.name=="removead_btn")
{
OpenIAB.purchaseProduct (noads_item2);
}
else if(gameobject.name=="x2coin_btn")
{
OpenIAB.purchaseProduct (x2coin_item_stt_1);
}
}
then i build this example project by xcode 6(add Storekit framework) to ipa and then install to my iphone device but still get no effect, what i was wrong here? sorry for my bad english if something wrong

Google IAP Issue

I'm getting this when I try to make a purchase:

I/Unity (13655): AndroidJavaException: java.lang.ClassNotFoundException: org.onepf.openiab.UnityPlugin
I/Unity (13655): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject](System.String methodName, System.Object[] args) [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject](System.String methodName, System.Object[] args) [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in :0
I/Unity (13655): at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in :0
I/Unity (13655): at OnePF.OpenIAB_Android..cctor () [0x00000] in :0

Any help would be greatly appreciated. Thanks.

Windows Phone crash

When I press buy button in the app, and invoke purchase function, the game goes to background, the dialog of the store pop up and after a while the application crash on the store, also the store dialog is disappearing. It only happens on windows phone, the plugin works perfectly on android and iOS. Do you know what might be the problem?

How can I retrieve the "already bought" status from the Google Play server and incorporate it in my code

Google's developer page says
Managed in-app products are items that have their ownership information tracked and managed by Google Play. When a user purchases a managed in-app item, Google Play stores the purchase information for each item on a per-user basis. This enables you to later query Google Play at any time to restore the state of the items a specific user has purchased. This information is persistent on the Google Play servers even if the user uninstalls the application or if they change devices.

I'm planning to code something like
if(alreadyBoughtStageFive){
unlockStageFive();
}
in case the player uninstall and install the app again, or delete the app's data.

What I have now is when a user install-boughtStageFive-uninstall the app, and install it again, the user is
required again to buy the stage to unlock it. I'm thinking of changing this.

This item is already owned

Hi,

i am getting issue "This item is already owned" using this repro:

  1. Purchasing product, when password is provided -> simulating lost connection(turning off wi-fi);
  2. Failed to purchase event, user is charged, but item is not consumed;
  3. In inventory there are no item in purchase map, but when trying to purchase one more time this product, google says, that it is already owned;

Temporary fix for me is to clear google play cache, the purchased item appears in purchase map and I could consume it, but there is no another way to get this work.

Plugin version is 0.9.8.6. Android 5.0.2

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.