-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[in_app_purchase] Getting error while completing error purchases on iOS 14 #66253
Comments
This comment has been minimized.
This comment has been minimized.
Hi @pavelstupka |
Flutter doctor:
|
I think this is the same issue as #66886 |
Just filed a fix flutter/plugins#3106 |
@dennis-tra updated to version 0.3.4+12 but it still not pop up purchase dialog :(. Anyone has same error ?? |
@DangKhoi1997 Could it be that the purchase is still in the TransactionQueue from your previous attempts? In your purchaseUpdate listener you should call complete purchase on all purchases that are in the |
@dennis-tra its already working for me. I'm rebuilding my app again. v0.3.4+12 fixed it for me |
okie let me try 👍 |
@dennis-tra off topic question, i just noticed that in iOS 14 loading of products is significantly longer compared to earlier versions of iOS with this plugin. Did you encounter the same issue? |
@zodiark23 sorry, I haven't experienced a higher latency in loading the products. When loading the products in the simulator I get parsing errors though - which hasn't happened before. I'm usually testing on the real device, so that's not a huge problem right now. |
@dennis-tra hmm the issue still exist, but i dont understand how can "grab all transaction by calling transactions() and then call completePurchase on the returned transactions. If this has succeed you should be able to trigger the pop up dialog again." Can you give me sample ? |
Hi, I am running into similar issue with
If I click cancel, I get: Either way this purchase is then caught in As a result I cannot initiate new purchase because of Has anyone experienced similar issue? |
Reverted to |
Still having the same issue... |
i am also experiencing the same, do you think it mean i also have to remove the in_app_purchase: ^0.3.4+16 and shift to flutter_inapp_purchase: ^3.0.0 please advise, as major problem why it asking for parent & guardian permission as i not set any family sharing on my iPhone. |
|
See this thread regarding the request of family approval: |
I have the same issue |
Same problem here, using Steps to reproduce:
flutter doctor --verbose
|
Set sandbox parameter to "false" or completely remove that line for iPhone
test.
…On Mon, Nov 16, 2020, 2:13 PM Kamil Rykowski ***@***.***> wrote:
Same problem here, using in_app_purchase: ^0.3.4+16. Not sure how the
purchaseUpdatedStream can solve the problem as in my case it's not even
called when I cancel the system prompt about confirming the payment.
Steps to reproduce:
1. Start app
2. Clear all previous purchases through:
InAppPurchaseConnection.instance.queryPastPurchases().then((pastPurchases) {
log("Past purchases: $pastPurchases");
pastPurchases.pastPurchases.forEach((p) {
log("Past purchase: $p");
if (p.pendingCompletePurchase) {
plugin.completePurchase(p);
}
});
});
1. Start listening on purchaseUpdatedStream for purchase changes
2. Trigger action which fires buyNonConsumable call
3. Cancel the native popup about confirming the payment
4. purchaseUpdatedStream is not called
5. After restarting the app queryPastPurchases returns nothing
6. Calling again buyNonConsumable do not shows the native system.
Nothing the user can done. Restarting the app (stoping and recompiling)
solves the problem and popup appears again (once per run).
flutter doctor --verbose
[✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H15, locale en-GB)
• Flutter version 1.22.3 at /usr/local/opt/flutter
• Framework revision 8874f21 (3 weeks ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/kamil/Library/Android/sdk/
• Platform android-29, build-tools 29.0.2
• ANDROID_SDK_ROOT = /Users/kamil/Library/Android/sdk/
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.10.0
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.50.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (1 available)
• iPhone (mobile) • 00008020-001E18C13C92002E • ios • iOS 14.1
! Doctor found issues in 1 category.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2NMAJX2UCFMNNF4OIMHYLSQDUKDANCNFSM4RUMXRDA>
.
|
@kqureshi14 didn't change anything. The strange(r) thing is that it works once per app start - like something is kept in memory which prevents the dialog from showing up again. I've even tried to reproduce it in the example app, but the required steps with creating completely new app for iOS is bit too much for now. Switching to |
Just change the value of |
To remove family permission, please set sandbox to false or completely
remove that line and then test.
…On Tue, Nov 17, 2020, 7:04 AM 吕晨阳 ***@***.***> wrote:
Hi, I am running into similar issue within_app_purchase: ^0.3.4+15 on
iOS14. Using sandbox, when I try to purchase nonconsumable, I am asked for
sandbox testers password and then for request of family approval - which I
do not understand why at all. If I click submit, I get
<SKPaymentQueue: 0x282873810>: Payment completed with error: Error
Domain=ASDErrorDomain Code=1052 "Unhandled exception"
UserInfo={NSUnderlyingError=0x2824c0000 {Error Domain=AMSErrorDomain
Code=511 "Family permission required"
UserInfo={NSLocalizedDescription=Family permission required}},
NSLocalizedFailureReason=An unknown error occurred,
NSLocalizedDescription=Unhandled exception}
If I click cancel, I get:
<SKPaymentQueue: 0x282ae7f10>: Payment completed with error: Error
Domain=ASDErrorDomain Code=1052 "Unhandled exception"
UserInfo={NSLocalizedDescription=Unhandled exception,
NSLocalizedFailureReason=An unknown error occurred}
Either way this purchase is then caught in PurchaseStatus.pending
indefinitely and I do not know how to complete it (because
purchaseDetails.pendingCompletePurchase is false at this point)
As a result I cannot initiate new purchase because of
[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception:
PlatformException(storekit_duplicate_product_object, There is a pending
transaction for the same product identifier. Please either wait for it to
be finished or finish it manually using completePurchase to avoid edge
cases., {applicationUsername: null, requestData: null, quantity: 1,
productIdentifier: 1, simulatesAskToBuyInSandbox: true}, null)
Has anyone experienced similar issue?
Just change the value of sandboxTesting from true to false will fix this
issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2NMAJJ5WZXNE572UBLUF3SQHK3XANCNFSM4RUMXRDA>
.
|
Just before calling the
It's run to ensure the queue won't contain any failed transactions and to avoid UPDATE: I've wrongly implemented the listening part of
|
Yep that works! Great work |
I have the same issue |
The same with error: |
Can you paste all code? |
I just confirmed that flutter/plugins#3106 fixed the issue in the original post. Closing the issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I'm using the latest in_app_purchase plugin (0.3.4+8).
According to documentation on iOS all error purchaseses need to be completed by calling
InAppPurchaseConnection.instance.completePurchase
.Steps to reproduce:
On iOS 14.0 invoke a consumable in-app:
InAppPurchaseConnection.instance.buyConsumable
Wait for the system dialog for approving the payment.
Don't approve the payment, hit the Cancel button to interrupt the in-app process.
Step 3 generates an error state for the Purchase and the Purchase is returned in
InAppPurchaseConnection.instance.purchaseUpdatedStream
. The underlyingSKPaymentTransactionWrapper
(used by thePurchaseDetails
class) containstransactionIdentifier
which is later used byInAppPurchaseConnection.instance.completePurchase
mechanism to complete the purchase.According to the documentation in src/store_kit_wrappers/sk_payment_transaction_wrappers.dart
This is not true,
transactionIdentifier
is returned for error Purchases as well because it is needed by the undelaying mechanisms to complete the transactions (seeSKPaymentQueueWrapper.finishTransaction
in src/store_kit_wrappers/sk_payment_queue_wrapper.dart). This worked well until iOS 14.0 was released. Now hitting Cancel button in step 3 throws en exception:and the returned
PurchaseDetails
class (or more precisely the underlayingSKPaymentTransactionWrapper
) contains notransactionIdentifier
(it is null):Now trying to call
InAppPurchaseConnection.instance.completePurchase
while thetransactionIdentifier
of the underlayingSKPaymentTransactionWrapper
is null throws an exception:I believe there may be some problem processing error Purchases on iOS 14 thus not getting their transactionIdentifiers.
The text was updated successfully, but these errors were encountered: