alinz / react-native-share-extension

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

updated code is not there in npm #127

Open theone3nu opened 5 years ago

theone3nu commented 5 years ago

I just saw in lib/index.js ``` import { NativeModules } from 'react-native'

// import ShareExtension from 'react-native-share-extension' // const { type, value } = await NativeModules.ShareExtension.data() // NativeModules.ShareExtension.close() export default { data: () => NativeModules.ReactNativeShareExtension.data(), close: () => NativeModules.ReactNativeShareExtension.close() }



but in the git repo the latest code is
`import { NativeModules } from 'react-native'

// import ShareExtension from 'react-native-share-extension'
// const { type, value } = await NativeModules.ShareExtension.data()
// NativeModules.ShareExtension.close()
export default {
  data: () => NativeModules.ReactNativeShareExtension.data(),
  close: () => NativeModules.ReactNativeShareExtension.close(),
  openURL: (url) => NativeModules.ReactNativeShareExtension.openURL(url),
}`

Thats the reason openURL is not working. Can admin push the latest code into repo?
theone3nu commented 5 years ago

Since the latest code is not there in the npm repository i manually downloaded from github and used that ReactNativeShareExtension xcode as a library and imported the ShareExtension from the local copy. After a week time spent Now everything is working fine without any issues in the simulator. However when i run it in the real device app hangs. I am trying to share photo from photo gallery app to my app as soon as i click on mysharex app nothing is happening.

dfabarbosa commented 5 years ago

I have the exact same problem

theone3nu commented 5 years ago

@dfabarbosa I fixed it by adding the scripts in the extension build phase. Now i don't have any more issues. Great Repo! Very big thanks to the developer.

dfabarbosa commented 5 years ago

@theone3nu I'm not being able to make it work. Did you choose shared or separated bundle? I chose shared and the appShareExtension target's "Bundle React Native code and images" phase doesn't appear, did you have any problem like this?

theone3nu commented 5 years ago

Check the screenshot

screen shot 2018-11-23 at 7 24 25 pm
dfabarbosa commented 5 years ago

Well it's working and I did nothing... The problem was that the extension takes a lot of time to appear on the device on debug mode. Thanks for your help @theone3nu !!!

theone3nu commented 5 years ago

NP @dfabarbosa

radreamer commented 5 years ago

hey, what about "react-native-share-extension": "github:alinz/react-native-share-extension" in dependencies in package.json?

isaachinman commented 5 years ago

@AndrewHenderson I propose releasing v1.3.0 immediately with everything that is currently on master since the last release on Aug 2, 2017, so that we can deploy these changes to npm. We can bump future changes to v1.4.0 or otherwise.

Please let me know ASAP if you agree.

AndrewHenderson commented 5 years ago

@isaachinman I experienced issues using master, last week. I was unable to successfully complete network requests from the Share Extension — particularly uploading images. Switching back to NPM version resolved the issue immediately. It seems there is a bug that was introduced since the 1.2.1 release.

isaachinman commented 5 years ago

@AndrewHenderson Ouch... there are 19 commits in that release. Anyone feel like doing a git blame?

AndrewHenderson commented 5 years ago

@isaachinman It was only on iOS, so that should help narrow it down.

AndrewHenderson commented 5 years ago

@isaachinman This looks like it could be the cause: https://github.com/alinz/react-native-share-extension/commit/1e98f58991a892fd941a809f9564fb5181693ba0#diff-cd365a662ae840f4beb6a01a1c8ffa1f

isaachinman commented 5 years ago

@AndrewHenderson Does reverting just that file fix the bug?

dgritsko commented 5 years ago

Any update on this? Would really like to be able to use the openURL method.

AndrewHenderson commented 5 years ago

@isaachinman Please review: https://github.com/alinz/react-native-share-extension/pull/132/files.

Reverting changes in https://github.com/alinz/react-native-share-extension/commit/1e98f58991a892fd941a809f9564fb5181693ba0 seems to have fixed issues.

Perhaps we can get things openURL in NPM after this.

isaachinman commented 5 years ago

@AndrewHenderson Looks good, glad to hear that the bug was indeed (hopefully) isolated to 1e98f58. Let's focus on putting together a stable release, and then getting out the "stable" features (like openURL) which have been sitting in PRs for a long time.

AndrewHenderson commented 5 years ago

@isaachinman Agreed.

I just merged https://github.com/alinz/react-native-share-extension/pull/132. We should now have a stable version of the app.

I'll start outlining a roadmap for the next version. You and I have collaborator permissions on the repo, but do not have NPM permissions to release new versions. We'll need to either have @alinz grant us access or review our release candidate once we've finalized our changes.

isaachinman commented 5 years ago

@AndrewHenderson I believe I do already have npm permissions - I spoke to @alinz via email. We should get you on there as well, for sure.

jvandenaardweg commented 5 years ago

Any update on this? :-)

isaachinman commented 5 years ago

@jvandenaardweg As far as I know, we don't have an rc yet. v1.2.1 is on npm.

jvandenaardweg commented 5 years ago

Thanks for the update. I've then decided to use the last commit in master npm install https://github.com/alinz/react-native-share-extension.git\#3db5320135c154c367d72c44688a29ce41b210e7 --save

Seems to be working fine in my app 👍 Needed the openUrl method, that's not available in 1.2.1

I would advice people to not use #master when using a github repo as an npm package as stated above in the comments, as the master branch may include breaking changes in the future, breaking your app on a new install. A commit is more strict.

isaachinman commented 5 years ago

I am happy to just release the latest master as v2.0.0 (I assume there are breaking changes). What do you think @AndrewHenderson?

chiaberry commented 5 years ago

@jvandenaardweg Does the openUrl method work in your app on Android?

also thanks for the advice on installing from commit vs master

jvandenaardweg commented 5 years ago

@chiaberry haven't had the time to build and test the Android side, currently only working on an iOS app. Sorry!

ajith-ab commented 4 years ago

I Make react-native-file-share-intent it's Work perfectly on both platforms. It supports all media to share our App