- iPhone 13 17.5.1
- iPhone X 16.3
- iPad Air (5-го поколения) 17.5.1
Код: Выделить всё
this.buyProduct()}>
{global.I18n.t('payNow')}
Код: Выделить всё
async buyProduct() {
const user = JSON.parse(await AsyncStorage.getItem('user'));
await Purchases.setAttributes({
email: user.user.email
});
this.setState({isLoading: true});
const offerings = await Purchases.getOfferings();
let customerInfo, productIdentifier;
try {
customerInfo, productIdentifier = await Purchases.purchasePackage(offerings.current.availablePackages[0]);
} catch (e) {
this.setState({isPremium: false, isLoading: false});
}
this.setState({isPremium: true, isLoading: false});
}
Код: Выделить всё
async checkSubscriptionStatus() {
try {
const customerInfo = await Purchases.getCustomerInfo();
// Check if the customer has any active entitlements
const activeSubscriptions = customerInfo.entitlements.active;
const isSubscribed = Object.keys(activeSubscriptions).length > 0;
this.setState({isPremium: isSubscribed});
console.log('Is Subscribed:', isSubscribed);
return isSubscribed;
} catch (error) {
this.setState({isPremium: false});
console.error('Error fetching customer info:', error);
return false;
}
};
В частности , ваше приложение не ответило, когда мы нажали кнопку «Оплатить сейчас» под платным доступом. Ознакомьтесь с приведенной ниже информацией и ресурсами и выполните следующие действия.
Код: Выделить всё
Review device details:
- Device type: iPad Air (5th generation)
- OS version: iOS 17.5.1
Подробнее здесь: https://stackoverflow.com/questions/787 ... er-payment
Мобильная версия