I created one subscriptoin on my App Store Connect
enter image description here
And tried to get this in my code like this
const { connected, getSubscriptions } = useIAP()
const subSkus = ['Basic']
const handleGetSubscriptions = async () => {
try {
if (connected) {
const subs = await getSubscriptions({ skus: subSkus })
console.log(subs, 'subs')
}
} catch (error) {
console.error('Error in handleGetSubscriptions:', error)
}
}
React.useEffect(() => {
handleGetSubscriptions()
}, [connected])
but in console i see undefined
how i can fix this?
if you need more info tell me about this!
New contributor
Марко Лазарчук is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.