humaidk2 / react-native-share-from-outside

A module for React Native that adds your app to the share menu of the device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-share-menu

MMKV

  • Input
    • sendUrl, this is a url where the uploaded file/s or text and the select contact will be sent
    • contacts, each contact will compose of avatarURL, name, and id
    • UploadURL , this is where the files will be uploaded
  • Output
    • Selected contact/s id

Keychain

Keychain will be used to share tokens from app to share extension

Uploader

This will take the image/s or video/s or file/s and upload it to generate a storedURL. Uploading should happen in background service. An ios library could help with this

Share Intent/suggestion - onSend

A native module that gives access to js method onSend which should be called to store the contact info to be displayed in suggestions.

Tasks:

  • Setup react native project with redux

iOS

Example Project:

  • Setup ios Share extension
  • Setup ios groups
  • Setup react native project with redux
  • Setup to read data from mmkv
  • Setup to read encrypted data from mmkv
  • [] Setup to uploader to upload any file type and get back url
  • [] Setup a different mmkv store that will not use redux-persist
  • [] Setup Keychain to share tokens
  • [] Add instructions to use keychain
  • [] Setup native module methods for suggestions
  • [] Store data back in to mmkv store

Other

  • [] Extract files to npm module
  • [] Update instructions
  • [] Test with whatsapp/telegram

Reasoning

I used react native share menu for my own project, and i found it lacking and hard to integrate.

The biggest problem was the lack of support for sharing from whatsapp/telegram.

Sharing multiple items.

Sharing some data between the share extension and the main app

Sharing some secrets between the share extension and the main app

New share intent suggestions.

Share extension on ios needs at least needs to be handled natively because it has a 120MB limit and running js using react native takes about 50MB, leaving about half to work with.

I think share extension should be responsible to store the data using something like mmkv or optionally upload it to the cloud and if you need access to it, you have to load the data in on startup or synchronize the data in a service.

This should be the default behaviour on ios and android

I also think the uploading part can be integrated to the share extension.

Only after completing the above features, will this project be released on npm

If you would like to help build the above, please contact me

Add your app as a target for sharing from other apps and write iOS Share Extensions in React Native.

Installation

npm i --save react-native-share-menu

Automatic Linking (React Native 0.60+)

At the command line, in the ios directory:

pod install

Android Instructions

iOS Instructions

Custom iOS Share View (optional)

API Docs

Example Project

Sponsored and developed by Meedan.

iOS version maintained by Gustavo Parreira.

About

A module for React Native that adds your app to the share menu of the device

License:MIT License


Languages

Language:Swift 35.8%Language:Java 31.4%Language:JavaScript 10.6%Language:C++ 8.0%Language:Objective-C 4.8%Language:Objective-C++ 4.2%Language:Ruby 2.8%Language:Makefile 1.7%Language:Starlark 0.7%