I've been trying to solve this issue but cannot seem to pinpoint where the problem is with this function:
import {useIAP,isIosStorekit2, PurchaseError, requestSubscription,subscriptionStatus,IapIosSk2} from 'react-native-iap';
const isSubbed = () => {
console.log(connected)
console.log('awaiting subbed')
IapIosSk2.subscriptionStatus('lxm_1999_1m_1w0').then(res=>{
console.log('returned: ', res)
return res
}).catch( ()=>{
console.log('failed to get status')
})
}
console.log('hasSubscription?: ', isSubbed())
and I am getting the following log:
LOG awaiting subbed
LOG hasSubscription?: undefined
LOG returned: undefined
Is there a problem with the way I am calling this promise? I am expecting an array as the result of this function.