{"id":13777204,"url":"https://github.com/alinz/react-native-share-extension","last_synced_at":"2025-05-15T10:03:06.951Z","repository":{"id":9163654,"uuid":"61065768","full_name":"alinz/react-native-share-extension","owner":"alinz","description":"react-native as an engine to drive share extension","archived":false,"fork":false,"pushed_at":"2024-01-24T08:30:30.000Z","size":2827,"stargazers_count":778,"open_issues_count":102,"forks_count":401,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-06T08:07:00.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/alinz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-13T20:00:30.000Z","updated_at":"2025-04-21T00:15:27.000Z","dependencies_parsed_at":"2024-06-19T01:49:57.082Z","dependency_job_id":"bfa3df85-a8ad-4317-bf79-ae08767658eb","html_url":"https://github.com/alinz/react-native-share-extension","commit_stats":{"total_commits":71,"total_committers":17,"mean_commits":4.176470588235294,"dds":0.5211267605633803,"last_synced_commit":"6c9a37717fa944514b9395b16241ea546b98144c"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-share-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-share-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-share-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-share-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alinz","download_url":"https://codeload.github.com/alinz/react-native-share-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254133167,"owners_count":22020288,"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-08-03T18:00:39.341Z","updated_at":"2025-05-15T10:03:04.405Z","avatar_url":"https://github.com/alinz.png","language":"Java","funding_links":[],"categories":["\u003ca name=\"OS-\u0026-System-\u0026-File-Manager:-Native-Modules\"\u003eOS, System \u0026 File Manager: Native Modules\u003c/a\u003e","Java"],"sub_categories":[],"readme":"# React Native Share Extension\n\nThis is a helper module which brings react native as an engine to drive share extension for your app.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios-demo.gif\" /\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/android-demo.gif\" /\u003e\n\u003c/p\u003e\n\n# Installation\n\nInstallation should be very easy by just installing it from npm.\n\n```js\nnpm install react-native-share-extension --save\n```\n\n# Setup\n\nThe setup requires a little bit more work. I will try to describe as detail as possible. I would love to use `rnpm` so I will welcome pull request.\n\n## iOS\n\n- Click on your project's name\n- Click on `+` sign\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_01.png\" /\u003e\n\u003c/p\u003e\n\n- Select `Share Extension` under `iOS \u003e Application Extension`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_02.png\" /\u003e\n\u003c/p\u003e\n\n- Select a name for your new share extension, in my case I chose `MyShareEx`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_03.png\" /\u003e\n\u003c/p\u003e\n\n- Delete both `ShareViewController.h` and `ShareViewController.m`. make sure to click on the `Move to Trash` button during deletion.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_04.png\" /\u003e\n\u003c/p\u003e\n\n- Create a new file under your share extension group, in my case it was `MyShareEx`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_05.png\" /\u003e\n\u003c/p\u003e\n\n- Make sure that the type of that object is `Objective-C File`, e.g. for `MyShareEx` name it `MyShareEx.m`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_06.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_07.png\" /\u003e\n\u003c/p\u003e\n\n- Since we deleted `ShareViewController.m`, we need to tell the storyboard of your share extension where the view needs to be loaded. So click on `MainInterface.storyboard` and replace the class field from `ShareViewController` to whatever you chose above (in my case `MyShareEx`)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_08.png\" /\u003e\n\u003c/p\u003e\n\n- Now it's time to add our library. Right click on the `Libraries` group and select `Add Files to \"Sample1\"...`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_09.png\" /\u003e\n\u003c/p\u003e\n\n- select `node_modules` \u003e `react-native-share-extension` \u003e `ios` \u003e `ReactNativeShareExtension.xcodeproj`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_10.png\" /\u003e\n\u003c/p\u003e\n\n- Now we need to tell the share extension that we want to read new header files. Click on project name (in my case `Sample1`), then click on your extension name (in my case `MyShareEx`). After that click on Build Settings and search for `Header Search Paths`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_11.png\" /\u003e\n\u003c/p\u003e\n\n- Add the new path `$(SRCROOT)/../node_modules/react-native-share-extension/ios` with `recursive` selected\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_12.png\" /\u003e\n\u003c/p\u003e\n\n- We need to add some linker flags as well, so search for `Other Linker Flags` and add `-ObjC` and `-lc++`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_13.png\" /\u003e\n\u003c/p\u003e\n\n- We also need to add all the static libraries such as `React` and `React Native Share Extension`. Select the `General` tab and under `Linked frameworks and Libraries` click on `+` and add all of the selected static binaries there\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_14.png\" /\u003e\n\u003c/p\u003e\n\n- We need to modify the `Info.plist` inside the extension (e.g. `MyShareEx/Info.plist`) to make sure that our share extension can connect to internet. This is useful if you need your share extension connects to your API server or react-native remote server dev. For doing that we need to `App Transport Security Settings` to `Info.plist`\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_15.png\" /\u003e\n\u003c/p\u003e\n\n- Now go back to your extension file (in my case `MyShareEx.m`) and paste the following code there **being sure to substitute `MyShareEx` in all three places for whatever you chose above**\n\n\u003e If your project entry is `index.js` instead of `index.ios.js` then needs to replace `@\"index.ios\"` with `@\"index\"`\n\n```objective-c\n#import \u003cFoundation/Foundation.h\u003e\n#import \"ReactNativeShareExtension.h\"\n#import \u003cReact/RCTBundleURLProvider.h\u003e\n#import \u003cReact/RCTRootView.h\u003e\n#import \u003cReact/RCTLog.h\u003e\n\n@interface MyShareEx : ReactNativeShareExtension\n@end\n\n@implementation MyShareEx\n\nRCT_EXPORT_MODULE();\n\n- (UIView*) shareView {\n  NSURL *jsCodeLocation;\n\n  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@\"index.ios\" fallbackResource:nil];\n\n  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                      moduleName:@\"MyShareEx\"\n                                               initialProperties:nil\n                                                   launchOptions:nil];\n  rootView.backgroundColor = nil;\n\n  // Uncomment for console output in Xcode console for release mode on device:\n  // RCTSetLogThreshold(RCTLogLevelInfo - 1);\n\n  return rootView;\n}\n\n@end\n```\n\n# Set the NSExtensionActivationRule key in your Info.plist\n\nFor the time being, this package only handles sharing of urls specifically from browsers. In order to tell the system to show your extension only when sharing a url, you must set the `NSExtensionActivationRule` key (under `NSExtensionAttributes`) in the share extension's Info.plist file as follows (this is also needed to pass Apple's reveiw):\n\n```\n\u003ckey\u003eNSExtensionAttributes\u003c/key\u003e\n\u003cdict\u003e\n  \u003ckey\u003eNSExtensionActivationRule\u003c/key\u003e\n  \u003cdict\u003e\n    \u003ckey\u003eNSExtensionActivationSupportsWebURLWithMaxCount\u003c/key\u003e\n    \u003cinteger\u003e1\u003c/integer\u003e\n  \u003c/dict\u003e\n\u003c/dict\u003e\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/NSExtensionActivationRule.png\" /\u003e\n\u003c/p\u003e\n\nNote that while the above will prevent many apps from wrongly sharing using your extension, some apps (e.g., YouTube) will still allow sharing using your extension, which might cause your extension to crash. Check out [this issue](https://github.com/alinz/react-native-share-extension/issues/40) for details.\n\nFor reference about `NSExtensionActivationRule` checkout [Apple's docs](https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8)\n\n\n- Try to build the project, it should now build successfully!\n\n\n## Android\n\n- Edit `android/settings.gradle` and add the following\n\n```\ninclude ':app', ':react-native-share-extension'\n\nproject(':react-native-share-extension').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share-extension/android')\n```\n\n- Edit `android/app/build.gradle` and add the following line before the react section in dependencies\n\n```\ndependencies {\n    ...\n    compile project(':react-native-share-extension')\n    compile \"com.facebook.react:react-native:+\"\n}\n```\n\n- Create a folder called `share` under your java project and create two files. Call them `ShareActivity.java` and `ShareApplication.java`....just like your main project.\n\n- ShareActivity should look like this\n\n```java\n// define your share project, if your main project is com.sample1, then com.sample1.share makes sense....\npackage com.sample1.share;\n\n\n// import ReactActivity\nimport com.facebook.react.ReactActivity;\n\n\npublic class ShareActivity extends ReactActivity {\n    @Override\n    protected String getMainComponentName() {\n      // this is the name AppRegistry will use to launch the Share View\n        return \"MyShareEx\";\n    }\n\n}\n```\n\n- ShareApplication should now look like this\n\n```java\n// your package you defined in ShareActivity\npackage com.sample1.share;\n// import build config\nimport com.sample1.BuildConfig;\n\nimport com.alinz.parkerdan.shareextension.SharePackage;\n\nimport android.app.Application;\n\nimport com.facebook.react.shell.MainReactPackage;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.ReactApplication;\nimport com.facebook.react.ReactPackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n\npublic class ShareApplication extends Application implements ReactApplication {\n private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n   @Override\n   public boolean getUseDeveloperSupport() {\n     return BuildConfig.DEBUG;\n\n   }\n\n   @Override\n   protected List\u003cReactPackage\u003e getPackages() {\n     return Arrays.\u003cReactPackage\u003easList(\n         new MainReactPackage(),\n         new SharePackage()\n     );\n   }\n };\n\n @Override\n public ReactNativeHost getReactNativeHost() {\n     return mReactNativeHost;\n }\n}\n```\n\n- MainApplication should now look like this\n\n```java\n// your package you defined in ShareActivity\npackage com.sample1;\n\nimport android.app.Application;\nimport android.util.Log;\n\nimport com.facebook.react.ReactApplication;\nimport com.facebook.react.ReactInstanceManager;\nimport com.facebook.react.ReactNativeHost;\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.shell.MainReactPackage;\n\nimport com.alinz.parkerdan.shareextension.SharePackage;\n\nimport java.util.Arrays;\nimport java.util.List;\n\npublic class MainApplication extends Application implements ReactApplication {\n\n  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n    @Override\n    protected boolean getUseDeveloperSupport() {\n      return BuildConfig.DEBUG;\n    }\n\n    @Override\n    protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.\u003cReactPackage\u003easList(\n          new MainReactPackage(),\n          new SharePackage()\n      );\n    }\n  };\n\n  @Override\n  public ReactNativeHost getReactNativeHost() {\n      return mReactNativeHost;\n  }\n}\n```\n\n- Edit `android/app/src/main/AndroidMainfest.xml` and add the new `activity` right after `devSettingActivity`.\n\n```xml\n\u003cactivity android:name=\"com.facebook.react.devsupport.DevSettingsActivity\"/\u003e\n\n\u003cactivity\n    android:noHistory=\"true\"\n    android:name=\".share.ShareActivity\"\n    android:configChanges=\"orientation\"\n    android:label=\"@string/title_activity_share\"\n    android:screenOrientation=\"portrait\"\n    android:theme=\"@style/Theme.Share.Transparent\" \u003e\n   \u003cintent-filter\u003e\n     \u003caction android:name=\"android.intent.action.SEND\" /\u003e\n     \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n    //  for sharing links include\n     \u003cdata android:mimeType=\"text/plain\" /\u003e\n    //  for sharing photos include\n    \u003cdata android:mimeType=\"image/*\" /\u003e\n   \u003c/intent-filter\u003e\n\u003c/activity\u003e\n```\n\nin this new `activity` I have used 2 variables `@string/title_activity_share` and `@style/Theme.Share.Transparent`, you can add those in `res/values`.\n\nSo in `values/strings.xml`\n\n```xml\n\u003cresources\u003e\n    ...\n    \u003cstring name=\"title_activity_share\"\u003eMyShareEx\u003c/string\u003e\n\u003c/resources\u003e\n```\n\nand in `values/styles.xml`\n\n```xml\n\u003cresources\u003e\n    ...\n    \u003cstyle name=\"Share.Window\" parent=\"android:Theme\"\u003e\n        \u003citem name=\"android:windowEnterAnimation\"\u003e@null\u003c/item\u003e\n        \u003citem name=\"android:windowExitAnimation\"\u003e@null\u003c/item\u003e\n    \u003c/style\u003e\n\n    \u003cstyle name=\"Theme.Share.Transparent\" parent=\"android:Theme\"\u003e\n        \u003citem name=\"android:windowIsTranslucent\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowBackground\"\u003e@android:color/transparent\u003c/item\u003e\n        \u003citem name=\"android:windowContentOverlay\"\u003e@null\u003c/item\u003e\n        \u003citem name=\"android:windowNoTitle\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowIsFloating\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:backgroundDimEnabled\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowAnimationStyle\"\u003e@style/Share.Window\u003c/item\u003e\n    \u003c/style\u003e\n\u003c/resources\u003e\n```\n\n- Now you should be able to compile the code without any errors!\n\n\u003e If you need to add more packages to your share extension, do not override\n`getPackages`, instead override the `getMorePackages` method under `ShareExActivity`.\n\n# Share Component\n\nSo both share extension and main application are using the same code base, or same main.jsbundle file. So the trick to separate Share and Main App is registering 2 different Component entries with `AppRegistry.registerComponent`.\n\nIn both the iOS and Android share extensions we are telling react to load the extension component (in my case `MyShareEx`) from js.\n\nSo in `index.ios.js` and `index.android.js` we are writing the same code:\n\n```js\n//index.android.js\nimport React from 'react'\nimport { AppRegistry } from 'react-native'\n\nimport App from './app.android'\nimport Share from './share.android'\n\nAppRegistry.registerComponent('Sample1', () =\u003e App)\nAppRegistry.registerComponent('MyShareEx', () =\u003e Share) // TODO: Replace MyShareEx with my extension name\n```\n\n```js\n//index.ios.js\nimport React from 'react'\nimport { AppRegistry } from 'react-native'\n\nimport App from './app.ios'\nimport Share from './share.ios'\n\nAppRegistry.registerComponent('Sample1', () =\u003e App)\nAppRegistry.registerComponent('MyShareEx', () =\u003e Share) // TODO: Replace MyShareEx with my extension name\n```\n\nSo the `app.ios` and `app.android.js` refers to main app and `share.ios.js` and `share.android.js` refers to share extension.\n\n# Share Extension APIs\n\n- `data()` is a function that returns a promise. Once the promise is resolved, you get two values, `type` and `value`.\n\n\n```js\nimport ShareExtension from 'react-native-share-extension'\n...\n\nconst { type, value } = await ShareExtension.data()\n```\n\n- `close()`\n\nSimply closes the share extension and returns the touch event back to application that triggered the share.\n\n# On iOS: Re-harvesting a shared image\n\nIf your share extension is being used to process shared images (be it to social media or processing the image for information), `react-native-share-extension` will provide a URL within `value` with the location of the image.\n\nIf you wish to pass this URL back down to Swift or Objective-C for whatever reason, you can use the following to convert the URL back into a UIImage:\n\n```swift\nfunc harvestImage(from imageURL: String) {\n    if let imgData = FileManager.default.contents(atPath: imageURL) {\n        if let img = UIImage(data: data){\n        \t// Process image..\n        }\n    }\n}\n```\n\nor in Objective-C:\n\n```smalltalk\n-(void)harvestImage:(NSString *)imageURL {\n\tNSFileManager *fileManager = [NSFileManager defaultManager];\n\tNSData *imgData = [fileManager contentsAtPath:imageURL];\n\tUIImage img = [UIImage imageWithData:imgData];\n\t// Process Image..\n}\n```\n\n\n# Test on Device without dev-server\n\nBecause a share extension in ios is treated as a separate container, they do not have access to main app folder. A resolution for this is that you have to build the script twice and package it inside the share extension container. The easiest way of doing this is create a `New Script Phase` in `Build Phases` of your share extension and copy the following line\n\n```bash\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_16.png\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/alinz/react-native-share-extension/master/assets/ios_step_17.png\" /\u003e\n\u003c/p\u003e\n\n\n# App and app extension bundles\n\nThe app and app extension bundles can be shared or separated. Separating bundles allows for a minimal footprint for both app and app extension.\n\n#### plist key legend\n\n`BundleEntryFilename` - react-native index or shared index filename.\n\n`BundleSkipped` - Skips bundling when true.\n\n`BundleCopied` - Copies bundle instead of building when true. (Note: Should be set as true for share extension plist only when bundles are shared.)\n\n`BundleForced` - Forces bundling when true.\n\n### Shared bundles\n\nThe app extension target builds pre-loaded bundle and is copied to the app target.\n\n#### app plist values\n\n`BundleEntryFilename` = 'index.js'\n\n`BundleSkipped` = true\n\n`BundleCopied` = true\n\n#### app target's \"Bundle React Native code and images\" phase\n```\nexport NODE_BINARY=node\n../bin/react-native-xcode.sh\n```\n\n#### appShareExtension plist values\n\n`BundleEntryFilename` = 'index.js'\n\n`BundleForced` = true\n\n#### appShareExtension target's \"Bundle React Native code and images\" phase\n```\ncd ../\nnpm run cp-native-assets\ncd ios/\nexport NODE_BINARY=node\n../bin/react-native-xcode.sh\n```\n\n### Separated bundles\n\nThe app extension and app targets build their own unique bundles.\n\nNSNotificationCenter will kill app extensions that are unable to free memory resources when receiving low memory warnings. Also, shared bundles introduce library/pod dependencies that aren't needed by both apps. Configuring separate bundles via Xcode requires customizing react-native-xcode.sh; a quick example customization can be found in the bin directory. Update the path to the packager in both the app and app extension target's \"Bundle React Native code and images\" Build Phases.\n\nBuild time can be halved while debugging by disabling the bundle for whichever target you aren't debugging (app or app ex).\n\n#### app plist values\n\n`BundleEntryFilename` = 'index.js'\n\n#### app target's \"Bundle React Native code and images\" phase\n```\nexport NODE_BINARY=node\n#export ENTRY_FILENAME=index\n../bin/react-native-xcode.sh\n```\n\n#### appShareExtension plist values\n\n`BundleEntryFilename` = 'share.index.js'\n\n`BundleForced` = true\n\n#### appShareExtension target's \"Bundle React Native code and images\" phase\n```\ncd ../\nnpm run cp-native-assets\ncd ios/\nexport NODE_BINARY=node\n../bin/react-native-xcode.sh\n```\n\n# Open container app\nSteps needed to open the host application from the share extension.\n1) Allow your app to be opened via URL Scheme - [Learn more](https://medium.com/react-native-training/deep-linking-your-react-native-app-d87c39a1ad5e)\n2) In xcode, select share extension and go to Build Settings and set **Require Only App-Extension-Safe API** to `NO`.\n\nThen you can open your app from the share extension by calling openURL:\n\n```\nimport ShareExtension from 'react-native-share-extension';\n\nShareExtension.openURL('sample://example/url');\n```\n\n# Troubleshooting on iOS devices\n\nUsing the iOS Simulator and remote react-native debugger to develop the extension can hide issues that won't occur until testing on device. If you're experiencing issues running the extension on iOS devices, examine the Xcode console or device log for any obvious errors. If the Xcode console isn't receiving console output, ensure that the OS_ACTIVITY_MODE=disable environment var isn't enabled for the active scheme (see https://github.com/facebook/react-native/issues/10027). OS_ACTIVITY_MODE will hide device logging in the Xcode console, so its use is only advisable for iOS Simulator. For release mode, in order to view console output and see all output in the syslog, uncomment the `RCTSetLogThreshold(RCTLogLevelInfo - 1);` statement in your MyShareEx class.\n\n1. If you're using react-native latest, error boundaries might help with JS errors. Another option is to catch render exceptions or test for errors, then render that output with something like a Text component. As long as your share app initializes, you should be able to see yellowbox/redbox errors. If you're not seeing them, you likely have an initialization issue.\n2. Disable bundling on the main target when debugging the extension target, it's not needed when you're not working with the main app.\n3. [Enable breaking on exceptions](http://blog.manbolo.com/2012/01/23/xcode-tips-1-break-on-exceptions). This is helpful if there are any exceptions in the extension itself; perhaps most useful if you've customized the native module.\n\n# Final note\n\nI have used `react-native-modalbox` module to handle the showing and hiding share extension which makes the experience more enjoyable for the user.\n\nCheers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinz%2Freact-native-share-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falinz%2Freact-native-share-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinz%2Freact-native-share-extension/lists"}