deep link with onesignal and expo-router

57 Views Asked by At

I have a project with react-native-onesignal and expo plugin for it. using expo-router, and I need to manipulate the launchUrl before it fire up.

what i mean by that:

launchUrl: myapp://mywebsite.com/item/222afasfhasf

so my old app using native kotlin and webview handle this launchUrl good. my new app using expo and expo-router cant handle this launchUrl because of the mywebsite.com

so when i send notification from onesignal to my phone without the 'mywebsite.com' it works

but i can not change it on onesignal the launchUrl to be without it, cause when i will upload this new app to the store, some users notification wont works cause they probably wont update the app yet, and the old app doesnt support without the 'mywebsite.com'

so how can I change the deeplink before it fires up, or any other way that will make it work without the url.

i tried to:

Linking.getInitialURL()

and then router.replace after changing the url to be correct, but the deep-link already happened so it give error first before it redirect me.

thanks.

0

There are 0 best solutions below