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

[IN_APP_PURCHASE] Purchase dialog not showing on iOS 13.4 #53534

Closed
dancamdev opened this issue Mar 29, 2020 · 125 comments
Closed

[IN_APP_PURCHASE] Purchase dialog not showing on iOS 13.4 #53534

dancamdev opened this issue Mar 29, 2020 · 125 comments
Assignees
Labels
c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. p: in_app_purchase Plugin for in-app purchase P0 Critical issues such as a build break or regression package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically

Comments

@dancamdev
Copy link

dancamdev commented Mar 29, 2020

I'm facing an issue with in_app_purchase 0.3.1+2 flutter plugin and iOS 13.4

The purchase dialog opens once and, if canceled, it won't open anymore.

It works fine on Android and any prior version of iOS 13.4

It happens for both, consumable and non-consumable purchases.

By investigating further, I noticed that specifically, nothing happens when calling the following FIAPaymentQueueHandler.m method:

- (void)addPayment:(SKPayment *)payment { [self.queue addPayment:payment]; }

@dancamdev dancamdev changed the title [IN_APP_PURCHASES] Purchase dialog not showing on iOS 13.4 [IN_APP_PURCHASE] Purchase dialog not showing on iOS 13.4 Mar 30, 2020
@fracon
Copy link

fracon commented Mar 30, 2020

I am facing almost the same error. After I upgraded my iOS to version 13.4 the purchase dialog do not show anymore in the sandbox environment (Local and Test Flight).

@TahaTesser
Copy link
Member

Hi @dancamdev @fracon
can you please provide your flutter doctor -v and flutter run --verbose?
Thank you

@TahaTesser TahaTesser added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Mar 30, 2020
@dancamdev
Copy link
Author

dancamdev commented Mar 30, 2020

@TahaTesser Sure, here is my flutter doctor -v:

`[✓] Flutter (Channel master, v1.16.4-pre.18, on Mac OS X 10.15.3 19D76, locale en-IT)
• Flutter version 1.16.4-pre.18 at /Users/danielec/Documents/flutter
• Framework revision c8efcb6 (2 days ago), 2020-03-27 22:31:01 -0700
• Engine revision 3ee9e3d
• Dart version 2.8.0 (build 2.8.0-dev.17.0 1402e8e1a4)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/danielec/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4, Build version 11E146
• CocoaPods version 1.8.4

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] IntelliJ IDEA Community Edition (version 2019.3.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 42.1.4
• Dart plugin version 193.5731

[✓] VS Code (version 1.43.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1

[✓] Connected device (3 available)
• iPhone 11 Pro Max • 66BFC31E-1567-46CC-9B9A-CD14539D558A • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)
• Chrome • chrome • web-javascript • Google Chrome
80.0.3987.149
• Web Server • web-server • web-javascript • Flutter Tools

• No issues found!`

and my flutter run --verbose of when I click the "buy" button:

`

[+90990 ms] [DEVICE LOG] 2020-03-30 12:52:19.676922+0200 localhost Runner[15896]: (StoreKit)
<SKPaymentQueue: 0x600003584230>: Payment added for transaction already in the SKPaymentQueue: geniusmonthly
[ +216 ms] [DEVICE LOG] 2020-03-30 12:52:19.893680+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> resuming, QOS(0x21) Voucher (null)
[ +1 ms] [DEVICE LOG] 2020-03-30 12:52:19.895682+0200 localhost Runner[15896]: (CFNetwork)
[com.apple.CFNetwork:ATS] Task <32E19877-7B72-489B-BB0D-A84012487DA4>.<1> {strength 1, tls 8, ct 0, sub 0,
sig 0, ciphers 1, bundle 0, builtin 0}
[ +1 ms] [DEVICE LOG] 2020-03-30 12:52:19.897246+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
enabling TLS
[ ] [DEVICE LOG] 2020-03-30 12:52:19.897269+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
starting, TC(0x0)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.897303+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] [C22 7CDDCC30-4293-4F63-A295-7AD7040C8EB0 graph.facebook.com:443 tcp, url hash:
7c59002f, tls] start
[ ] [DEVICE LOG] 2020-03-30 12:52:19.898056+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_connection_report_state_with_handler_on_nw_queue [C22] reporting state preparing
[ ] [DEVICE LOG] 2020-03-30 12:52:19.898804+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> setting up Connection 22
[ +21 ms] [DEVICE LOG] 2020-03-30 12:52:19.920819+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_socket_handle_socket_event [C22.1:3] Socket received CONNECTED event
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921157+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_flow_connected [C22.1 31.13.86.8:443 in_progress socket-flow (satisfied (Path is
satisfied), interface: en18)] Transport protocol connected
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921385+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_handshake_config(1471) [0x7fa045292fc0] set
tls_handshake_config_standard
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921425+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_min_version(324) [0x7fa045292fc0] set 0x0301
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921461+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_max_version(308) [0x7fa045292fc0] set 0x0304
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921513+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_cipher_suites(843) [0x7fa045292fc0]
Ciphersuite string:
TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECD
HE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-
ECDSA-AES128-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE
-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-CHACHA20-POLY
1305:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:ECDHE-ECDSA-AES12
8-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:AES256-SHA:AES128-SHA:ECDHE-ECDSA-DES
-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:DES-CBC3-SHA
[ +1 ms] [DEVICE LOG] 2020-03-30 12:52:19.921590+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_remote_address(2555) [0x7fa045292fc0] Saving
remote IPv4 address
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921654+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_install_association_state(1262) [0x7fa045292fc0]
Client session cache miss
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921732+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_set_peer_hostname(1154) [0x7fa045292fc0] SNI
graph.facebook.com
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921808+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_min_version(324) [C22.1:2][0x7fa045292fc0] set
0x0303
[ ] [DEVICE LOG] 2020-03-30 12:52:19.921888+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_fallback(374) [C22.1:2][0x7fa045292fc0] set
false
[ ] [DEVICE LOG] 2020-03-30 12:52:19.922103+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_session_ticket_enabled(440)
[C22.1:2][0x7fa045292fc0] set false
[ ] [DEVICE LOG] 2020-03-30 12:52:19.922528+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_false_start(410) [C22.1:2][0x7fa045292fc0] set
false
[ ] [DEVICE LOG] 2020-03-30 12:52:19.922800+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_enforce_ev(400) [C22.1:2][0x7fa045292fc0] set
false
[ ] [DEVICE LOG] 2020-03-30 12:52:19.922857+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_ats_enforced(1285) [C22.1:2][0x7fa045292fc0]
set false
[ ] [DEVICE LOG] 2020-03-30 12:52:19.922900+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_ats_minimum_rsa_key_size(1294)
[C22.1:2][0x7fa045292fc0] set 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.923092+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_ats_minimum_ecdsa_key_size(1303)
[C22.1:2][0x7fa045292fc0] set 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.923215+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_ats_minimum_signature_algorithm(1313)
[C22.1:2][0x7fa045292fc0] set 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.923417+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_set_peer_hostname(1154) [C22.1:2][0x7fa045292fc0]
SNI graph.facebook.com
[ ] [DEVICE LOG] 2020-03-30 12:52:19.923598+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_set_cipher_suites(843) [C22.1:2][0x7fa045292fc0]
Ciphersuite string:
TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECD
HE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-
ECDSA-AES128-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE
-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-CHACHA20-POLY
1305
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924508+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] nw_protocol_boringssl_begin_connection(497)
[C22.1:2][0x7fa045292fc0] early data disabled
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924599+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1970) [C22.1:2][0x7fa045292fc0]
Client handshake started
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924745+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Writing SSL3_RT_HANDSHAKE 512 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924789+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS client enter_early_data
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924824+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_add_handshake_message_pending(578)
[C22.1:2][0x7fa045292fc0] Adding message(1)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924925+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS client read_server_hello
[ ] [DEVICE LOG] 2020-03-30 12:52:19.924959+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_add_handshake_message_pending(578)
[C22.1:2][0x7fa045292fc0] Adding message(2)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.925537+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_handshake_incomplete(170)
[C22.1:2][0x7fa045292fc0] Handshake incomplete: waiting for data to read [2]
[ ] [DEVICE LOG] 2020-03-30 12:52:19.925596+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_handshake_incomplete(170)
[C22.1:2][0x7fa045292fc0] Handshake incomplete: waiting for data to read [2]
[ +14 ms] [DEVICE LOG] 2020-03-30 12:52:19.944869+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 122 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.944952+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_hello_retry_request
[ ] [DEVICE LOG] 2020-03-30 12:52:19.944982+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_add_handshake_message_pending(578)
[C22.1:2][0x7fa045292fc0] Adding message(2)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945009+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Writing SSL3_RT_CHANGE_CIPHER_SPEC 1 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945031+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_server_hello
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945210+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_encrypted_extensions
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945289+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 15 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945360+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_certificate_request
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945536+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_handshake_incomplete(170)
[C22.1:2][0x7fa045292fc0] Handshake incomplete: waiting for data to read [2]
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945648+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 2819 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945698+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_server_certificate
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945830+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_server_certificate_verify
[ ] [DEVICE LOG] 2020-03-30 12:52:19.945872+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 79 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.946121+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_copy_peer_sct_list(1003) [C22.1:2][0x7fa045292fc0]
SSL_get0_signed_cert_timestamp_list returned no SCT extension data
[ ] [DEVICE LOG] 2020-03-30 12:52:19.946380+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(607)
[C22.1:2][0x7fa045292fc0] SecTrustCreateWithCertificates result: 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.946614+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(614)
[C22.1:2][0x7fa045292fc0] No TLS-provided OCSP response
[ ] [DEVICE LOG] 2020-03-30 12:52:19.946948+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(621)
[C22.1:2][0x7fa045292fc0] No TLS-provided SCTs
[ ] [DEVICE LOG] 2020-03-30 12:52:19.947255+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_certificate_verify_callback(2071)
[C22.1:2][0x7fa045292fc0] Asyncing for verify block
[ ] [DEVICE LOG] 2020-03-30 12:52:19.947315+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_handshake_incomplete(170)
[C22.1:2][0x7fa045292fc0] Handshake incomplete: certificate evaluation result pending [16]
[ ] [DEVICE LOG] 2020-03-30 12:52:19.947378+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
asked to evaluate TLS Trust
[ ] [DEVICE LOG] 2020-03-30 12:52:19.947794+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> auth completion disp=1 cred=0x0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.948006+0200 localhost Runner[15896]: (Security) Created
Activity ID: 0x2993c, Description: SecTrustEvaluateIfNecessaryFastAsync
[ ] [DEVICE LOG] 2020-03-30 12:52:19.950367+0200 localhost Runner[15896]: (CFNetwork) System Trust
Evaluation yielded status(0)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.950421+0200 localhost Runner[15896]: (Security) Created
Activity ID: 0x2993d, Description: SecTrustEvaluateIfNecessaryFastAsync
[ +1 ms] [DEVICE LOG] 2020-03-30 12:52:19.952588+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
TLS Trust result 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.952689+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_certificate_verify_callback_block_invoke_3(2080)
[C22.1:2][0x7fa045292fc0] Returning from verify block
[ ] [DEVICE LOG] 2020-03-30 12:52:19.952729+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_certificate_verify_callback(2047)
[C22.1:2][0x7fa045292fc0] Setting trust result to ssl_verify_ok
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953305+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client read_server_finished
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953361+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 36 bytes
[ +7 ms] [DEVICE LOG] 2020-03-30 12:52:19.953424+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client send_end_of_early_data
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953467+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client send_client_certificate
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953517+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client complete_second_flight
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953566+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Writing SSL3_RT_HANDSHAKE 36 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953634+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS 1.3 client done
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953716+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS client finish_client_handshake
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953759+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1983) [C22.1:2][0x7fa045292fc0]
Client handshake state: TLS client done
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953836+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_copy_peer_sct_list(1003) [C22.1:2][0x7fa045292fc0]
SSL_get0_signed_cert_timestamp_list returned no SCT extension data
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953913+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(607)
[C22.1:2][0x7fa045292fc0] SecTrustCreateWithCertificates result: 0
[ ] [DEVICE LOG] 2020-03-30 12:52:19.953944+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(614)
[C22.1:2][0x7fa045292fc0] No TLS-provided OCSP response
[ ] [DEVICE LOG] 2020-03-30 12:52:19.954071+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_helper_create_sec_trust_with_certificates(621)
[C22.1:2][0x7fa045292fc0] No TLS-provided SCTs
[ ] [DEVICE LOG] 2020-03-30 12:52:19.954365+0200 localhost Runner[15896]: (Security) Created
Activity ID: 0x2993e, Description: SecTrustReportTLSAnalytics
[ ] [DEVICE LOG] 2020-03-30 12:52:19.954376+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_add_handshake_message_pending(578)
[C22.1:2][0x7fa045292fc0] Adding message(20)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.954638+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_info_handler(1974) [C22.1:2][0x7fa045292fc0]
Client handshake done
[ ] [DEVICE LOG] 2020-03-30 12:52:19.955219+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] nw_protocol_boringssl_signal_connected(701)
[C22.1:2][0x7fa045292fc0] TLS connected [version(0x0304) ciphersuite(0x1301) group(0x001d) peer_key(0x0403)
alpn(h2) resumed(0) offered_ticket(0) false_started(0) ocsp(0) sct(0)]
[ ] [DEVICE LOG] 2020-03-30 12:52:19.955292+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_flow_connected [C22.1 31.13.86.8:443 in_progress socket-flow (satisfied (Path is
satisfied), interface: en18)] Output protocol connected
[ ] [DEVICE LOG] 2020-03-30 12:52:19.955468+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_connection_report_state_with_handler_on_nw_queue [C22] reporting state ready
[ ] [DEVICE LOG] 2020-03-30 12:52:19.955976+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
connected successfully
[ ] [DEVICE LOG] 2020-03-30 12:52:19.956029+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
TLS handshake complete
[ ] [DEVICE LOG] 2020-03-30 12:52:19.956293+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
ready C(N) E(N)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.956492+0200 localhost Runner[15896]: (CFNetwork)
[com.apple.CFNetwork:Coalescing] new connection to graph.facebook.com config 0x600003665e20
[ ] [DEVICE LOG] 2020-03-30 12:52:19.956760+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> now using Connection 22
[ ] [DEVICE LOG] 2020-03-30 12:52:19.956822+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
received viability advisory(Y)
[ ] [DEVICE LOG] 2020-03-30 12:52:19.957233+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> sent request, body S 604
[ +5 ms] [DEVICE LOG] 2020-03-30 12:52:19.971481+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Reading SSL3_RT_HANDSHAKE 149 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:19.971594+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_new_session_handler(1117)
[C22.1:2][0x7fa045292fc0] New session available
[ +67 ms] [DEVICE LOG] 2020-03-30 12:52:20.039102+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> received response, status 200 content K
[ ] [DEVICE LOG] 2020-03-30 12:52:20.039149+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> done using Connection 22
[ ] [DEVICE LOG] 2020-03-30 12:52:20.039228+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> response ended
[ ] [DEVICE LOG] 2020-03-30 12:52:20.039313+0200 localhost Runner[15896]: (CFNetwork)
[com.apple.CFNetwork:Summary] Task <32E19877-7B72-489B-BB0D-A84012487DA4>.<1> summary for task success
{transaction_duration_ms=145, response_status=200, connection=22, protocol="h2",
domain_lookup_duration_ms=2, connect_duration_ms=55, secure_connection_duration_ms=30, request_start_ms=63,
request_duration_ms=0, response_start_ms=145, response_duration_ms=0, request_bytes=727, response_bytes=478,
cache_hit=0}
[ ] [DEVICE LOG] 2020-03-30 12:52:20.039398+0200 localhost Runner[15896]: (CFNetwork) Task
<32E19877-7B72-489B-BB0D-A84012487DA4>.<1> finished successfully
[ +28 ms] [DEVICE LOG] 2020-03-30 12:52:20.068320+0200 localhost Runner[15896]: (CFNetwork)
[com.apple.CFNetwork:Coalescing] removing all entries config 0x600003665e20
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068369+0200 localhost Runner[15896]: (CFNetwork)
[com.apple.CFNetwork:Coalescing] removing all entries config 0x600003665e20
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068553+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
is being canceled
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068616+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] [C22 7CDDCC30-4293-4F63-A295-7AD7040C8EB0 graph.facebook.com:443 tcp, url hash:
7c59002f, tls] cancel
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068727+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] [C22 7CDDCC30-4293-4F63-A295-7AD7040C8EB0 graph.facebook.com:443 tcp, url hash:
7c59002f, tls] cancelled
[ ] [DEVICE LOG] [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C 192.168.178.54:53375<->31.13.86.8:443]
[ +1 ms] [DEVICE LOG] Connected Path: satisfied (Path is satisfied), interface: en18
[ ] [DEVICE LOG] Duration: 0.171s, DNS @0.000s took 0.002s, TCP @0.003s took 0.020s, TLS took 0.035s
[ ] [DEVICE LOG] bytes in/out: 3959/1546, packets in/out: 8/9, rtt: 0.020s, retransmitted packets:
0, out-of-order packets: 0
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068778+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.000s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] path:start
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068816+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.000s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] path:satisfied
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068854+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.000s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] resolver:start_dns
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068889+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.002s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] resolver:receive_dns
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068932+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.002s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
path:start
[ ] [DEVICE LOG] 2020-03-30 12:52:20.068966+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.003s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
path:satisfied
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069090+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.003s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
flow:start_connect
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069279+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.012s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] resolver:receive_dns
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069446+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.023s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
flow:finish_transport
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069625+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.023s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] flow:finish_transport
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069781+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.058s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
flow:finish_connect
[ ] [DEVICE LOG] 2020-03-30 12:52:20.069942+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.058s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] flow:finish_connect
[ ] [DEVICE LOG] 2020-03-30 12:52:20.070100+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.058s [C22.1 1AABFBE1-F00B-41C8-848D-A6613940EB2C
192.168.178.54:53375<->31.13.86.8:443 socket-flow path=satisfied (Path is satisfied), interface: en18]
flow:changed_viability
[ ] [DEVICE LOG] 2020-03-30 12:52:20.070247+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.058s [C22 C16B1FFA-0528-41EF-ADF3-F3727ECDEDDD graph.facebook.com:443 resolver
path=satisfied (Path is satisfied), interface: en18] flow:changed_viability
[ ] [DEVICE LOG] 2020-03-30 12:52:20.070415+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] 0.171s [C22] path:cancel
[ ] [DEVICE LOG] 2020-03-30 12:52:20.071857+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_message_handler(2258) [C22.1:2][0x7fa045292fc0]
Writing SSL3_RT_ALERT 2 bytes
[ ] [DEVICE LOG] 2020-03-30 12:52:20.072040+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_context_handle_warning_alert(1893)
[C22.1:2][0x7fa045292fc0] write alert, level: warning, description: close notify
[ ] [DEVICE LOG] 2020-03-30 12:52:20.072231+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] boringssl_session_disconnect(504) [C22.1:2][0x7fa045292fc0]
SSL_shutdown 0
[ ] [DEVICE LOG] 2020-03-30 12:52:20.072422+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_flow_disconnected [C22.1 31.13.86.8:443 cancelled socket-flow ((null))] Output
protocol disconnected
[ ] [DEVICE LOG] 2020-03-30 12:52:20.072690+0200 localhost Runner[15896]: (libnetwork.dylib)
[com.apple.network:] nw_connection_report_state_with_handler_on_nw_queue [C22] reporting state cancelled
[ ] [DEVICE LOG] 2020-03-30 12:52:20.073056+0200 localhost Runner[15896]: (CFNetwork) Connection 22:
destroyed
[ ] [DEVICE LOG] 2020-03-30 12:52:20.073299+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] nw_protocol_boringssl_remove_input_handler(1012)
[C22.1:2][0x7fa045292fc0] nw_protocol_boringssl_remove_input_handler forced true
[ ] [DEVICE LOG] 2020-03-30 12:52:20.073450+0200 localhost Runner[15896]: (libboringssl.dylib)
[com.apple.network.boringssl:BoringSSL] nw_protocol_boringssl_remove_input_handler(1030)
[C22.1:2][0x7fa045292fc0] Transferring nw_protocol_boringssl_t handle back into ARC for autorelease`

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 30, 2020
@dancamdev
Copy link
Author

By debugging the in_app_purchase package I found that the updatedTransaction function is returning the following:

SKErrorDomain Code=2 (Cannot connect to iTunes Store)

Could it be an Apple server issue?

@fracon
Copy link

fracon commented Mar 30, 2020

@TahaTesser here the output of Flutter doctor:. @dancamdev I don't know why but after I increment my app version the purchase dialog works again ... once ... now after I do a purchase and the expiration date is reached when I try to do a new purchase using the same product apple returns directly a Purchase object with status purchased instead pending and no dialog shows. I don't if something changed in the 13.4 version and requires some adjustment of this package but according to the last 2 topics here https://forums.developer.apple.com/community/system-frameworks/in-app-purchase the in-app purchase is broken on this ios version.

Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-PT)
• Flutter version 1.12.13+hotfix.8 at /Users/rafael.vilaca/flutter_sdk/flutter
• Framework revision 0b8abb4 (7 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced
• Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/rafael.vilaca/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/rafael.vilaca/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_212-release-1586-b4-5784211)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4, Build version 11E146
• CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.43.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.8.1

[✓] Connected device (1 available)
• Rafael’s iPhone • c140aa58762554c973f9e995beace0a61c541e2d • ios • iOS 13.4

• No issues found!

@dancamdev
Copy link
Author

@fracon it happened to me too. I was able to open the dialog once and then not anymore upon retry. I'll double check if it returns a purchased product too. I'll let you know in a few minutes.

@dancamdev
Copy link
Author

Yup, it is actually returning a valid purchase although it isn't. That's even worse! Thanks for pointing it out @fracon

@dancamdev
Copy link
Author

any updates? @fracon are you getting the SKErrorDomain Code=2 (Cannot connect to iTunes Store) error too?

@fracon
Copy link

fracon commented Mar 30, 2020

@dancamdev I didn't debug in Xcode yet but I search in the apple docs that error 2 means "Error code indicating that the user canceled a payment request." Weird humm.

@dancamdev
Copy link
Author

dancamdev commented Mar 30, 2020

@fracon do you happen to have any app store promotion for iaps enabled? On this thread they are suggesting that might be the cause. It doesn't seam to work for me, but you might want to try!

@fracon
Copy link

fracon commented Mar 30, 2020

@dancamdev no promotions here but it's for me clearly something change from ios 13.3 to 13.4 or something change in the Apple's servers because on Friday my app works so since Saturday (when I updated my device to ios 13.4) stopped work. I just don't know if it's a bug on iOS or if this package needs an update to work with the new iOS.

@dancamdev
Copy link
Author

Totally agree! Hopefully someone will answer soon! What about @TahaTesser ?

@csells csells added customer: crowd Affects or could affect many people, though not necessarily a specific customer. p: in_app_purchase Plugin for in-app purchase severe: customer critical labels Mar 30, 2020
@dancamdev
Copy link
Author

Another hypothesis from my side. Somehow iOS 13.4 seems to be braking only the objective c implementation. Swift is working fine. I have no expertise to port the this plugin to Swift. So someone else might want to look into that

@dancamdev
Copy link
Author

Here's a way I'm getting closer to fix this one.

I replaced the handleTransactionUpdated function to forcefully call finishTransaction on every transaction, like this:

- (void)handleTransactionsUpdated:(NSArray<SKPaymentTransaction *> *)transactions {
//  NSMutableArray *maps = [NSMutableArray new];
//  for (SKPaymentTransaction *transaction in transactions) {
//    [maps addObject:[FIAObjectTranslator getMapFromSKPaymentTransaction:transaction]];
//  }
//  [self.callbackChannel invokeMethod:@"updatedTransactions" arguments:maps];
    for (SKPaymentTransaction *transaction in transactions) {
    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
    }
}

The commented code, is the actual in_app_purchase code.

After that, I was able to make the purchase dialog popup correctly, but only the very first time after flushing the transactions. Awesome! We're close!

Now, it looks like finishTransaction doesn't get called on iOS 13.4. Anyone's got an idea to fix it?

@tvolkert
Copy link
Contributor

tvolkert commented Apr 1, 2020

@cyanglaz this is the IAP issue I mentioned that's marked as customer critical.

@LHLL
Copy link

LHLL commented Apr 1, 2020

@dancamdev
SKErrorPaymentCancelled (error code 2) means the user cancelled the transaction. The transaction will stay in the SKPaymentQueue with transaction state: SKPaymentTransactionStateFailed

Cancelled transaction is a failed transaction, thus I think you should remove the failed transaction object before adding new payment object with the same product.

Did you use the following method to delete the transaction before adding a new one:
https://github.com/flutter/plugins/blob/master/packages/in_app_purchase/lib/src/in_app_purchase/in_app_purchase_connection.dart#L211

@dancamdev
Copy link
Author

@LHLL Yes, that was what it was all about. Still iOS 13.3.1 didn’t require you to call completePurchase after cancelling the purchase. I think it has to be explicitly stated in the documentation.

@LHLL
Copy link

LHLL commented Apr 1, 2020

@dancamdev Totally agree this needs to be documented in the plugin's API. Thanks for bring this up!

@cyanglaz Can we reuse Apple's comments and maybe add a code block in the documentation as an example since we are not really providing exactly same APIs as SKStoreKit?
https://developer.apple.com/documentation/storekit/skpaymentqueue/1506003-finishtransaction?language=objc

@fracon
Copy link

fracon commented Apr 1, 2020

@LHLL @dancamdev I really don't if this is the point of this issue. I'm completing all my purchases (except pending as documented) but still, when I click to do a new purchase I receive, on listen function, a previous purchase object with purchased status and expired instead receive a new purchase object with pending status. Am I missing some point here?

@LHLL
Copy link

LHLL commented Apr 1, 2020

@ fracon What type of product are you providing? It sounds like you are providing a subscription?

@fracon
Copy link

fracon commented Apr 1, 2020

@LHLL exactly my app provides some subscriptions and just to clarify what happened here:

  1. Friday, 27 March, everything was working;
  2. Saturday, 28 March, I updated my iOS to 13.4 and after when I tried to do make a new purchase I got a generic connection error with App Store;
  3. Monday, 29 March, after some tests I tried to increment my app version to see what happens and for my surprise when I tried to make a new purchase everything works good, the dialog shows, I could input my sandbox user password and continues with the flow;
  4. After my subscription reached the expiration date (30 minutes after the purchase) I tried to do a new purchase of the same subscription and nothing works anymore, I started to receive on Listen function a Purchase object representing the old purchase instead of the new one.
  5. I did the same process for another subscription offered in my app and the result was the same, first purchase OK then for the next I started to receive the old Purchase object on the Listen function.

@LHLL
Copy link

LHLL commented Apr 1, 2020

@fracon I believe your issue is a different issue. I periodically experience "Cannot connect to iTunes Store" error under sandbox environment while using SKStoreKit and I never got any responses from Apple while raising this issue in the Apple Developer Forums. Here are some similar issues raised there:
https://forums.developer.apple.com/thread/114644
https://forums.developer.apple.com/thread/73668

From my own experience, I think this might be an issue from Apple's side.

@dancamdev
Copy link
Author

@LHLL exactly my app provides some subscriptions and just to clarify what happened here:

  1. Friday, 27 March, everything was working;

  2. Saturday, 28 March, I updated my iOS to 13.4 and after when I tried to do make a new purchase I got a generic connection error with App Store;

  3. Monday, 29 March, after some tests I tried to increment my app version to see what happens and for my surprise when I tried to make a new purchase everything works good, the dialog shows, I could input my sandbox user password and continues with the flow;

  4. After my subscription reached the expiration date (30 minutes after the purchase) I tried to do a new purchase of the same subscription and nothing works anymore, I started to receive on Listen function a Purchase object representing the old purchase instead of the new one.

  5. I did the same process for another subscription offered in my app and the result was the same, first purchase OK then for the next I started to receive the old Purchase object on the Listen function.

It doesn’t seem like a different problem to me, I was getting exactly the same behavior. Make sure that when you finish your purchase, you call completePurchase(). If you don’t, it won’t be called automatically from iOS anymore, and upon app restart it will create an endless loop preventing the dialogs to appear and the transaction to actually be verified.

If you are willing to share the IAPS code either here or privately. I’ll have a look at it, and check if I get any issue.

@t-cardozo
Copy link

For anyone still having the issue with the newest update..
This is how I fixed it, both solutions worked for me

#57903 (comment)

@ziggycrane
Copy link

ziggycrane commented Jul 12, 2020

So from spending a DECENT amount of digging in here is my take:
iOS subscriptions transactionState will inevitably change to this at some point:
case restored = 3 // Transaction was restored from user's purchase history. Client should complete the transaction.

The only way to receive this transaction on flutter side is when you call await InAppPurchaseConnection.instance.queryPastPurchases(); BEFORE you subscribe to
InAppPurchaseConnection.instance.purchaseUpdatedStream;.

But all this isn't even a problem why things get stuck. The problem is with the
- (void)finishTransaction:(FlutterMethodCall *)call result:(FlutterResult)result method or the way transactions are stored in memory with this lib. You pass a productId to this method to complete transactions but Subscriptions will have multiple transactions but this IAP plugin will only save the last one in the array in the self.transactionsSetter because it uses productId as a key. So the initial transaction that will have the transactionState equal to 3 will be impossible to complete from flutter side because of the way transactions are stored in the transactionsSetter. I can't provide a solution because I can't code ObjectiveC, but please fix this issue ASAP, users can't resubscribe because of this issue.

I hope my research will be useful for a faster solution.

P.S. Maybe the solution is to store an array of all transactions for specific productId and when user calls finishTransaction it loops through all transactions for that productID and complete the ones that need to be completed.

P.S.S
This method is also part of the problem:

- (BOOL)addPayment:(SKPayment *)payment {
  if (self.transactionsSetter[payment.productIdentifier]) {
    return NO;
  }
  [self.queue addPayment:payment];
  return YES;
}

Because It makes impossible for user to re-subscribe if he was once a subscriber but cancelled. Why you do you even need to check that? Appstore will warn you if you have already purchesed an item or are an active subscriber.

@kinex
Copy link

kinex commented Jul 26, 2020

As @ziggycrane mentioned this is still not working with the latest update v0.3.4+1.

The error message I see from Crashlytics is "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 manuelly using completePurchase to avoid edge cases".

@Danis96
Copy link

Danis96 commented Jul 26, 2020

Yeah, I also have the same issue...

@MATTYGILO
Copy link

Same I'm still having the same issue

@d9media
Copy link

d9media commented Jul 30, 2020

So from spending a DECENT amount of digging in here is my take:
iOS subscriptions transactionState will inevitably change to this at some point:
case restored = 3 // Transaction was restored from user's purchase history. Client should complete the transaction.

The only way to receive this transaction on flutter side is when you call await InAppPurchaseConnection.instance.queryPastPurchases(); BEFORE you subscribe to
InAppPurchaseConnection.instance.purchaseUpdatedStream;.

@ziggycrane querying queryPastPurchases() before listening to purchaseUpdate seems a bit counter-intuitive to me. What is @LHLL take on this?

Currently my client is going through major anxiety because 1 in maybe 5 purchases seem to fail; the purchase is not being delivered that is. Since Apple isn't allowing dev's to test Storekit on the simulator I had to spent countless amount of hours on browserstack trying to debug the issue, it is such a mess from Apple's end. Now I have trouble justifying staying on the package even against my client. I don't know what to do so I'll probably file a report with apple code level support because i am so confused with this.

@Danis96
Copy link

Danis96 commented Jul 30, 2020

I strongly recommended flutter_in_app_purchase
It handles every case very well

@d9media
Copy link

d9media commented Jul 30, 2020

I strongly recommended flutter_in_app_purchase
It handles every case very well

You mean inapp_purchase? It's deprecated when I first looked into it... Could flutter not merge the code base of the two? People seem very happy with it

@Danis96
Copy link

Danis96 commented Jul 30, 2020

Sorry typo
I was thinking about flutter_inapp_purchase

It was stopped in some point,but recently they get it going again
It's awesome really

@regulus33
Copy link

regulus33 commented Jul 30, 2020 via email

@Danis96
Copy link

Danis96 commented Jul 30, 2020

@owenkealey
Copy link

owenkealey commented Jul 30, 2020 via email

@d9media
Copy link

d9media commented Jul 31, 2020

I also recommend flutter_in_app_purchase. Unlike this package, it actually works for subscriptions in iOS. It is documented more thoroughly and the underlying swift code is battle tested. it was used in a popular react native billing library for years and the maintainer was kind enough to port a flutter version for us ❤️

On Thu, Jul 30, 2020, 8:49 PM Daniel Schaefer @.***> wrote: So from spending a DECENT amount of digging in here is my take: iOS subscriptions transactionState will inevitably change to this at some point: case restored = 3 // Transaction was restored from user's purchase history. Client should complete the transaction. The only way to receive this transaction on flutter side is when you call await InAppPurchaseConnection.instance.queryPastPurchases(); BEFORE you subscribe to InAppPurchaseConnection.instance.purchaseUpdatedStream;. @ziggycrane https://github.com/ziggycrane querying queryPastPurchases() before listening to purchaseUpdate seems a bit counter-intuitive to me. What is @LHLL https://github.com/LHLL take on this? Currently my client is going through major anxiety because 1 in maybe 5 purchases seem to fail; the purchase is not being delivered that is. Since Apple isn't allowing dev's to test Storekit on the simulator I had to spent countless amount of hours on browserstack trying to debug the issue, it is such a mess from Apple's end. Now I have trouble justifying staying on the package even against my client. I don't know what to do so I'll probably file a report with apple code level support because i am so confused with this. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#53534 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDE3LNZCBNDBJQGU3X2IDLR6G6D7ANCNFSM4LWDFULQ .

Thanks it's just hard to drop it after all the time getting it to run on Google's plugin, not to speak the time it'd take to transition. I'll give the next update a chance. I know LHLL and some others are very committed to solving this for good

@pinpong
Copy link

pinpong commented Aug 14, 2020

Any news on this issue?

@kinex
Copy link

kinex commented Aug 14, 2020

@pinpong My pull request (link above) fixes the issue, I am using it in my production app already. If you try it, make sure you also call completePurchase when required (see example app), otherwise you will have this issue again.

Currently I call also this method before launching the purchase dialog (notice that this code works properly only if my PR is applied):

  Future<void> clearTransactionsIos() async {
    final transactions = await SKPaymentQueueWrapper().transactions();
    for (final transaction in transactions) {
      try {
        if (transaction.transactionState !=
            SKPaymentTransactionStateWrapper.purchasing) {
          await SKPaymentQueueWrapper().finishTransaction(transaction);
        }
      } catch (e) {
        print(e);
      }
    }
  }

Calling that method should not be necessary in normal circumstances, but it may be necessary for example now due to the current issues in this plugin (your earlier calls to completePurchase may not have been processed properly, so you need to "reset" the transaction queue). I am planning to remove that code later after all my users have upgraded to this fixed version.

@pinpong
Copy link

pinpong commented Aug 14, 2020

@kinex i wrote me a helper class to handle the iap. Thanks for the PR. Do you know why it's not working on Simulator? I get no error neither a purchase dialog.

abstract class IAPHelper {
  bool available = false;

  bool initialized = false;

  final InAppPurchaseConnection iap = InAppPurchaseConnection.instance;

  List<ProductDetails> availableProducts = [];

  List<PurchaseDetails> purchases = [];

  StreamSubscription subscription;

  bool purchased = false;

  void initIAP() async {
    await clearTransactionsIos();
    available = await iap.isAvailable();

    if (available) {
      await _getProducts();
      await _getPastPurchases();
      _verifyPurchase();
    }

    subscription = iap.purchaseUpdatedStream.listen(
        (purchaseDetails) => () {
              purchases.addAll(purchaseDetails);
              _verifyPurchase();
            }, onDone: () {
      subscription?.cancel();
    }, onError: (e) {
      initialized = false;
      onLoaded.call(initialized);
    });

    Future.delayed(Duration(milliseconds: 1000))
        .then((value) => {initialized = true, onLoaded.call(initialized)});
  }

  void disposeIAP() async {
    subscription?.cancel();
  }

  Future<void> clearTransactionsIos() async {
    if (Platform.isIOS) {
      final transactions = await SKPaymentQueueWrapper().transactions();
      for (final transaction in transactions) {
        try {
          if (transaction.transactionState !=
              SKPaymentTransactionStateWrapper.purchasing) {
            await SKPaymentQueueWrapper().finishTransaction(transaction);
          }
        } catch (e) {
          print(e);
        }
      }
    }
  }

  List<String> _getProductIDs() {
    return [Constants.MONTH_ABO_ID, Constants.YEAR_ABO_ID];
  }

  Future<void> _getProducts() async {
    ProductDetailsResponse response =
        await iap.queryProductDetails(_getProductIDs().toSet());
    availableProducts = response.productDetails;
  }

  Future<void> _getPastPurchases() async {
    QueryPurchaseDetailsResponse response = await iap.queryPastPurchases();
    if (response.error != null) {
      // Handle the error.
    }
    for (final purchase in response.pastPurchases) {
      if (purchase.pendingCompletePurchase) {
        if (Platform.isIOS) {
          await iap.completePurchase(purchase);
        }
      }
    }

    purchases = response.pastPurchases;
  }

  PurchaseDetails _hasPurchased(String productID) {
    return purchases.firstWhere((purchase) => purchase.productID == productID,
        orElse: () => null);
  }

  void subscribeProduct(ProductDetails prod) async {
    final PurchaseParam purchaseParam = PurchaseParam(productDetails: prod);
    iap.buyNonConsumable(purchaseParam: purchaseParam);
  }

  void _verifyPurchase() async {
    for (String id in _getProductIDs()) {
      PurchaseDetails purchase = _hasPurchased(id);
      if (purchase != null) {
        switch (purchase.status) {
          case PurchaseStatus.pending:
            onPending.call(purchase);
            break;
          case PurchaseStatus.purchased:
            purchased = true;
            onSuccessPurchase.call(purchase);
            break;
          case PurchaseStatus.error:
            purchased = false;
            onBillingError.call(purchase.error);
            break;
        }
      }
    }
    onLoaded.call(initialized);
  }

  void onLoaded(bool initialized) {}

  void onPending(PurchaseDetails product) {}

  void onSuccessPurchase(PurchaseDetails product) {}

  void onBillingError(IAPError error) {}
}

@kinex
Copy link

kinex commented Aug 14, 2020

@pinpong IAPs must be tested in a real device. In addition your code is not calling completePurchase in the iap.purchaseUpdatedStream.listen handler. Please refer to the plugin example app and maybe better to ask further questions in StackOverflow.

@matthew-carroll
Copy link
Contributor

@cyanglaz it looks like a lot of valuable anecdotes were added to this issue after it was closed. Is there another ticket tracking the post-close issue? I think I'm in the middle of this problem, and if I'm understanding things correctly, this is a serious and fundamental problem in the plugin.

@ziggycrane's comment seems like it should be addressed:
#53534 (comment)

Should we file a new ticket? Is this already being discussed/handled somewhere?

@erperejildo
Copy link

v0.3.4+1

Using v0.3.4+16 with same error

@TahaTesser
Copy link
Member

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@Azzeccagarbugli
Copy link

Azzeccagarbugli commented Nov 12, 2020

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

I always get the following problem:

PlatformException (PlatformException(storekit_getproductrequest_platform_error, The operation couldn’t be completed. (SKErrorDomain error 0.), Error Domain=SKErrorDomain Code=0 "(null)" UserInfo={NSUnderlyingError=0x600000b97870 {Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response}}}, null))

[✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H15, locale en-GB)
    • Flutter version 1.22.3 at /Users/azzeccagarbugli/dev/flutter
    • Framework revision 8874f21e79 (2 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 30.0.2)
    • Android SDK at /Users/azzeccagarbugli/Library/Android/sdk/
    • Platform android-30, build-tools 30.0.2
    • 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-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.9.3

[!] 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-6222593)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (1 available)
    • iPhone 11 (mobile) • 64B21A14-8BB8-4BCB-82B6-BDF227D99402 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
    ! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)

! Doctor found issues in 1 category.

@ondev
Copy link

ondev commented Dec 9, 2020

clean the transactions first:

    var paymentWrapper = SKPaymentQueueWrapper();
    var transactions = await paymentWrapper.transactions();
    transactions.forEach((transaction) async {
      await paymentWrapper.finishTransaction(transaction);
    });

@junaidlodhi22
Copy link

@ondev yes right
for all those still having this issue on the iOS side
you need to call
in_app_purchase.completePurchase(purchase);
for PurchaseStatus.error also. Android works without that but ios do not

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
@flutter-triage-bot flutter-triage-bot bot added P0 Critical issues such as a build break or regression and removed P2 labels Jun 28, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. p: in_app_purchase Plugin for in-app purchase P0 Critical issues such as a build break or regression package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests