{"id":29806868,"url":"https://github.com/encoresky/react-mobile-share","last_synced_at":"2025-07-28T14:13:59.011Z","repository":{"id":57750521,"uuid":"525333209","full_name":"encoresky/react-mobile-share","owner":"encoresky","description":"Easy and simple way to share data via mobile’s built-in share module.","archived":false,"fork":false,"pushed_at":"2024-09-27T07:11:42.000Z","size":728,"stargazers_count":50,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-16T22:51:58.544Z","etag":null,"topics":["react","react-android-ios-share","react-android-share","react-ios-share","react-mobile-share","react-share","react-share-mobile","react-web-share","reactjs","reactjs-mobile-share","web-share","web-share-api"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-mobile-share","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/encoresky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-16T10:34:12.000Z","updated_at":"2025-04-05T20:10:49.000Z","dependencies_parsed_at":"2023-01-30T03:05:12.990Z","dependency_job_id":null,"html_url":"https://github.com/encoresky/react-mobile-share","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/encoresky/react-mobile-share","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encoresky%2Freact-mobile-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encoresky%2Freact-mobile-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encoresky%2Freact-mobile-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encoresky%2Freact-mobile-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/encoresky","download_url":"https://codeload.github.com/encoresky/react-mobile-share/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/encoresky%2Freact-mobile-share/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266347053,"owners_count":23915219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-android-ios-share","react-android-share","react-ios-share","react-mobile-share","react-share","react-share-mobile","react-web-share","reactjs","reactjs-mobile-share","web-share","web-share-api"],"created_at":"2025-07-28T14:13:49.581Z","updated_at":"2025-07-28T14:13:58.994Z","avatar_url":"https://github.com/encoresky.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Mobile-Share\n\nProvides an easy and simple way to share data (such as text, url and media) via mobile’s built-in share module.\nIt is based on [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share).\n\nThis works only with secure contexts (HTTPS).\n\n## 💡 Features\n\n- Lightweight\n- Share text, url and images\n- Works on Android and iOS\n\n## 🔧 Installation\n\n```bash\nnpm i react-mobile-share    # npm\nyarn add react-mobile-share # yarn\n```\n\n## 🖥️ Demo\n\n[![Try with CodeSandbox](https://img.shields.io/badge/Edit%20with%20CodeSandBox-000000?style=for-the-badge\u0026logo=codesandbox\u0026logoColor=white)](https://codesandbox.io/s/react-mobile-share-example-r11kjs?file=/src/App.js)\n\n## 📱 Preview\n\n![Android](https://raw.githubusercontent.com/encoresky/react-mobile-share/main/sample-android-share.png)\u0026nbsp;\u0026nbsp;\u0026nbsp;\n![iOS](https://raw.githubusercontent.com/encoresky/react-mobile-share/main/sample-ios-share.png)\n\n## 📦 Usage\n\n```tsx\nimport { shareOnMobile } from \"react-mobile-share\";\n\nconst imgBase64 = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2...\";\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cbutton\n        onClick={() =\u003e\n          shareOnMobile({\n            text: \"Hey checkout our package react-mobile-share\",\n            url: \"https://www.npmjs.com/package/react-mobile-share\",\n            title: \"React-Mobile-Share\",\n            images: [imgBase64],\n          })\n        }\n      \u003e\n        Share\n      \u003c/button\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default App;\n```\n\n## 👀 API References\n\n#### Functions\n\n```\n  shareOnMobile(data, fallbackFn)\n```\n\nTakes the following parameters:\n\n| Parameter    | Type       | Description                   |\n| :----------- | :--------- | :---------------------------- |\n| `data`       | `object`   | **Required**                  |\n| `fallbackFn` | `function` | **Options**: return a message |\n\n#### Data Object (1st Parameter)\n\n```\n{\n    text: \"Hey checkout our package react-mobile-share\",\n    url: \"https://www.npmjs.com/package/react-mobile-share\",\n    title: \"React-Mobile-Share\",\n    images: [imgBase64],\n}\n```\n\nObject must contain the following fields:\n| Field | Type | Description |\n| :-------- | :------- | :-------------------------------- |\n| `title` | `string` | **Required**. Must have a title.|\n| `text` | `string` | **Optional**. Add a description. |\n| `url` | `string` | **Optional**. Any valid url. |\n| `images` | `array` | **Optional**. Should be a valid array of base64 strings. |\n\n#### Fallback Function (2nd Parameter)\n\n```\nfunction(message) {\n    console.log(\"fallback\", message)\n}\n```\n\nThis will invoked when any failure occurs.\n\n## 📜 License\n\n[MIT](https://github.com/encoresky/react-mobile-share/blob/main/LICENSE)\n\n\n\n## 🤝🏼 Contributions\n\nWe welcome pull requests! Explore open issues to find opportunities to contribute or open a new issue to share your ideas or report bugs—your help improves this library\n\n[Contribution Guidelines](https://github.com/encoresky/react-mobile-share/blob/main/CONTRIBUTION.md)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencoresky%2Freact-mobile-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fencoresky%2Freact-mobile-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fencoresky%2Freact-mobile-share/lists"}