Closed mohanenm closed 2 years ago
@mohanenm Is this in Android or iOS? I think the function is available only on Android
We were seeing the error on android. I was not able to recreate it.
The issue comes up sporadically and on the first launch of the application, it is not widespread. Could there be something to permissions not being set yet?
@mohanenm How I can reproduce this issue?
Below is the code snippet. where the function is called const res = await check( Platform.OS == 'ios' ? PERMISSIONS.IOS.LOCATION_WHEN_IN_USE : PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION, ); let hasPermission = false; if (res == RESULTS.GRANTED) { hasPermission = true;
FlyBuy.Pickup.onPermissionChanged();
} else if (res === RESULTS.DENIED) {
const res2 = await request(
Platform.OS == 'ios'
? PERMISSIONS.IOS.LOCATION_WHEN_IN_USE
: PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
);
hasPermission = res2 === RESULTS.GRANTED;
}
Before calling the above function in home screen flybuy is initialized using below snippet in app.tsx. So app.tsx loads 1st then home screen will load
useAsyncEffect(async () => {
const iosToken = await RemoteConfig.getRemoteValue('flybuy_token_ios')
const androidToken = await RemoteConfig.getRemoteValue('flybuy_token_android')
await notifee.createChannel({
id: 'default',
name: 'TSC Notifications',
lights: false,
vibration: true,
importance: AndroidImportance.DEFAULT,
});
if (Platform.OS === 'ios') {
FlyBuy.Core.configure(iosToken);
} else {
FlyBuy.Core.configure(androidToken);
}
FlyBuy.Pickup.configure();
}, []);
@mohanenm @ArunkvG Sorry I can't reproduce the issue.
Can you create a sample repo to reproduce the issue?
I was not able to reproduce
Getting this error:
TypeError: _reactNativeBilditFlybuy.default.Pickup.onPermissionChanged is not a function. (In '_reactNativeBilditFlybuy.default.Pickup.onPermissionChanged()', '_reactNativeBilditFlybuy.default.Pickup.onPermissionChanged' is undefined)