Closed OmerCeliker closed 9 years ago
The following was missing from AndroidManifest.xml, I am closing this issue.
<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>
I followed the instructions at this link. https://github.com/onepf/OpenIAB-Unity-Plugin/wiki/How-to-use-OpenIAB-Unity-Plugin-with-Google-Play OpenIAB can connect to the google store and get the list of inventory okay but inapp purchase pop up will not display.
Please help with the issue mentioned in the title. Thank you.
I notice there are 2 manifest files in the project. AndroidManifest.xml and AndroidManifest 1.xml
Partial view from AndroidManifest.xml
Partial view from AndroidManifest 1.xml
The file I modified is below.
/***
using UnityEngine; using OnePF; using System.Collections.Generic; using System; using System.IO; /**
Example of OpenIAB usage */ public class OpenIABTest : MonoBehaviour { const string SKU = "sku";
string _label = "Not initialized"; bool _isInitialized = false; Inventory _inventory = null;
void appendLog(string log){
}
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; }
private void Start() { // Map skus for different stores
OpenIAB.mapSku(SKU, OpenIAB_Android.STORE_GOOGLE, "sku");
}
const float X_OFFSET = 10.0f; const float Y_OFFSET = 10.0f; const int SMALL_SCREEN_SIZE = 800; const int LARGE_FONT_SIZE = 34; const int SMALL_FONT_SIZE = 24; const int LARGE_WIDTH = 380; const int SMALL_WIDTH = 160; const int LARGE_HEIGHT = 100; const int SMALL_HEIGHT = 40;
int _column = 0; int _row = 0;
private bool Button(string text) { float width = Screen.width / 2.0f - X_OFFSET * 2; float height = (Screen.width >= SMALL_SCREEN_SIZE || Screen.height >= SMALL_SCREEN_SIZE) ? LARGE_HEIGHT : SMALL_HEIGHT;
}
private void OnGUI() { _column = 0; _row = 0;
// Android specific buttons
if UNITY_ANDROID
endif
}
I created a log file for events that gets captured. The log is below.
called OpenIAB.init billingSupportedEvent initialized Test Consume Test Purchase Purchase Product Query Inventory Purchase Product queryInventorySucceededEvent: {purchaseMap:{},skuMap:{"sku":{[SkuDetails: type = inapp, SKU ...