alinz / react-native-share-extension

react-native as an engine to drive share extension
MIT License
762 stars 396 forks source link

IOS Share Extension not launch app. #160

Closed andersonqi closed 5 years ago

andersonqi commented 5 years ago

Hi there! share extension works if I replace my app with a very basic component. But if I use my full app with react navigation etc it does not work. When I try the screen stays frozen.

Is there a problem if I use react navigation? I feel that it blocks the flow

NishidaRyu416 commented 5 years ago

Don’t you have the same keys to registerComponent methods in order to register both your share extension and app components? If yes, it doesn’t work well because the component before is overridden by the one after that or simply causes a conflict.

A bad anticipated example:

//index.ios.js
import React from 'react'
import { AppRegistry } from 'react-native'

import App from './app.ios'
import Share from './share.ios'

AppRegistry.registerComponent('Sample1', () => App)
AppRegistry.registerComponent('Smaple1', () => Share) // TODO: Replace MyShareEx with my extension

A fine estimated example:

//index.ios.js
import React from 'react'
import { AppRegistry } from 'react-native'

import App from './app.ios'
import Share from './share.ios'

AppRegistry.registerComponent('Sample1', () => App)
AppRegistry.registerComponent('Share', () => Share) // TODO: Replace MyShareEx with my extension
andersonqi commented 5 years ago

Yes, that was my mistake

Thank you @NishidaRyu416

Shaktis3 commented 5 years ago

Hey i'm facing the same issue. Will you please help to resolve it. Thanks in advance.

andersonqi commented 5 years ago

@Shaktis3 my problem was that I had the wrong name in the register and the share. Verify that all names are correct.

Shaktis3 commented 5 years ago

Yes. In my case all the thing are correct. but still not able to open app or any screen when clicked on share extension. It freezes the app through which i'm sharing the content.

OmarBasem commented 4 years ago

@Shaktis3 did you find a fix?