Can not see my app appears when trying to share a link

Goal: My goal is to open my app when the user tries to share a link. For example, I open Chrome on a given URL, then I click on the URL bar and then on the share button. I expect my app to appears here.
So, I want my app to be able to receive a share intent (SEND?), if I understand well :smiley:

I tried different configurations (app.json > expo > android > intentFilters). I also test both on a virtual device (Pixel 5 - Android 13) and on my physical device (Pixel 6 - Android 13) with the APK file.

I was not able in all cases to make the app appears.

Feal free to clone GitHub - bcolucci/mediabricks in order to reproduce. And if you have something working, you can open a PR, it would be much appreciated!

Thanks in advance for your help! I donโ€™t know what to do.

My current dependencies:

{
  "expo": "~48.0.10",
  "expo-linking": "^4.0.1",
  "expo-status-bar": "~1.4.4",
  "react": "18.2.0",
  "react-native": "0.71.6",
  "react-native-paper": "5.6.0",
  "react-native-safe-area-context": "4.5.0"
}

This is my current app.json (with only relevant fields):

{
  "expo": {
    [...]
    "android": {
      "package": "com.bricecol.MediaBricks",
     [...]
      "intentFilters": [
        {
          "action": "SEND",
          "category": [
            "DEFAULT"
          ],
          "mimeType": [
            "application/*",
            "message/*",
            "multipart/*",
            "text/*"
          ]
        }
      ]
    }
    [...]
  }
}

My code is simply (App.js):

import { useEffect } from "react";
import { Text, View } from "react-native";
import { Provider as PaperProvider } from "react-native-paper";
import * as Linking from "expo-linking";

export default function App() {
  const url = Linking.useURL();
  useEffect(() => {
    console.log("url", url);
  }, [url]);
  return (
    <PaperProvider>
      <View>
        <Text>It works! {new Date().toLocaleDateString()}</Text>
      </View>
    </PaperProvider>
  );
}

Thanks again for your help!

Please, Iโ€™m desesperate :sob:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.