I have this code in my React Native project:
static async validateSub(sub,pin) {
sub_can_access = 'no'
url = 'https://server.com/validator.php'
let resp = await fetch(url + '?param1='+sub+'¶m2='+pin);
if (resp._bodyText.indexOf("TRUE") >= 0) {
AsyncStorage.setItem('email', sub)
AsyncStorage.setItem('password', pin)
sub_can_access = 'yes'
} else {
alert('Try Again');
}
}
The server returns the text TRUE Blah Blah Blah. And on Android it works fine, but for iOS, the variable resp comes undefined.
What could be happening?