Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purchasing Auto-Renewing Subscriptions Fails (Unknown Error) #47

Closed
kikiho opened this issue Oct 31, 2018 · 19 comments
Closed

Purchasing Auto-Renewing Subscriptions Fails (Unknown Error) #47

kikiho opened this issue Oct 31, 2018 · 19 comments
Labels
help wanted Extra attention is needed ios ios related issue

Comments

@kikiho
Copy link

kikiho commented Oct 31, 2018

Version of flutter_inapp_purchase

0.8.5

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

Purchase of auto-renewing subscription would work.

Actual behavior

Fetching of the products works as expected, however, when I call buyProduct on the item (an auto-renewing subscription), the transaction fails and the error message is: "An unknown or unexpected error has occurred. Please try again later." Tried to debug in XCode and can only see that the transaction state goes from purchasing to failed. I've checked that in app purchases are enabled in capabilities in the XCode project, all the products are set up appropriately in AppStoreConnect, and canMakePurchases returns true every time. Curious if anyone has run into this issue and what was done to mitigate. Thanks!

Tested environment (Emulator? Real Device?)

Real device

@hyochan hyochan added help wanted Extra attention is needed ios ios related issue labels Nov 3, 2018
@hyochan
Copy link
Owner

hyochan commented Nov 3, 2018

Since this plugin is delivered by react-native-iap which has more matured issue list, you may check this one. There are many unknown side-effects in IAP especially in ios that we covered and that we need to cover in the future.

Also, please give a PR when you've solved your problem to share with others.

@vagrantrobbie
Copy link
Contributor

vagrantrobbie commented Nov 20, 2018

Have you logged out of the device and only use a Sandbox account when the purchase dialog appears in app?

I've seen this error when testing a purchase but have forgotten to log out of the device's account. Don't forget to not login to the device with the Sandbox account either or it will create a "real" user

Update: You get this error when trying to access IAP on iOS when using a proxy (like Charles) as well

@vagrantrobbie
Copy link
Contributor

Is this issue still open?

@MderM
Copy link

MderM commented Apr 24, 2019

Have you logged out of the device and only use a Sandbox account when the purchase dialog appears in app?

I've seen this error when testing a purchase but have forgotten to log out of the device's account. Don't forget to not login to the device with the Sandbox account either or it will create a "real" user

Update: You get this error when trying to access IAP on iOS when using a proxy (like Charles) as well

I do not understand what you mean by the various log in log out tips. I'm running into this as well. With a real account and with a sandbox account. I would consider this open...

@ericduffett
Copy link

I'm running into this issue as well with a non-renewing subscription. The error log is below. I've confirmed that I can get this IAP to work with a Sandbox User in a previous version of the app that was built using only Swift.

Purchase Started !!
2019-05-08 11:44:47.819382-0500 Runner[16255:3743382]

Purchase Failed !!
2019-05-08 11:44:47.824961-0500 Runner[16255:3743449] flutter: Caused err. Set additionalSuccessPurchaseListenerIOS.
2019-05-08 11:44:47.825483-0500 Runner[16255:3743449] flutter: PlatformException(E_UNKNOWN, An unknown or unexpected error has occured. Please try again later., null)
2019-05-08 11:44:47.829865-0500 Runner[16255:3743449] [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: PlatformException(ios, platform not supported, null)
#0 FlutterInappPurchase.buyProduct (package:flutter_inapp_purchase/flutter_inapp_purchase.dart:269:5)

#1 _PurchaseSubscriptionPageState.buyProduct (package:undaunted_golf_flutter/PurchaseSubscriptionPage.dart:98:58)

#2 _PurchaseSubscriptionPageState.build. (package:undaunted_golf_flutter/PurchaseSubscriptionPage.dart:344:25)

#3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
#4 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:566:30)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
#7 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:211:7)
#8 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
#9 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:225:20)
#10 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
#11 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
#12 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
#13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
#14 _rootRunUnary (dart:async/zone.dart:1136:13)
#15 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#16 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#17 _invoke1 (dart:ui/hooks.dart:233:10)
#18 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
2019-05-08 11:45:22.597897-0500 Runner[16255:3743779] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C4.1:2][0x10ab13540] get output frames failed, state 8196
2019-05-08 11:45:22.598180-0500 Runner[16255:3743779] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C4.1:2][0x10ab13540] get output frames failed, state 8196
2019-05-08 11:45:22.598613-0500 Runner[16255:3743779] TIC Read Status [4:0x0]: 1:57
2019-05-08 11:45:22.598659-0500 Runner[16255:3743779] TIC Read Status [4:0x0]: 1:57

@tjviking
Copy link

same for us, identical behavior only for renewable products

Version of flutter_inapp_purchase
0.9.2

Platforms you faced the error (IOS or Android or both?)
iOS

Expected behavior
Purchase of auto-renewing subscription would work.

Actual behavior
Fetching of the products works as expected, however, when I call buyProduct on the item (an auto-renewing subscription), the transaction fails and the error message is: "An unknown or unexpected error has occurred. Please try again later." Tried to debug in XCode and can only see that the transaction state goes from purchasing to failed. I've checked that in app purchases are enabled in capabilities in the XCode project, all the products are set up appropriately in AppStoreConnect, and canMakePurchases returns true every time. Curious if anyone has run into this issue and what was done to mitigate. Thanks!

Tested environment (Emulator? Real Device?)
Real device

@vagrantrobbie
Copy link
Contributor

Before testing, have you logged out of your device by going to Settings -> TAP Your name Apple ID at the top -> Sign Out

Then do the purchase again. You will be prompted to login with your Apple ID, use the Sandbox user.

@jodymac
Copy link

jodymac commented Jun 13, 2019

getting the same things as tjviking. I started using this plugin 2 days ago for the first time. I've test in_app purchases before as an IOS developer, first time with flutter. I am logging in with sandbox account when trying to purchase and it is successfully pulling down the products for display.

Purchase Started !!

Purchase Failed !!
flutter: Caused err. Set additionalSuccessPurchaseListenerIOS.
flutter: PlatformException(E_UNKNOWN, An unknown or unexpected error has occured. Please try again later., null)
flutter: PlatformException(ios, platform not supported, null)

@ericduffett
Copy link

@jodymac @tjviking I had this same exact issue. Switching to the Google Flutter team plugin was the best way to solve this. This exact error was reported out differently by this other plugin and it was much easier to debug. Link here: https://pub.dev/packages/in_app_purchase

@jodymac
Copy link

jodymac commented Jun 13, 2019 via email

@tjviking
Copy link

subscriptions download ok for me I can show products, but when calling buyProduct or buySubscription with valid SKU , I got PlatformException which states that Product id is wrong, which is not possible, product was added and accepted by Appstore connect and is valid

@jodymac maybe you do not use non-consumable subscription product, if its non-consumable non-subscription product it all works ok

@ericduffett
Copy link

@jodymac @tjviking I'm thinking back on this and how I fixed it after switching plugins. One thing that came to mind is that I think one of the issues I ran into was that I hadn't accepted the latest agreements from apple in appstoreconnect or my apple developer account. Before you do any more coding, try going there and making sure you've accepted the latest terms and conditions on both platforms.

I don't have any code for auto-renewing subscriptions, but I have successfully implemented non-renewing subscriptions by treating them like a consumable. I don't have any code I can share, but I am happy to move this chat to another channel to discuss in more detail.

@jodymac
Copy link

jodymac commented Jun 14, 2019 via email

@vagrantrobbie
Copy link
Contributor

@jodymac

I just had the error

Purchase Failed !!
flutter: Caused err. Set additionalSuccessPurchaseListenerIOS.
flutter: PlatformException(E_UNKNOWN, An unknown or unexpected error has occured. Please try again later., null)
flutter: PlatformException(ios, platform not supported, null)

Trying to purchase an autorenewing subscription while still logged in as a previous sandbox user. I forgot to sign out at Settings -> iTunes and App Store -> Scroll down to SANDBOX ACCOUNT

flutter_15

When testing an autorenewing purchase you need to create a new sandbox account each time you want to test a purchase

@jodymac
Copy link

jodymac commented Jun 17, 2019

Yes, I've test with sandbox user and on my actual device. Didn't make a difference. I was really hoping to use this plugin as it's apparent the developer had put some thought into it and the example/documentation was much better than the others. I switched to in_app_purchase and have successfully initiated purchases, but am trying to figure out restore and checking receipt for expiration date on subscription.

@tjviking
Copy link

I switched to in_app_purchase and it works nicely with subscriptions, so stop wasting you time :P move on

@hyochan
Copy link
Owner

hyochan commented Jun 17, 2019

Sorry that I was so busy these days and couldn't follow up all the threads promptly. I knew that Google's official plugin has been released and I even lost myself a potent to maintain this plugin since it is so meaningless for me to handle all this by myself when there is already an official one.

I am thinking of deprecating this plugin and recommend users to use official one instead.

@hyochan
Copy link
Owner

hyochan commented Sep 17, 2019

2.0.0+ has raised today. Please feel free to reopen after trying out 2.0.0+5 or above.

@hyochan hyochan closed this as completed Sep 17, 2019
@rguntha
Copy link

rguntha commented Jan 20, 2022

This issue is still happening for me.

I am using the flutter_inapp_purchase: ^5.1.2 version.

This issue is happening in the Sandbox environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed ios ios related issue
Projects
None yet
Development

No branches or pull requests

8 participants