Repository: flutter
Issue: [in_app_purchase] not working on iOS when publishing to testflight
Labels: platform-ios,p: in_app_purchase,package,a: release,P2,team-ios,triaged-ios

## Steps to Reproduce

when publishing to testflight purchase subscription not working.

I am running:
```
    if (Platform.isIOS) {
      final paymentWrapper = SKPaymentQueueWrapper();
      final transactions = await paymentWrapper.transactions();

      await Future.wait(transactions
          .map((transaction) => paymentWrapper.finishTransaction(transaction)));
    }
```

just in case to clean the queue for iOS but still on testflight getting an error.

code:
```
  Future<bool> subscribe(String plan) async => await _iap.buyNonConsumable(
        purchaseParam: PurchaseParam(
          productDetails: await getItem(plan),
        ),
      );
      
  Future<ProductDetails> getItem(String id) async {
    final result = await _iap.queryProductDetails({id});

    if (result.notFoundIDs?.isNotEmpty ?? false) {
      return null;
    }

    return result.productDetails[0];
  }
```

1. Publish to testflight
2. try to purchase a subscription

**Expected results:** purchase a subscription

**Actual results:**  getting an error, because its on testflight can't really know much about it.

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
during debug all is working good, when publishing to testflight getting errors.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing app...                                                        
No issues found! (ran in 3.8s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.0.4, on macOS 11.2.3 20D91 darwin-x64, locale en-GB)
    • Flutter version 2.0.4 at /Users/user/Applications/Developer/flutter
    • Framework revision b1395592de (4 days ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Users/user/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/user/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 at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.55.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.114
    ! Error: iPhone 7 is not connected. Xcode will continue when iPhone 7 is connected. (code -13)

• No issues found!
```

</details>