Whenever I am opening the app for the first time from Testflight, the app crashes with the following error.
TypeError: subscription.listener.apply is not a function. (In 'subscription.listener.apply(subscription.context, args)', 'subscription.listener.apply' is undefined)
This is not happening in debug mode, and happens only during the first install from TestFlight, after the first crash it works fine.
Ok, my issue was that I was not using Linking of react-native package correctly.
Linking.addEventListener('url', this.handleOpenURL);
const handleOpenURL = async () => {
...
}
In my above code, the handleOpenURL is an async function which was causing the issue. Removing the async resolved the issue.
const handleOpenURL = () => {
...
}
I still have to figure out why this issue was not crashing my Android app, and also this issue was fine in react-native 0.64, but started crashing in iOS when I updated react-native to latest 0.66.4.