diff --git a/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js b/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js index 7460a6d63..30f3aa388 100644 --- a/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js +++ b/src/components/basicUIElements/view/placeHolder/boostPlaceHolderView.js @@ -20,7 +20,7 @@ const BoostPlaceHolder = () => { {({ isDarkTheme }) => { const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; return ( - + diff --git a/src/containers/inAppPurchaseContainer.js b/src/containers/inAppPurchaseContainer.js index e79c8ca14..510f83342 100644 --- a/src/containers/inAppPurchaseContainer.js +++ b/src/containers/inAppPurchaseContainer.js @@ -25,7 +25,14 @@ class InAppPurchaseContainer extends Component { } // Component Life Cycle Functions - componentDidMount() { + async componentDidMount() { + try { + await RNIap.initConnection(); + await RNIap.flushFailedPurchasesCachedAsPendingAndroid(); + } catch (err) { + bugsnagInstance.notify(err); + console.warn(err.code, err.message); + } this._getItems(); this._purchaseUpdatedListener(); } @@ -40,6 +47,7 @@ class InAppPurchaseContainer extends Component { this.purchaseErrorSubscription.remove(); this.purchaseErrorSubscription = null; } + RNIap.endConnection(); } // Component Functions @@ -111,16 +119,15 @@ class InAppPurchaseContainer extends Component { _getItems = async () => { const { skus } = this.props; - try { const products = await RNIap.getProducts(skus); - + console.log(products); products.sort((a, b) => parseFloat(a.price) - parseFloat(b.price)).reverse(); await this.setState({ productList: products }); } catch (err) { bugsnagInstance.notify(err); Alert.alert( - `InApp - Connection issue, try again or write to support@ecency.com + `InApp - Connection issue ${err.message.substr(0, 20)}`, ); }