{"action":"created","issue":{"url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/288","repository_url":"https://api.github.com/repos/dooboolab/react-native-iap","labels_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/288/labels{/name}","comments_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/288/comments","events_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/288/events","html_url":"https://github.com/dooboolab/react-native-iap/issues/288","id":370910565,"node_id":"MDU6SXNzdWUzNzA5MTA1NjU=","number":288,"title":"restoring purchase made with redeem code doesn't work on IPhone SE, works on others","user":{"login":"eis","id":1004507,"node_id":"MDQ6VXNlcjEwMDQ1MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1004507?v=4","gravatar_id":"","url":"https://api.github.com/users/eis","html_url":"https://github.com/eis","followers_url":"https://api.github.com/users/eis/followers","following_url":"https://api.github.com/users/eis/following{/other_user}","gists_url":"https://api.github.com/users/eis/gists{/gist_id}","starred_url":"https://api.github.com/users/eis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eis/subscriptions","organizations_url":"https://api.github.com/users/eis/orgs","repos_url":"https://api.github.com/users/eis/repos","events_url":"https://api.github.com/users/eis/events{/privacy}","received_events_url":"https://api.github.com/users/eis/received_events","type":"User","site_admin":false},"labels":[{"id":937032015,"node_id":"MDU6TGFiZWw5MzcwMzIwMTU=","url":"https://api.github.com/repos/dooboolab/react-native-iap/labels/iOS","name":"iOS","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-10-17T05:59:58Z","updated_at":"2018-11-07T06:09:59Z","closed_at":null,"author_association":"NONE","body":"### Version of react-native-iap\r\n\r\n1.3.6\r\n\r\n### Platforms you faced the error (IOS or Android or both?)\r\n\r\nIOS\r\n\r\n### Expected behavior\r\n\r\nRedeeming purchases would work\r\n\r\n### Actual behavior\r\n\r\nRedeeming purchases don't work\r\n\r\n### Tested environment (Emulator? Real Device?)\r\n\r\nReal device, IPhone SE\r\n\r\n### Steps to reproduce the behavior\r\n\r\nThis is the relevant code I'm using to update product bought status:\r\n\r\n```\r\n    async initPurchasesIfNeeded() {\r\n        if (this.state.iapInitialized) {\r\n          return new Promise((resolve, reject) => resolve(true));\r\n        }\r\n        console.info('initializing iap connection');\r\n        await RNIap.prepare()\r\n          .then(() => {\r\n            this.setState({iapInitialized: true});\r\n            console.info('iap connection initialized');\r\n            return new Promise((resolve, reject) => resolve(true));\r\n          })\r\n          .catch(err => console.error(err))\r\n    }\r\n\r\n    async updateProductBoughtStatus(albumId) {\r\n        try {\r\n\r\n            console.info('preparing products...');\r\n\r\n            await this.initPurchasesIfNeeded();\r\n            console.info('fetching products...');\r\n\r\n            const products = await RNIap.getProducts(itemSkus);\r\n            console.debug('got products: ' + JSON.stringify(products));\r\n\r\n            products.forEach((product) => {\r\n                if (product.productId === albumId) {\r\n                    this.setState({albumPrice: product.localizedPrice});\r\n                }\r\n            });\r\n\r\n            const boughtItems = await RNIap.getAvailablePurchases();\r\n            console.debug('got bought items: ' + JSON.stringify(boughtItems));\r\n            boughtItems.forEach((boughtItem) => {\r\n            if (albumId === boughtItem.productId) {\r\n                if (!this.state.albumBought)\r\n                    this.setState({albumBought: true});\r\n\r\n                this.setState({showRestorePurchases: false});\r\n            }\r\n            });\r\n            if (!this.isEmpty(boughtItems)) {\r\n                // store status in async storage\r\n            }\r\n        } catch (err) {\r\n            console.warn(err);\r\n        } finally {\r\n            this.setState({albumState: albums});\r\n        }\r\n    }\r\n```\r\n\r\nThis seems to work for android & ios, in sandbox and in production. However, in production we've started getting complaints from people using IPhone SE that when after they redeem their promo code for their iap, the status will not update to reflect that. Indeed, when I found an IPhone SE to play with, this seems to be the case. However, for all other iphones I've tested - for example IPhone 6, which is of older generation than IPhone SE - things seem to work fine. Any idea what could be wrong? This seems to be really hard to debug, as even for IPhone SE sandbox testing with purchases seems to work ok. However, there are no iap promo codes in sandbox, so I can't test that specifically, and I can't really debug the released production version either.\r\n\r\nUpdating OS version doesn't seem to have any effect, the problem occurred with 11.4.1 as well as after updating to 12.0.1."},"comment":{"url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/comments/436515222","html_url":"https://github.com/dooboolab/react-native-iap/issues/288#issuecomment-436515222","issue_url":"https://api.github.com/repos/dooboolab/react-native-iap/issues/288","id":436515222,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjUxNTIyMg==","user":{"login":"eis","id":1004507,"node_id":"MDQ6VXNlcjEwMDQ1MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1004507?v=4","gravatar_id":"","url":"https://api.github.com/users/eis","html_url":"https://github.com/eis","followers_url":"https://api.github.com/users/eis/followers","following_url":"https://api.github.com/users/eis/following{/other_user}","gists_url":"https://api.github.com/users/eis/gists{/gist_id}","starred_url":"https://api.github.com/users/eis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eis/subscriptions","organizations_url":"https://api.github.com/users/eis/orgs","repos_url":"https://api.github.com/users/eis/repos","events_url":"https://api.github.com/users/eis/events{/privacy}","received_events_url":"https://api.github.com/users/eis/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T06:09:59Z","updated_at":"2018-11-07T06:09:59Z","author_association":"NONE","body":"Note though that like I wrote in the initial message,\r\n> Updating OS version doesn't seem to have any effect, the problem occurred with 11.4.1 as well as after updating to 12.0.1.\r\n\r\nso if the fix was related to OS version like in the description of the issue you linked, it might be something different."}}
{"actor":{"display_login":"eis"}}