react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

Sku is not visible

Open Nitika2023 opened this issue 11 months ago • 4 comments

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description The SKUs are not working after initializing the connection in React Native IAP, and I am not getting the products (SKUs) in my list.

Environment:

  • react-native-iap: "12.15.2",
  • react-native:"0.69.3",
  • Platforms (iOS, Android, emulator, simulator, device): IOS

Nitika2023 avatar Jan 20 '25 11:01 Nitika2023

This is my code
const initalizeIAP = async () => {

    await  initConnection();

    purchaseUpdateSubscription = purchaseUpdatedListener(purchase => {
        setLoading(true);
        const receiptValue = purchase.transactionReceipt;

        if (!isReceiptValidationRequestInProgress && !!receiptValue) {
            setIsReceiptValidationRequestInProgress(true);
            getUserSettings().then((userdata) => {
                validatePurchaseIOS(receiptValue, userdata.uid).then((resp: any) => {

                    if (resp.status === 'Success') {
                        getUserSettings().then((userSettings) => {

                            setUser(userSettings.user);

                            //Finish transaction once the grant is successful i.e. paymentPackage field is other than 'free'
                            finishTransaction({
                                purchase: purchase,
                                isConsumable: false,
                            })
                            setIsReceiptValidationRequestInProgress(false);
                        })
                    }
                    else {
                        Alert.alert('Purchase receipt could not be validated')
                    }
                }).catch((error) => {
                    console.log(error, 'error');
                    Alert.alert('Purchase receipt could not be validated')
                    setLoading(false);

                }
                )
            })
            setLoading(false);
        }

    });
    purchaseErrorSubscription = purchaseErrorListener(
        (error: PurchaseError) => {
            setLoading(false)
        },
    );
}

// get iOS in-app purchase product list
const _getProducts = () => {
    getProducts({
        skus: [
            'com.mmapp.smarteye.monthlyplan', 'com.mmapp.smarteye.yearlyplan'
        ],
    });
};

Nitika2023 avatar Jan 21 '25 04:01 Nitika2023

+1

felipegmg avatar Jan 21 '25 16:01 felipegmg

Check your App Store Connect to make sure the Business information is filled out. You need to confirm the agreements and complete bank and tax information. Products will not be available if the business information is not complete.

muduolin avatar Apr 18 '25 02:04 muduolin

I also faced the same issue — the list temporarily disappears after finishTransaction is called

chiragramimi avatar May 01 '25 11:05 chiragramimi

I’m closing all issues reported in versions below 14, as the library now supports the new architecture with NitroModules and has been completely revamped.

hyochan avatar Sep 30 '25 18:09 hyochan