Skip to content

Commit

Permalink
updated iap version to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
dendidibe committed Sep 27, 2023
1 parent e1a6cc2 commit 205b171
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion client-reactnative/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"react-native-gifted-chat": "^0.16.3",
"react-native-highlight-words": "^1.0.1",
"react-native-hyperlink": "^0.0.19",
"react-native-iap": "8.0.7",
"react-native-iap": "10.1.0",
"react-native-image-picker": "^4.8.2",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-linear-gradient": "^2.5.6",
Expand Down
36 changes: 19 additions & 17 deletions client-reactnative/src/screens/Account/CoinPurchaseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,32 @@ export const CoinPurchaseScreen: React.FC<ICoinPurchaseScreen> = ({}) => {
} = useIAP();
const requestCoinPurchase = async (id: string) => {
try {
const transaction = await requestPurchase(id, false);

await finishTransaction(transaction, true);
const res = await httpPost(
'/users/payments',
{
type: 'purchase',
transaction: transaction,
platform: Platform.OS,
password: Platform.OS === 'ios' ? appleKey : '',
},
loginStore.userToken,
);
await walletStore.fetchWalletBalance(loginStore.userToken, true);
console.log(res.data);
showSuccess('Succes', 'Please, check your balance');
const transaction = await requestPurchase({sku: id});
if(transaction) {
await finishTransaction({purchase: transaction});
const res = await httpPost(
'/users/payments',
{
type: 'purchase',
transaction: transaction,
platform: Platform.OS,
password: Platform.OS === 'ios' ? appleKey : '',
},
loginStore.userToken,
);
await walletStore.fetchWalletBalance(loginStore.userToken, true);
console.log(res.data);
showSuccess('Succes', 'Please, check your balance');
}

} catch (err) {
showError('Error', 'Please try again');
}
};

useEffect(() => {
if (connected) {
getProducts(productIds);
getProducts({skus: productIds});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [connected]);
Expand Down
12 changes: 5 additions & 7 deletions client-reactnative/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,7 @@ domutils@^3.0.1:
domelementtype "^2.3.0"
domhandler "^5.0.1"

dooboolab-welcome@1.3.2, dooboolab-welcome@^1.3.2:
dooboolab-welcome@^1.3.2:
version "1.3.2"
resolved "https://registry.npmjs.org/dooboolab-welcome/-/dooboolab-welcome-1.3.2.tgz"
integrity sha512-2NbMaIIURElxEf/UAoVUFlXrO+7n/FRhLCiQlk4fkbGRh9cJ3/f8VEMPveR9m4Ug2l2Zey+UCXjd6EcBqHJ5bw==
Expand Down Expand Up @@ -9954,12 +9954,10 @@ react-native-hyperlink@^0.0.19:
linkify-it "^2.2.0"
mdurl "^1.0.0"

[email protected]:
version "8.0.7"
resolved "https://registry.npmjs.org/react-native-iap/-/react-native-iap-8.0.7.tgz"
integrity sha512-YVZp9g01oSIZ5sT0wxjrYw0kjLUuABH0+PTTxgSUgGQewnGlO9fUIu1fixXkC8nKFS1QhGJLlbaOzVfv+9uRqA==
dependencies:
dooboolab-welcome "1.3.2"
[email protected]:
version "10.1.0"
resolved "https://registry.yarnpkg.com/react-native-iap/-/react-native-iap-10.1.0.tgz#3885c43a02a03d66282eda476d0e9e51ddd7a6eb"
integrity sha512-G835JtVuB8Y+zKzqYmJ7GJyxXdKGn9iO7kVjKUTlPhIWSpatD21XkNMXsmJWiSZ3nxqu4luzdshg8r4ob5Mz1g==

react-native-image-picker@^4.8.2:
version "4.10.3"
Expand Down

0 comments on commit 205b171

Please sign in to comment.