{"id":22192539,"url":"https://github.com/3sidedcube/react-native-sharing","last_synced_at":"2025-03-24T20:45:45.272Z","repository":{"id":79436570,"uuid":"56671497","full_name":"3sidedcube/react-native-sharing","owner":"3sidedcube","description":"Cross-platform sharing functionality for React-Native.","archived":false,"fork":false,"pushed_at":"2016-05-31T14:39:49.000Z","size":110,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-01-30T01:22:35.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3sidedcube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-20T08:54:00.000Z","updated_at":"2016-05-25T13:43:29.000Z","dependencies_parsed_at":"2023-09-09T00:05:22.299Z","dependency_job_id":null,"html_url":"https://github.com/3sidedcube/react-native-sharing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2Freact-native-sharing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2Freact-native-sharing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2Freact-native-sharing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3sidedcube%2Freact-native-sharing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3sidedcube","download_url":"https://codeload.github.com/3sidedcube/react-native-sharing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245351757,"owners_count":20601090,"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","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":[],"created_at":"2024-12-02T12:25:57.768Z","updated_at":"2025-03-24T20:45:45.251Z","avatar_url":"https://github.com/3sidedcube.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-sharing\n\nCross-platform sharing functionality for React-Native.\n\nThis results in a **single interface for sharing** across the supported platforms:\n\n* Android, with sharing functionality provided via a native module.\n* iOS, with sharing functionality provided by [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html) (part of react-native).\n\n## Why?\n\n* There is **no official support** for **cross platform sharing**\n* There is **no official support** for **Android sharing**\n* iOS has official support in the form of [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html)\n* Other GitHub librares make you conform to different interfaces for different platforms, or reinvent functionality already given to you by [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html)\n\n## Ways to share\n\nIt provides two different ways to trigger sharing functionality:\n\n1. Calling the `share` function directly\n\n2. Wrapping the views you want to trigger sharing on touch with `\u003cShareLink\u003e`. This will automatically trigger the sharing functionality when any of it's child views are touched. \n\n## Parameters\n\nBoth ways of using this library have the same parameters:\n\n* **Subject (required)** - Shown above the sharing options and used in emails as the subject.\n\n* **Message (required)** - The message that will be shared.\n\n* **URL (optional)** - A link that will be added to the end of the message and used to help display more relevant sharing options.\n\n## Usage\n\n### Calling the share function directly\n\n1. Import the `share` function:\n\n\t```\n\timport { share } from 'react-native-sharing';\n\t```\n\n2. Then call the `share` function and pass in the parameters:\n\n\t```\n\tshare(subject, message, url)\n\t```\n\n### Wrapping views with ShareLink\n\n1. Import the `ShareLink` view component:\n\t\n\t```\n\timport { ShareLink } from 'react-native-sharing';\n\t```\n\n2. Wrap the views you want to trigger sharing in a `ShareLink` and add the parameters:\n\n\t```\n\t\u003cShareLink subject=\"Do you know 3SC?\" message=\"Check out 3SC\" url=\"https://3sidedcube.com/\"\u003e\n\t\t\u003cText\u003eTell your friends about 3 Sided Cube\u003c/Text\u003e\n\t\u003c/ShareLink\u003e\n\t```\n\n## Setup\n\n### Android\n\n1. Ensure your launch activity extends from `ReactActivity` like so:\n\n\t```\n\tpublic class MainActivity extends ReactActivity {\n\t```\n\n2. Import `SharerPackage` in your launch activity.\n\n\t```\n\timport com.reactnativesharing.SharerPackage;\n\t```\n\t\n3. Implement `getPackages()` in your launch activity so that `SharerPackage` is returned in your list of packages:\n\n\t```\n\t@Override\n\tprotected List\u003cReactPackage\u003e getPackages() {\n\t    return Arrays.\u003cReactPackage\u003easList(\n\t        new MainReactPackage(),\n\t        new SharerPackage()\n\t    );\n\t}\n\t```\n\n4. Include `react-native-sharing` in your `android/settings.gradle` file:\n\n\t```\n\tinclude ':react-native-sharing'\n\t```\n\t\n5. Reference the `react-native-sharing` project in your `android/settings.gradle` file:\n\n\t```\n\tproject(':react-native-sharing').projectDir = new File(rootProject.projectDir, '../\tnode_modules/react-native-sharing/android/app')\n\t```\n\t\n6. Tell gradle to compile `react-native-sharing` in `android/app/build.gradle`\n\n\t```\n\tcompile project(\":react-native-sharing\")\n\t```\n\n### iOS\n\n1. No setup needed, it just works (because we're using [ActionSheetIOS](https://facebook.github.io/react-native/docs/actionsheetios.html)).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Freact-native-sharing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3sidedcube%2Freact-native-sharing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3sidedcube%2Freact-native-sharing/lists"}