diff --git a/example/ios-custom-view/.eslintignore b/example/ios-custom-view/.eslintignore new file mode 100644 index 0000000..d237219 --- /dev/null +++ b/example/ios-custom-view/.eslintignore @@ -0,0 +1,6 @@ +plugins +metro.config.js +babel.config.js +android +ios +webpack.config.js \ No newline at end of file diff --git a/example/ios-custom-view/.eslintrc.js b/example/ios-custom-view/.eslintrc.js new file mode 100644 index 0000000..5507422 --- /dev/null +++ b/example/ios-custom-view/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + root: true, + extends: ["universe/native"], + rules: { + "import/order": "off", + }, +}; diff --git a/example/ios-custom-view/.gitignore b/example/ios-custom-view/.gitignore new file mode 100644 index 0000000..bb39885 --- /dev/null +++ b/example/ios-custom-view/.gitignore @@ -0,0 +1,38 @@ +# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files + +# dependencies +node_modules/ + +# Expo +.expo/ +dist/ +web-build/ + +# Native +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* + +# macOS +.DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo + +/ios +/android \ No newline at end of file diff --git a/example/ios-custom-view/.prettierrc.json b/example/ios-custom-view/.prettierrc.json new file mode 100644 index 0000000..0d54ec0 --- /dev/null +++ b/example/ios-custom-view/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "trailingComma": "all", + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "printWidth": 80, + "arrowParens": "always" +} diff --git a/example/ios-custom-view/App.tsx b/example/ios-custom-view/App.tsx new file mode 100644 index 0000000..22a0acf --- /dev/null +++ b/example/ios-custom-view/App.tsx @@ -0,0 +1,98 @@ +import { Button, Image, StyleSheet, Text, View } from "react-native"; + +import { useShareIntent, ShareIntentFile } from "expo-share-intent"; +import { Fragment } from "react"; + +export default function App() { + const { hasShareIntent, shareIntent, resetShareIntent, error } = + useShareIntent({ + debug: true, + resetOnBackground: true, + }); + + return ( + + + + {hasShareIntent ? "SHARE INTENT FOUND !" : "NO SHARE INTENT DETECTED"} + + + {/* TEXT and URL */} + {!!shareIntent.text && {shareIntent.text}} + {!!shareIntent.meta?.title && ( + {JSON.stringify(shareIntent.meta)} + )} + + {/* FILES */} + {shareIntent?.files?.map((file) => ( + + {file.mimeType.startsWith("image/") && ( + + )} + + + ))} + + {/* FOOTER */} + {!!shareIntent && ( +