2

Every thing was working fine until my app got approved by App Store Connect.

When my IAP was on "Ready to Submit" I was getting my product just fine. But now, it is on the "Approved" state and my product is coming with empty title and description. Price and identifiers are fine.

I'm experiencing this same behavior even while using the Magic Weather example app from RevenueCat.

Here's my code:

Future<void> _initPlatformState() async {
    await Purchases.setup("******************************", appUserId: null);
    Purchases.addPurchaserInfoUpdateListener((info) {
      _checkIfVIP(info);
    });
    try {
      purchaserInfo = await Purchases.getPurchaserInfo();
      print('PurchaserInfo: ' + purchaserInfo.toString());
      //_checkIfVIP(purchaserInfo);
    } on PlatformException catch (e) {
      print('PlatformException: ' + e.toString());
    }
    print('is user vip? ' + isVIP.toString());
  }

  void _checkIfVIP(PurchaserInfo purchaserInfo) {
    if (purchaserInfo != null && purchaserInfo.entitlements.all['vip'] != null) {
      setIsVIP(purchaserInfo.entitlements.all['vip'].isActive);
    } else {
      setIsVIP(false);
    }
    notifyListeners();
  }

  Offerings _offerings;

  Future<Offerings> getOfferings() async {
    Offerings offerings;
    if (_offerings != null)
      offerings = _offerings;
    else {
      try {
        offerings = await Purchases.getOfferings();
      } on PlatformException catch (e) {
        print(e.toString());
      }
    }
    print(offerings.toString());
    return offerings;
  }

And

Future<void> doPurchase() async {
    try {
      if (_offerings != null) {
        _toggleLoadingState();
        PurchaserInfo purchaserInfo = await Purchases.purchasePackage(_offerings.current.monthly);
        // the native purchase window should open before going forward
        if (purchaserInfo.entitlements.all["vip"].isActive) {
          MainModel mainModel = Provider.of<MainModel>(context, listen: false);
          mainModel.setIsVIP(true);
          showDialog(
            context: context,
            builder: (BuildContext context) {
              return AlertDialog(
                title: new Text(S.current.welcome_to_the_vip_group),
                content: new Text(
                  S.current.purchase_success,
                  textAlign: TextAlign.center,
                ),
                actions: <Widget>[
                  new TextButton(
                    child: new Text(S.current.close),
                    onPressed: () => {popToPreviousPage(context)},
                  ),
                ],
              );
            },
          );
        } else {
          print('purchaserInfo.entitlements.all["vip"].toString());
          _toggleLoadingState();
        }
      }
    } on PlatformException catch (e) {
      _toggleLoadingState();
      var errorCode = PurchasesErrorHelper.getErrorCode(e);
      showDialog(
        context: context,
        builder: (BuildContext context) {
          if (errorCode == PurchasesErrorCode.purchaseCancelledError) {
            return AlertDialog(
              title: new Text(''),
              content: new Text(
                S.current.purchase_canceled_error,
                textAlign: TextAlign.center,
              ),
              actions: <Widget>[
                new TextButton(
                  child: new Text(S.current.close),
                  onPressed: () => Navigator.pop(context),
                ),
              ],
            );
          } else if (errorCode == PurchasesErrorCode.storeProblemError) {
            return AlertDialog(
              title: new Text(S.current.oops),
              content: new Text(S.current.purchase_store_problem_error(Platform.isAndroid ? 'Google Play' : 'App Store')),
              actions: <Widget>[
                new TextButton(
                  child: new Text(S.current.close),
                  onPressed: () => Navigator.pop(context),
                ),
              ],
            );
          } else {
            return AlertDialog(
              title: new Text(S.current.oops),
              content: new Text(S.current.purchase_default_error),
              actions: <Widget>[
                new TextButton(
                  child: new Text(S.current.close),
                  onPressed: () => Navigator.pop(context),
                ),
              ],
            );
          }
        },
      );
      print('isLoadingSomething = ' + e.toString());
    }
  }

Here's the log from Magic Weather app:

flutter run
Launching lib/main.dart on iPhone de **** in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: ********
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         6,7s
Xcode build done.                                           12,1s
Installing and launching...                                        13,3s
Syncing files to device iPhone de ******...                      75ms

Flutter run key commands.
r Hot reload. 
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

An Observatory debugger and profiler on iPhone de ***** is available at: http://127.0.0.1:50626/3xLvY2V4t7c=/
[Purchases] - DEBUG: ℹ️ Debug logging enabled
[Purchases] - DEBUG: ℹ️ SDK Version - 3.11.1
[Purchases] - DEBUG:  Initial App User ID - (null)
[Purchases] - DEBUG: ℹ️ Sending latest PurchaserInfo to delegate.
[Purchases] - DEBUG: ℹ️ Delegate set
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET /subscribers/$RCAnonymousID0X0P+09303b005bcc24f1a83115fa2a44c4a11
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:9303b005bcc24f1a83115fa2a44c4a11
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:9303b005bcc24f1a83115fa2a44c4a11/offerings
The Flutter DevTools debugger and profiler on iPhone de ****** is available at:
http://127.0.0.1:9101?uri=http://127.0.0.1:50626/3xLvY2V4t7c=/
[connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 54.90.18.6:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed
[connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 54.90.18.6:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:9303b005bcc24f1a83115fa2a44c4a11 200
[Purchases] - DEBUG: ℹ️ Serial request done: GET /subscribers/$RCAnonymousID0X0P+09303b005bcc24f1a83115fa2a44c4a11, 0 requests left in the queue
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/$RCAnonymousID:9303b005bcc24f1a83115fa2a44c4a11/offerings 200
[Purchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: {(
    0001
)}
[Purchases] - DEBUG: ℹ️ Products request finished.
[Purchases] - DEBUG:  Retrieved SKProducts: 
[Purchases] - DEBUG:  0001 - <SKProduct: 0x280ea0030>
[Purchases] - DEBUG: ℹ️ 1 completion handlers waiting on products
[Purchases] - DEBUG: ℹ️ Vending PurchaserInfo from cache.
[Purchases] - DEBUG: ℹ️ Vending Offerings from cache

All is good on Android and all seems good on App Store Connect.

I've also reported this problem on their github page (here and here) but with no help.

Any idea of what might be happening? I even tried changing my product title to see if it would fix it but with no success.

Been struggling for weeks. Don't know what to do anymore.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57

1 Answers1

0

Turns out something was corrupted on the flutter SDK. I deleted and redownloaded the flutter SDK and it worked.

Weird.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57
  • 2
    I had exactly the same issue. Deleting all App Store Localizations from App Store Connect and adding them again fixed the issue. You also mentioned it on your second link so I just gave it a try and it worked! Thanks anyways. – Vincent Gigandet May 15 '22 at 05:47