expo-share-intent
expo-share-intent copied to clipboard
hasShareIntent is false
I tried to share url from reddit app and youtube app into my app but the hasShareIntent is false,
am using expo router and testing only for Android. I added shareintentprovider at the root as well as mentioned in the docs.
below is piece of code from my _layout.jsx
const { hasShareIntent, shareIntent } = useShareIntentContext();
const navigationState = useRootNavigationState();
// Effect to trigger navigation when t is true
useEffect(() => {
if (!navigationState?.key) return; // Ensure navigation state is available
alert(`Testing hasShareIntent: ${hasShareIntent}, ShareText: ${shareIntent.text}`);
if (hasShareIntent) {
// Perform navigation to the 'new' page with shared params
router.replace({
pathname: "new",
params: {
sharedUrl: shareIntent.text || "",
},
});
}
}, [hasShareIntent, navigationState?.key]);
- expo version: 51
- using firebase : no
- using static build : no
- routing : expo-router
- platform target : Android
- device : sreal device