{"action":"closed","issue":{"url":"https://api.github.com/repos/flutter/flutter/issues/44517","repository_url":"https://api.github.com/repos/flutter/flutter","labels_url":"https://api.github.com/repos/flutter/flutter/issues/44517/labels{/name}","comments_url":"https://api.github.com/repos/flutter/flutter/issues/44517/comments","events_url":"https://api.github.com/repos/flutter/flutter/issues/44517/events","html_url":"https://github.com/flutter/flutter/issues/44517","id":520471038,"node_id":"MDU6SXNzdWU1MjA0NzEwMzg=","number":44517,"title":"in_app_purchase iOS items not found (unavailable)","user":{"login":"Brunux","id":3082623,"node_id":"MDQ6VXNlcjMwODI2MjM=","avatar_url":"https://avatars2.githubusercontent.com/u/3082623?v=4","gravatar_id":"","url":"https://api.github.com/users/Brunux","html_url":"https://github.com/Brunux","followers_url":"https://api.github.com/users/Brunux/followers","following_url":"https://api.github.com/users/Brunux/following{/other_user}","gists_url":"https://api.github.com/users/Brunux/gists{/gist_id}","starred_url":"https://api.github.com/users/Brunux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brunux/subscriptions","organizations_url":"https://api.github.com/users/Brunux/orgs","repos_url":"https://api.github.com/users/Brunux/repos","events_url":"https://api.github.com/users/Brunux/events{/privacy}","received_events_url":"https://api.github.com/users/Brunux/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-11-09T16:24:03Z","updated_at":"2019-11-11T09:40:37Z","closed_at":"2019-11-11T09:40:36Z","author_association":"NONE","body":"Hello there, \r\n\r\nI'm having issues getting the in-app purchase to work on iOS, when I query to get the items that I've created on apple connect items are showing as not found (unavailable) here is how I initialize and get the items.\r\n```\r\n  /// Initialize data \r\n  void _initialize() async {\r\n    // Check availability of In App Purchases\r\n    _available = await _iap.isAvailable();\r\n    print('########## Store is avalable? $_available');\r\n    if (_available) {\r\n      passes = {'week_pass_one_time', 'month_pass_one_time', 'month_subscription', 'consumable'};\r\n      await _getProducts();\r\n      await _getPastPurchases();\r\n      // Verify and deliver a purchase with your own business logic\r\n      // _verifyPurchase();\r\n    } else {\r\n      _purchaseBloc.dispatch(BuyingError(\r\n        error: \"Sorry, your device Store is not available.\")\r\n      );\r\n    }\r\n    // Listen to new purchases\r\n    _subscription = _iap.purchaseUpdatedStream.listen((data) => setState(() {\r\n      print('########### NEW PASS PURCHASED');\r\n      print(data.toString());\r\n      _purchases.addAll(data);\r\n      _verifyPurchase(_products[passSelected].id);\r\n    }));\r\n  }\r\n\r\n  /// Get all products available for sale\r\n  Future<void> _getProducts() async {\r\n    Set<String> ids = Set.from(passes);\r\n    print('############# Passes IDs to query: $ids');\r\n    ProductDetailsResponse response = await _iap.queryProductDetails(ids);\r\n\r\n    setState(() { \r\n      _loading = false;\r\n      _products = response.productDetails;\r\n      print('########## Not Found IDS: ${response.notFoundIDs}');\r\n      print('########### Products: ${response.productDetails.toString()}');\r\n    });\r\n  }\r\n\r\n  /// Gets past purchases\r\n  Future<void> _getPastPurchases() async {\r\n    QueryPurchaseDetailsResponse response =\r\n        await _iap.queryPastPurchases();\r\n\r\n    for (PurchaseDetails purchase in response.pastPurchases) {\r\n      if (Platform.isIOS) {\r\n        InAppPurchaseConnection.instance.completePurchase(purchase);\r\n      }\r\n    }\r\n\r\n    setState(() {\r\n      _purchases = response.pastPurchases;\r\n      print('########### Past Purchases:');\r\n      for (PurchaseDetails purchas in _purchases) {\r\n        print('Purchase ID: ${purchas.purchaseID}');\r\n        print('Product ID: ${purchas.productID}');\r\n        print('Status: ${purchas.status}');\r\n        print('Transaction DATE: ${DateTime.fromMillisecondsSinceEpoch(int.parse(purchas.transactionDate)).toUtc().toString()}');\r\n        print('Purchase verification Data:');\r\n        print('Server: ${purchas.verificationData.serverVerificationData}');\r\n        print('Local: ${purchas.verificationData.localVerificationData}');\r\n        print('Purchase sourece: ${purchas.verificationData.source.toString()}');\r\n      }\r\n    });\r\n  }\r\n```\r\n\r\nI have tried with different types of products here are my current products\r\n![Screen Shot 2019-11-09 at 9 56 41](https://user-images.githubusercontent.com/3082623/68531382-452ca780-02d7-11ea-9bc6-ba3f3985d7c2.png)\r\n\r\nbut I get same output from initialization process:\r\n```\r\nflutter: ########## Store is available? true\r\nflutter: ############# Passes IDs to query: {week_pass_one_time, month_pass_one_time, month_subscription, consumable}\r\nflutter: ########## Not Found IDS: [week_pass_one_time, month_pass_one_time, month_subscription, consumable]\r\nflutter: ########### Products found: []\r\nflutter: ########### Past Purchases:\r\n```\r\nAs you can see all IAP items that I query for are not found (unavailable) what am I missing?\r\n\r\nI've read somewhere that in order for the items to be found the app need to be approved in `Apple connect`, but I've no confirmation of this, but if that's the case I can't get app to be approved due to in-app purchase items are not showing ('cos I can't get them).\r\n\r\nIn the other hand same initialization process works fine with android in fact I can buy and validate purchase items.\r\n\r\nDoes anybody has had this issue? How did you solve it?\r\n\r\nAny feedback that you can give me is appreciated."}}
{"actor":{"display_login":"iapicca"}}