Quantcast
Channel: Questions in topic: "iap"
Viewing all 595 articles
Browse latest View live

In App Purchases works on Andriod but not IOS,Unity In App Purchases Script works for Andriod devices but not Iphone

$
0
0
Hello, my dev team has recently published our game to the Google Play Store and the Apple App Store. However, we are running into the problem where whenever we try to submit a build to the Apple store that contains In App Purchases, we are rejected by Apple, with a statement saying that our IAP is broke, along with a screenshot showing our In-Game shop failing to display the prices and purchase buttons. Here is the code for our IAP, along with the screenshot apple provided. If anybody else has experienced this problem, any help would be greatly appreciated. using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Purchasing; using Drill; public class IAP_Manager : Singleton, IStoreListener { private static IStoreController m_StoreController; // The Unity Purchasing system. private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems. public string gem_5 = "com.drillbitstudios.notadrill.gem_5"; public string gem_30 = "com.drillbitstudios.notadrill.gem_30"; public string gem_70 = "com.drillbitstudios.notadrill.gem_70"; public string gem_150 = "com.drillbitstudios.notadrill.gem_150"; public string gem_400 = "com.drillbitstudios.notadrill.gem_400"; public string starterbundle = "com.drillbitstudios.notadrill.starterbundle"; public string jetpack = "jetpack"; public string ghost = "ghost"; public string tnt = "tnt"; public string magnet = "magnet"; public string shield = "shield"; private GameManager GameManager; // Apple App Store-specific product identifier for the subscription product. private static string kProductNameAppleSubscription = "com.unity3d.subscription.new"; // Google Play Store-specific product identifier subscription product. private static string kProductNameGooglePlaySubscription = "com.unity3d.subscription.original"; void Start() { // If we haven't set up the Unity Purchasing reference if (m_StoreController == null) { // Begin to configure our connection to Purchasing InitializePurchasing(); } } public void InitializePurchasing() { // If we have already connected to Purchasing ... if (IsInitialized()) { // ... we are done here. return; } // Create a builder, first passing in a suite of Unity provided stores. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); // Add a product to sell / restore by way of its identifier, associating the general identifier // with its store-specific identifiers. builder.AddProduct(gem_5, ProductType.Consumable); builder.AddProduct(gem_30, ProductType.Consumable); builder.AddProduct(gem_70, ProductType.Consumable); builder.AddProduct(gem_150, ProductType.Consumable); builder.AddProduct(gem_400, ProductType.Consumable); // Continue adding the non-consumable product. builder.AddProduct(starterbundle, ProductType.Consumable); // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed. UnityPurchasing.Initialize(this, builder); } public bool IsInitialized() { // Only say we are initialized if both the Purchasing references are set. return m_StoreController != null && m_StoreExtensionProvider != null; } public void Buy5Gems() { BuyProductID(gem_5); } public void Buy30Gems() { BuyProductID(gem_30); } public void Buy70Gems() { BuyProductID(gem_70); } public void Buy150Gems() { BuyProductID(gem_150); } public void Buy400Gems() { BuyProductID(gem_400); } public void BuyBundle() { BuyProductID(starterbundle); } public string GetPublicPriceFromStore(string id) { if (m_StoreController != null && m_StoreController.products != null) { return m_StoreController.products.WithID(id).metadata.localizedPriceString; } else { return ""; } } void BuyProductID(string productId) { // If Purchasing has been initialized ... if (IsInitialized()) { // ... look up the Product reference with the general product identifier and the Purchasing // system's products collection. Product product = m_StoreController.products.WithID(productId); // If the look up found a product for this device's store and that product is ready to be sold ... if (product != null && product.availableToPurchase) { Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id)); // ... buy the product. Expect a response either through ProcessPurchase or OnPurchaseFailed // asynchronously. m_StoreController.InitiatePurchase(product); } // Otherwise ... else { // ... report the product look-up failure situation Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase"); } } // Otherwise ... else { // ... report the fact Purchasing has not succeeded initializing yet. Consider waiting longer or // retrying initiailization. Debug.Log("BuyProductID FAIL. Not initialized."); } } // Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google. // Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt. public void RestorePurchases() { // If Purchasing has not yet been set up ... if (!IsInitialized()) { // ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization. Debug.Log("RestorePurchases FAIL. Not initialized."); return; } // If we are running on an Apple device ... if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.OSXPlayer) { // ... begin restoring purchases Debug.Log("RestorePurchases started ..."); // Fetch the Apple store-specific subsystem. var apple = m_StoreExtensionProvider.GetExtension(); // Begin the asynchronous process of restoring purchases. Expect a confirmation response in // the Action below, and ProcessPurchase if there are previously purchased products to restore. apple.RestoreTransactions((result) => { // The first phase of restoration. If no more responses are received on ProcessPurchase then // no purchases are available to be restored. Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore."); }); } // Otherwise ... else { // We are not running on an Apple device. No work is necessary to restore purchases. Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform); } } // // --- IStoreListener // public void OnInitialized(IStoreController controller, IExtensionProvider extensions) { // Purchasing has succeeded initializing. Collect our Purchasing references. Debug.Log("OnInitialized: PASS"); // Overall Purchasing system, configured with products for this application. m_StoreController = controller; // Store specific subsystem, for accessing device-specific store features. m_StoreExtensionProvider = extensions; } public void OnInitializeFailed(InitializationFailureReason error) { // Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user. Debug.Log("OnInitializeFailed InitializationFailureReason:" + error); } public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // A consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, gem_5, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(5); } // Or ... a non-consumable product has been purchased by this user. else if (String.Equals(args.purchasedProduct.definition.id, gem_30, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(30); } else if (String.Equals(args.purchasedProduct.definition.id, gem_70, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(70); } else if (String.Equals(args.purchasedProduct.definition.id, gem_150, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(150); } else if (String.Equals(args.purchasedProduct.definition.id, gem_400, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(400); } else if (String.Equals(args.purchasedProduct.definition.id, starterbundle, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); GameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent(); Drill.GameManager.AddGems(10); if (GameManager.ghostUpgrades < 2) { GameManager.ghostUpgrades = 2; PlayerPrefs.SetInt("GhostUpgrades", 2); } if (GameManager.TNTUpgrades < 2) { GameManager.TNTUpgrades = 2; PlayerPrefs.SetInt("TNTUpgrades", 2); } if (GameManager.shieldUpgrades < 2) { GameManager.shieldUpgrades = 2; PlayerPrefs.SetInt("ShieldUpgrades", 2); } if (GameManager.jetUpgrades < 2) { GameManager.jetUpgrades = 2; PlayerPrefs.SetInt("JetPackUpgrades", 2); } if (GameManager.magnetUpgrades < 2) { GameManager.magnetUpgrades = 2; PlayerPrefs.SetInt("MagnetUpgrades", 2); } Drill.GameManager.AddJetPowerup(); Drill.GameManager.AddMagnetPowerup(); Drill.GameManager.AddGhostPowerup(); Drill.GameManager.AddShieldPowerup(); Drill.GameManager.AddTntPowerup(); } // Or ... a subscription product has been purchased by this user. // Or ... an unknown product has been purchased by this user. Fill in additional products here.... else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating whether this product has completely been received, or if the application needs // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still // saving purchased products to the cloud, and when that save is delayed. return PurchaseProcessingResult.Complete; } public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) { // A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing // this reason with the user to guide their troubleshooting actions. Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason)); } } ,Hello, I am trying to implement In App Purchases into my game. My team has recently published our game to both the Google Play Store and the Apple App Store. As stated in the title, IAP work completely in the Google Play Store, but every time we try and submit a build with the IAP to the Apple Store, we are denied with a statement saying that the IAP doesn't work, and fails to display the prices in our in-game shop's UI, despite being fully functional and successfully displaying in the Unity Editor and on Android devices. Here is the code for our IAP script along with a screenshot that apple provided us of the in-game shop not working: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Purchasing; using Drill; public class IAP_Manager : Singleton, IStoreListener { private static IStoreController m_StoreController; // The Unity Purchasing system. private static IExtensionProvider m_StoreExtensionProvider; // The store-specific Purchasing subsystems. public string gem_5 = "com.drillbitstudios.notadrill.gem_5"; public string gem_30 = "com.drillbitstudios.notadrill.gem_30"; public string gem_70 = "com.drillbitstudios.notadrill.gem_70"; public string gem_150 = "com.drillbitstudios.notadrill.gem_150"; public string gem_400 = "com.drillbitstudios.notadrill.gem_400"; public string starterbundle = "com.drillbitstudios.notadrill.starterbundle"; public string jetpack = "jetpack"; public string ghost = "ghost"; public string tnt = "tnt"; public string magnet = "magnet"; public string shield = "shield"; private GameManager GameManager; // Apple App Store-specific product identifier for the subscription product. private static string kProductNameAppleSubscription = "com.unity3d.subscription.new"; // Google Play Store-specific product identifier subscription product. private static string kProductNameGooglePlaySubscription = "com.unity3d.subscription.original"; void Start() { // If we haven't set up the Unity Purchasing reference if (m_StoreController == null) { // Begin to configure our connection to Purchasing InitializePurchasing(); } } public void InitializePurchasing() { // If we have already connected to Purchasing ... if (IsInitialized()) { // ... we are done here. return; } // Create a builder, first passing in a suite of Unity provided stores. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); // Add a product to sell / restore by way of its identifier, associating the general identifier // with its store-specific identifiers. builder.AddProduct(gem_5, ProductType.Consumable); builder.AddProduct(gem_30, ProductType.Consumable); builder.AddProduct(gem_70, ProductType.Consumable); builder.AddProduct(gem_150, ProductType.Consumable); builder.AddProduct(gem_400, ProductType.Consumable); // Continue adding the non-consumable product. builder.AddProduct(starterbundle, ProductType.Consumable); // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed. UnityPurchasing.Initialize(this, builder); } public bool IsInitialized() { // Only say we are initialized if both the Purchasing references are set. return m_StoreController != null && m_StoreExtensionProvider != null; } public void Buy5Gems() { BuyProductID(gem_5); } public void Buy30Gems() { BuyProductID(gem_30); } public void Buy70Gems() { BuyProductID(gem_70); } public void Buy150Gems() { BuyProductID(gem_150); } public void Buy400Gems() { BuyProductID(gem_400); } public void BuyBundle() { BuyProductID(starterbundle); } public string GetPublicPriceFromStore(string id) { if (m_StoreController != null && m_StoreController.products != null) { return m_StoreController.products.WithID(id).metadata.localizedPriceString; } else { return ""; } } void BuyProductID(string productId) { // If Purchasing has been initialized ... if (IsInitialized()) { // ... look up the Product reference with the general product identifier and the Purchasing // system's products collection. Product product = m_StoreController.products.WithID(productId); // If the look up found a product for this device's store and that product is ready to be sold ... if (product != null && product.availableToPurchase) { Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id)); // ... buy the product. Expect a response either through ProcessPurchase or OnPurchaseFailed // asynchronously. m_StoreController.InitiatePurchase(product); } // Otherwise ... else { // ... report the product look-up failure situation Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase"); } } // Otherwise ... else { // ... report the fact Purchasing has not succeeded initializing yet. Consider waiting longer or // retrying initiailization. Debug.Log("BuyProductID FAIL. Not initialized."); } } // Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google. // Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt. public void RestorePurchases() { // If Purchasing has not yet been set up ... if (!IsInitialized()) { // ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization. Debug.Log("RestorePurchases FAIL. Not initialized."); return; } // If we are running on an Apple device ... if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.OSXPlayer) { // ... begin restoring purchases Debug.Log("RestorePurchases started ..."); // Fetch the Apple store-specific subsystem. var apple = m_StoreExtensionProvider.GetExtension(); // Begin the asynchronous process of restoring purchases. Expect a confirmation response in // the Action below, and ProcessPurchase if there are previously purchased products to restore. apple.RestoreTransactions((result) => { // The first phase of restoration. If no more responses are received on ProcessPurchase then // no purchases are available to be restored. Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore."); }); } // Otherwise ... else { // We are not running on an Apple device. No work is necessary to restore purchases. Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform); } } // // --- IStoreListener // public void OnInitialized(IStoreController controller, IExtensionProvider extensions) { // Purchasing has succeeded initializing. Collect our Purchasing references. Debug.Log("OnInitialized: PASS"); // Overall Purchasing system, configured with products for this application. m_StoreController = controller; // Store specific subsystem, for accessing device-specific store features. m_StoreExtensionProvider = extensions; } public void OnInitializeFailed(InitializationFailureReason error) { // Purchasing set-up has not succeeded. Check error for reason. Consider sharing this reason with the user. Debug.Log("OnInitializeFailed InitializationFailureReason:" + error); } public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // A consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, gem_5, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(5); } // Or ... a non-consumable product has been purchased by this user. else if (String.Equals(args.purchasedProduct.definition.id, gem_30, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(30); } else if (String.Equals(args.purchasedProduct.definition.id, gem_70, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(70); } else if (String.Equals(args.purchasedProduct.definition.id, gem_150, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(150); } else if (String.Equals(args.purchasedProduct.definition.id, gem_400, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); Drill.GameManager.AddGems(400); } else if (String.Equals(args.purchasedProduct.definition.id, starterbundle, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); GameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent(); Drill.GameManager.AddGems(10); if (GameManager.ghostUpgrades < 2) { GameManager.ghostUpgrades = 2; PlayerPrefs.SetInt("GhostUpgrades", 2); } if (GameManager.TNTUpgrades < 2) { GameManager.TNTUpgrades = 2; PlayerPrefs.SetInt("TNTUpgrades", 2); } if (GameManager.shieldUpgrades < 2) { GameManager.shieldUpgrades = 2; PlayerPrefs.SetInt("ShieldUpgrades", 2); } if (GameManager.jetUpgrades < 2) { GameManager.jetUpgrades = 2; PlayerPrefs.SetInt("JetPackUpgrades", 2); } if (GameManager.magnetUpgrades < 2) { GameManager.magnetUpgrades = 2; PlayerPrefs.SetInt("MagnetUpgrades", 2); } Drill.GameManager.AddJetPowerup(); Drill.GameManager.AddMagnetPowerup(); Drill.GameManager.AddGhostPowerup(); Drill.GameManager.AddShieldPowerup(); Drill.GameManager.AddTntPowerup(); } // Or ... a subscription product has been purchased by this user. // Or ... an unknown product has been purchased by this user. Fill in additional products here.... else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating whether this product has completely been received, or if the application needs // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still // saving purchased products to the cloud, and when that save is delayed. return PurchaseProcessingResult.Complete; } public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) { // A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing // this reason with the user to guide their troubleshooting actions. Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason)); } } ![alt text][1] [1]: /storage/temp/162270-help.png

can i use Unity IAP in kitkat?

$
0
0
hi I want to do Unity iap on Android KitKat, but the machine I'm testing is Galaxy S3. But everything else is normal, but if I attach Unity IAP, the app crashes on my S3. Looking at the logcat... ----- -------------------------------------------------------------------- ------ E/cutils ( 1960): Failed to mkdirat(/storage/extSdCard/Android): Read-only file system W/ContextImpl(19393): Failed to ensure directory: /storage/extSdCard/Android/data/xxx/cache W/Vold ( 1960): Returning OperationFailed - no handler for errno 30 I/SwappyCommon(19393): Swappy version 1.3 I/SwappyCommon(19393): SDK version = 19 E/SwappyCommon(19393): Error while getting method: getAppVsyncOffsetNanos E/Swappy (19393): SwappyCommon could not initialize correctly. E/Swappy (19393): Failed to initialize SwappyGL E/CRASH (19393): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** E/CRASH (19393): Version '2019.4.0f1 (0af376155913)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' E/CRASH (19393): Build fingerprint: 'samsung/c1skt/c1skt:4.4.4/KTU84P/E210SKSUKOL2:user/release-keys' E/CRASH (19393): Revision: '14' E/CRASH (19393): ABI: 'arm' E/CRASH (19393): Timestamp: 2020-06-19 19:36:51+0900 E/CRASH (19393): pid: 19393, tid: 19415, name: UnityMain >>> xxx <<< E/CRASH (19393): uid: 10226 E/CRASH (19393): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 E/CRASH (19393): Cause: null pointer dereference E/CRASH (19393): r0 00000000 r1 00000000 r2 00000000 r3 45a3e6c8 E/CRASH (19393): r4 695106c0 r5 00000000 r6 64494304 r7 1d20042e E/CRASH (19393): r8 647de904 r9 647df240 r10 647df66c r11 647df67c E/CRASH (19393): ip 00000003 sp 647de868 lr 63f66ce5 pc 63f66cec E/CRASH (19393): E/CRASH (19393): backtrace: E/CRASH (19393): #00 pc 00713cec /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #01 pc 00708de9 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #02 pc 0023eacb /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #03 pc 00253f6b /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #04 pc 0024891f /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #05 pc 00257479 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #06 pc 00249d3d /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #07 pc 0024a761 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #08 pc 002586b5 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #09 pc 0001ec0c /system/lib/libdvm.so (dvmPlatformInvoke+112) E/CRASH (19393): #10 pc 0004f1ab /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) E/CRASH (19393): #11 pc 00028020 /system/lib/libdvm.so E/CRASH (19393): #12 pc 0002f004 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76) E/CRASH (19393): #13 pc 0002c69c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) E/CRASH (19393): #14 pc 00061611 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336) E/CRASH (19393): #15 pc 00061635 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) E/CRASH (19393): #16 pc 0005630f /system/lib/libdvm.so E/CRASH (19393): #17 pc 0000d2a0 /system/lib/libc.so (__thread_entry+72) E/CRASH (19393): #18 pc 0000d438 /system/lib/libc.so (pthread_create+240) ----- -------------------------------------------------------------------- ------ When it tried to call "getAppVsyncOffsetNanos", it crashed. When I looked for this function, this function was added in Android SDK 21. https://developer.android.com/reference/android/view/Display#getAppVsyncOffsetNanos() I definitely set the minimum SDK level to 19 (kitkat) But it is calling SDK 21. I thought Unity was upgrading a version of the minimum sdk somewhere, so I looked up the documentation and found this in the IAP documentation. ----- -------------------------------------------------------------------- ------ ## [1.11.0] - 2017-05-01 ### Added - FacebookStore - Facebook Gameroom Payments Lite support. Available on Unity 5.6+ when building for Facebook Platform on Gameroom (Windows) and WebGL. Preliminary documentation is available [here](https://docs.google.com/document/d/1FaYwKvdnMHxkh47YVuXx9dMbc6ZtLX53mtgyAIn6WfU/) - Apple platforms - Added experimental support for setting "simulatesAskToBuyInSandbox". Please let us know how this impacts ask-to-buy testability for you. ```csharp extensions.GetExtension().simulateAskToBuy = true; ``` - Apple platforms - Added support for setting "applicationUsername" field which will be added to every payment request to help the store detect fraud. ```csharp // Set the applicationUsername to help Apple detect fraud extensions.GetExtension().SetApplicationUsername(hashedUsername); ``` ### Requirement - GooglePlay - "Android SDK API Level 24 (7.0)" (or higher) must now be installed. To upgrade, either perform the one-time step of setting the project's "Android Player Settings > Other Settings > Minimum API Level" to 24, building an APK, then resetting to the project's previous value. Or, run the `android` Android SDK Manager tool manually and install "Android 7.0 (API 24)". Addresses build error messages: "Unable to merge android manifests." and "Main manifest has \ but library uses targetSdkVersion='24'". Note the Minimum API Level support is unchanged; merely the installation of API 24 SDK is now required for Daydream VR. ### Fixed - GooglePlay Daydream VR - Uses decoration-free Activity for purchasing - GooglePlay - Avoids sporadic price serialization exception - Apple App Stores - Improve handling of the situation where an attempt to finish a transaction fails (if the user is signed out of the store and cancels the sign in dialog, for example). The Apple store implementation will now remember that the transaction should be finished, and attempt to call finishTransaction again if the transaction is retrieved from the queue again. When this happens, the store will call OnPurchaseFailed with the reason "DuplicateTransaction"—this prevents a situation where a call to InitiatePurchase could result in no call to ProcessPurchase or OnPurchaseFailed. - Amazon - Fix for a crash when loading product metadata for subscription parent products ----- -------------------------------------------------------------------- ------ According to the above article, when the IAP becomes version 1.11, the Android sdk API version should be 24 or higher. This is too high to be called the minimum version. Is this true? Even if it's true, I should be able to run my application on kitkat. what can i do?

Unity IAP not finding StandardPurchasingModule or IAppleExtensions

$
0
0
I've recently upgraded my project to unity 2019 lts and I've been working through the bugs that have come up from the upgrade so far, but I've ran into this new bug I don't know how to fix. I'm getting these errors in my console: Assets/Scripts/Shop/ShopManager.cs(235,53): error CS0103: The name 'StandardPurchasingModule' does not exist in the current context Assets/Scripts/Shop/ShopManager.cs(297,61): error CS0246: The type or namespace name 'IAppleExtensions' could not be found (are you missing a using directive or an assembly reference?) Any help would be much appreciated.

UNITY IAP SERVICES NOT WORKING

$
0
0
Hi i am trying to add unity IAP service to my project but it not showing any organization to create unity project ID See Attachment: https://drive.google.com/file/d/1uMCFrHIg7Y5coYdmfUibr4TdmwCUJo5R/view?usp=sharing

Codeless IAP: PurchaseFailureReason.Unknown for iOS

$
0
0
I am using Codeless IAP. On Android, Codeless IAP is working fine with our Beta deployment. On iOS, I keep getting the error "PurchaseFailureReason.Unknown". In the logs I'm seeing the following error code: "UnityIAP: PurchaseFailed: 0" Seeing this behavior both in the Sandbox environment and with TestFlight. I've already completed the following steps: 1. Added all products in AppStoreConnect, and verified that all products are listed as "Ready to Submit" 2. Accepted the "Paid Apps" agreement in App Store Connect 3. Filled out all the Tax/Banking info in App Store Connect 4. Using "Automatically manage signing" within Xcode. I added "In-App Purchase" in the "Capabilities" section 5. Validated that IAP initialization is not throwing errors. I'm seeing "UnityIAP: Received 4 products" in the logs, which makes it seem like IAP is initializing fine. In both Sandbox and TestFlight, I am seeing the behavior where I get the "Confirm Your In-App Purchase" prompt. I type in the appropriate password, and then I get the same password prompt again. After I type in the password a second time, then I see the "Done" message with a checkmark within the prompt, but I then get the "PurchaseFailureReason.Unknown" message inside the "OnPurchaseFailed" handler. Any ideas what I might be missing?

Codeless IAP works on Testflight But doesn't on release

$
0
0
Hello, Everyone We are using codeless iap on iphone, and everything works normally on testflight, but when we released the game and tried to buy it as users, the result was instant purchase failed, we tried several different iphones and same result. Did anyone have this problem? What can be the reason? Thank you In advance.

App Crash on Android 11 Devices

$
0
0
Please help, my unity game crash when I build on Android 11 (API 30) devices. Android version below 10 is working fine. I am using Unity 2020.1.1f1. Minimum API Level (API 19), target API Level (API 30). *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** These are some of the packages I just updated recently which I think it might be the issue, but I am not sure about it. Firebase App (Core), Firebase Crashlytics, Firebase Authentication, Cloud Firestore For Firebase (All Ver 6.15.2) External Dependancy Manager for Unity Ver 1.2.1 Advertisement (Unity Ads) Ver 3.4.9 In App Purchasing Ver 2.1.1 *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** The tombstone file is attached below, here are part of it. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Version '2020.1.1f1 (2285c3239188)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' Build fingerprint: 'google/sdk_gphone_x86_arm/generic_x86_arm:11/RSR1.200819.001.A1/6823625:userdebug/dev-keys' Revision: '0' ABI: 'arm' Timestamp: 2020-09-25 01:35:50+1000 pid: 16859, tid: 16902, name: UnityMain >>> com.aubjective.jobmania <<< uid: 10157 signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xebaa11a0 r0 00000001 r1 ebf84a00 r2 00003435 r3 aee40f10 r4 ebaa11a0 r5 00000001 r6 aefc6628 r7 00000000 r8 00000002 r9 aefc40c0 r10 00000001 r11 ba5aaac3 ip ba781e84 sp b716fc40 lr b9bfc07c pc ebaa11a0 backtrace: #00 pc 0001c1a0 /system/lib/libEGL.so *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Thanks in advance

ProcessPurchase partially fails with mobile data connection

$
0
0
Hi everyone, I got a little problem with Unity IAP on my Android game. When I purchase my consumable products when connected to internet with mobile datas, it looks like the ProcessPurchase Method fails. Let my explain more with my code. public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { if (string.Equals(args.purchasedProduct.definition.id, fiftyBrocoinsID, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); PlayerData.nbBrocoins += 50; PlayerData.SaveBrocoinsAndAccess(); // the player datas are save successfully in any case StartCoroutine(MakeNSoundsOfBrocoins(5)); // but sounds are not always played when connected to internet with mobile datas } else if (string.Equals(args.purchasedProduct.definition.id, fullAccessID, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); PlayerData.hasFullAccess = true; mainMenu.UpdateToFullAccessDisplay(); PlayerData.SaveBrocoinsAndAccess(); StartCoroutine(MakeNSoundsOfBrocoins(10)); GetComponent().CheckIfFullAccessAndAdjustButtons(); } else Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); return PurchaseProcessingResult.Complete; } private IEnumerator MakeNSoundsOfBrocoins(int n) { for (int i = 0; i < n; i++) { AudioManagerForOneGame.am.PlaySound("OneBrocoin"); yield return new WaitForSecondsRealtime(0.2f); } } So what happen is that when I buy 50 brocoins while connected to internet with mobile datas, the payment goes well, but sometime ( it happens about once in two), `StartCoroutine(MakeNSoundsOfBrocoins(5));` doesnt make any sounds (yet `PlayerData.nbBrocoins += 50;` and `PlayerData.SaveBrocoinsAndAccess();` are called with no problem) and, when I close and then restart the game, I get 50 brocoins more (without paying more) and I hear the sounds from `StartCoroutine(MakeNSoundsOfBrocoins(5));`! So, my guess is that the ProcessPurchase method fails at `StartCoroutine(MakeNSoundsOfBrocoins(5));` and the purchase is marked as Pending, and when I restart the game, it is done again and marked as completed this time. (I'm not sure though, this is what I think is happening but I might be completly wrong!) What I don't understand is that it only happens when connected to internet with mobile datas, It work as intended with wifi or in the editor. What sould I do to fix this and be sure the player won't get the purchase twice ? Thank you for your time !

What is the best way to cloud save IAP items bought using virtual currency?

$
0
0
My app will be using virtual currency to buy in app items. I can handle the buying of the virtual currency using the Google and Apple IAP services.

However, I would like to ensure that any items bought using virtual currency is saved on a server and the user should be able to transfer the items that are bought when re-installing the app or switching device.

What is the best way to achieve this? I unfortunately do not have the time to write and maintain my own server to store the purchases. I was thinking of going ahead with PlayFab or GameSparks for saving the items in the cloud. Any suggestions/advise will be helpful.

Can this be achieved without the user setting up an account on a cloud service like PlayFab or Firebase?

Consume a non consumable after loading product

$
0
0
Hello, We have a non consumable product on Android that last for a certain amount of time, a week , a month etc. It's not a subscription. When we retrieve the product, when the app loads, we check the purchase date and if it's expired, we would like to consume it. This is where the problem comes in. Since we initially added the product as non consumable we can't consume it unless we load it as a consumable. I believe this answers the question on how to consume a non consumable https://forum.unity.com/threads/how-to-consume-non-consumable-iap-on-android.569335/#:~:text=In%20Unity%20IAP%2C%20if%20you,ConfirmPendingPurchase'%20to%20consume%20it. But it says to load it as a non consumable but we won't know if we have to consume it until we get it. By then it is already set as a non consumable. If we save the receipt on our server and make the product a consumable, how can I uniquely identify the owner of that product across multiple devices for that receipt? I also I tried to initialize the Unity Purchase twice, UnityPurchasing.Initialize(this, builder), reinitializing the product list as a consumable and trying to consume but this does not appear to work. Any ideas?

Android IAP in Thailand payment went though but no rewards

$
0
0
Hey, I have been receiving quite a few report about someone purchased IAP products on my android app in Thailand with Google Play, the payment went through but they didn't received any rewards. Happens in Thailand only, anyone knows why and how to solve it? I am dying from the in inside, Please help Aubrey

How to keep Oculus IAP working in build when exporting in IL2CPP ?

$
0
0
How to keep Oculus IAP (In-app Purchase) working in build when exporting in IL2CPP ? Oculus IAP is correclty working when exporting in Mono. But when **export** is switched from Mono to **IL2CPP, Unity seems to Strip the Oculus IAP (assembly ?) code.** Then the Oculus IAP is not working anymore in the VR app. Impossible to find any documentation about it. I have created a link.xml and tried to add some Oculus assembly / class (type) but nothing worked. What am i missing ? See below the link.xml file. Thanks in advance for your help !

Unity IAP does not work with App Bundle,Unity IAP not working with App Bundle build.

$
0
0
When I build the game to an App Bundle (Google Play) .aab extension, the IAP module doesn't work. Looking at the logcat of the app, IAP is not getting initialized because of the next error: E/Unity: AndroidJavaException: java.lang. ClassNotFoundException: com.android.billingclient.api.PurchasesUpdatedListener java.lang.ClassNotFoundException: com.android.billingclient.api.PurchasesUpdatedListener If I build to an APK everything works fine. This error is keeping me from publishing the App Bundle to the Play Console. I can still upload the APK file, but an App Bundle would decrease the installation size in the devices.

Crash when returning from PlayStore purchasing interface

$
0
0
Hello. Using Unity IAP in my android game I'm able to successfully launch Google Play Store's purchasing interface (where the actual transaction is handled). However, when returning from this interface (either through purchasing or by cancelling) the game freezes and then crashes. adb logcat does not display any error messages (or any messages at all) when this happens, so debugging becomes really hard. Does anyone have any idea what could cause this crash? I would be thankful for any help. (Using Unity 2018.3.2f1, IAP 2.2.0)

About error when billing with Unity IAP in ios environment

$
0
0
Hello I'm using Unity iAP.
Very convenient and wonderful.
When I run the purchase process and get an error and the
"OnPurchaseFailed" method is called, I sometimes get the following error:
Do you have any idea what causes this to happen?
"Purchase Failure Reason.Duplicate Transaction"

Setting Up IAP - Please Enter Key In Valid Format

$
0
0
I am trying to set up IAPs for my project. to do this, Options requests a key. It tells me to find it in the Google Play Developer Console, in my appropriate project, under "Services and APIs". No such place exists in my play store. Instead I go to "Monetization Setup" and grab the licensing key, which I assume is the correct one (google play must have reworked their UI). However when I try to copy paste and submit, I get an error saying "Please Enter Key In Valid Format". How can I fix this?

error: unexpected element found in

$
0
0
Does anyone knows anything about following error Using 2018.4.27f1, it appeared recently after updating the IAP. CommandInvokationFailure: Gradle build failed. E:\Applications\Unity Editors\2018.4.27f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "E:\Applications\Unity Editors\2018.4.27f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease" stderr[ FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':bundleReleaseResources'. > 1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed Temp\gradleOut\build\intermediates\bundle_manifest\release\processReleaseManifest\bundle-manifest\AndroidManifest.xml:30: error: unexpected element found in .

Unity IAP is failing in Sandbox when testing Interrupted purchase

$
0
0
Hi, I am trying to integrate a single non consumabel IAP on iOS, **it is working fine when I initiate a normal purchase** but it fails with an unknown error(Store specific error code: **SKErrorUnknown** ) when **"Interrupt purchase for this tester" is enabled**. Not sure what might be the reason. Can someone please suggest what's wrong. ---------- IAP code used [C# code][1] ---------- Here's the Xcode logs [logs][2] [1]: https://paste.ofcode.org/55zYJaqrWHyTJ3Va8KH82t [2]: https://paste.ofcode.org/32J6XddGt3WLtkNeWvCc4GC

[Android] IAP Subscription 'developerPayload' is missing

$
0
0
Unity 2020.1.2f1 IAP 2.2.1 Buying a subscription works, when I reinstall the application, restore also works, But when I just log out and log in to the app I get a product subscription with receipt which not contain enough information, the 'developerPayload' field is missing. How I can check subscription status? 'This product is not available for SubscriptionManager class, only products that are purchase by 1.19+ SDK can use this class.' - What SDK is meant? #if SUBSCRIPTION_MANAGER if (item.receipt != null) { if (item.definition.type == ProductType.Subscription) { if (checkIfProductIsAvailableForSubscriptionManager(item.receipt)) { string intro_json = (introductory_info_dict == null || !introductory_info_dict.ContainsKey(item.definition.storeSpecificId)) ? null : introductory_info_dict[item.definition.storeSpecificId]; SubscriptionManager p = new SubscriptionManager(item, intro_json); SubscriptionInfo info = p.getSubscriptionInfo(); Debug.Log(string.Join("\n", new[] { $"Information about subscription product: {item.definition.id}", $"Purchase date: {info.getPurchaseDate()}", $"Expire date: {info.getExpireDate()}", $"Is subscribed? {info.isSubscribed().ToString()}", $"Is expired? {info.isExpired().ToString()}", $"Is cancelled? {info.isCancelled()}", $"Is in free trial period? {info.isFreeTrial()}", $"Is auto renewing: {info.isAutoRenewing()}", $"Subscription remaining valid time until next billing date is: {info.getRemainingTime()}", $"Is this product in introductory price period? {info.isIntroductoryPricePeriod()}", $"The product introductory localized price is: {info.getIntroductoryPrice()}", $"The product introductory price period is: : {info.getIntroductoryPricePeriod()}", $"The number of product introductory price period cycles is:: {info.getIntroductoryPricePeriodCycles()}", }));

Android IAP Cannot confirm purchase due to missing transaction id

$
0
0
I am implementing server-side IAP verification and having an issue when it comes time to call ConfirmPendingPurchase, which returns the following error in the logs... `Unable to confirm purchase; Product has missing or empty transactionID` Here is a step-by-step sequence of events: 1. Initiate purchase 2. (user completes purchase with store UI, payment, etc) 3. `ProcessPurchase(PurchaseEventArgs e)` is called, details of transaction are sent to server I return `PurchaseProcessingResult.Pending` 4. Server verification is successful 5. Call `ConfirmPendingPurchase(product)` after looking up product by id 6. Error and purchase it ultimately cancelled due to not being acknowledged Logging reveals to transactionID is present and valid in all steps except #5 onward. Something is clearing the transactionID between the time Pending is returned and message is sent to server and when product is looked up for confirmation. Any ideas welcome and appreciated! Unity 2020.2.1f1 Unity IAP 2.2.1
Viewing all 595 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>