Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

React-Native 0.29 breaking changes #35

Open
dotnetprofessional opened this issue Jul 14, 2016 · 22 comments
Open

React-Native 0.29 breaking changes #35

dotnetprofessional opened this issue Jul 14, 2016 · 22 comments

Comments

@dotnetprofessional
Copy link

dotnetprofessional commented Jul 14, 2016

Plugins which pass activity reference in the constructor need to be updated to extend ReactContextBaseJavaModule use getCurrentActivity to get the activity reference. This change is backward compatible.
https://github.com/facebook/react-native/releases/tag/v0.29.0

Currently this is preventing the use of the code with the latest bits.

@axemclion
Copy link
Owner

@dotnetprofessional Thanks for reporting this. I will look at updating this plugin for that usecase.

@dotnetprofessional
Copy link
Author

Great! Not to put any pressure on you ;) But do you have any idea when you might get the chance to update it?

@axemclion
Copy link
Owner

@dotnetprofessional It will probably be a while. I am currently working on web workers for ReactNative, that I am speaking about at conferences. I need to get those done before I work on this.

Would appreciate pull request if you have the time.

@axemclion
Copy link
Owner

@dotnetprofessional I finally got a chance to look into this and looks like that is not the only breaking change. The bigger change is the introduction of MainApplication - this is where the native modules are initialized.

This is a problem since we would not really have an Activity when the native module is initialized. Cordova's interfaces require an activity, and are always based on that. Thus, we would need to find a way to access that package in the MainActivity, initialize it when that activity is created and then run the plugin, when the exec method is called.

This looks like a total re-write of the plugin, given that so many pieces have moved around.

@avishayhajbi
Copy link

+1

@vthunder
Copy link

In case this helps anyone–

It's possible to use an older version of react-native by using the 'rninit' command:

npm install -g rninit
rninit App --source [email protected]

Then you'll be able to use react-native-cordova-plugin as-is. You'll be stuck at that version of react-native until this issue is resolved, of course, with whatever quirks and bugs that entails.

Btw, downgrading react-native and running react-native upgrade (which prompts you to downgrade files in the android/ and ios/ dirs) did not work for me. I managed to get it to build, but the app would crash on startup—there's some additional state being bundled in from somewhere that I couldn't track down. YMMV.

@sudharsan1988
Copy link

+1

@mtwallet
Copy link

@axemclion Have you had chance to look at a fix for this issue? Many thanks.

@e-onux
Copy link

e-onux commented Jan 1, 2017

@axemclion Have you had a chance to look?

@nda2221
Copy link

nda2221 commented Jan 14, 2017

@axemclion Any update, friend?

@nicosefer
Copy link

any news?

@axemclion
Copy link
Owner

@nicsefer I have not had the time to work on this, but would accept pull requests.

mribbons added a commit to mribbons/react-native-cordova-plugin that referenced this issue Jul 10, 2017
add CordovaPluginPackage.set_MainActivity to handle RN architecture change as per
axemclion#35

Update README.md to show how to use changes.
@theBliz
Copy link

theBliz commented Jul 20, 2017

@axemclion @mribbons it seems that the pull request has some issues. The readme it's missing the MainApplication.java example and the CordovaPluginPackage.java is missing "set_MainActivity".
I don't know if something else is missing, I'll update this in case I find out more :) and thanks for the great work! :D

@mribbons
Copy link
Contributor

@theBliz I haven't submitted a PR yet because the work is incomplete.

The changes are only in my repo:
https://github.com/mribbons/react-native-cordova-plugin

@theBliz
Copy link

theBliz commented Jul 20, 2017

@mribbons got it :) so there are issues just in the ReadMe (broken links for the example)

@XBLDev
Copy link

XBLDev commented Aug 23, 2017

Hi any news about the update? I've tried hacking my way to get it to work with the latest RN but no luck, it seems I have to wait until the branches merge :-)

@mribbons
Copy link
Contributor

@XBLDev you might be better off contributing your efforts to converting whichever libs you need to RN, this one doesn't seem to be moving.

@axemclion
Copy link
Owner

I am glad to take contributions to this library - send in a pull request, or even better, please help by becoming a contributor.

@XBLDev
Copy link

XBLDev commented Aug 24, 2017

Hi @axemclion How exactly do I send in a pull request? I've never done it before :-(

@mribbons
Copy link
Contributor

HI @axemclion, care to have a look at my repo? I don't have the necessary knowledge to get it working.

#42

@mribbons
Copy link
Contributor

@XBLDev after cloning the repo and committing changes, use the New Pull Request button. There should be plenty of information online and on github itself.

@XBLDev
Copy link

XBLDev commented Aug 24, 2017

Hi @mribbons I don't think I'm knowledgeable enough to make it working with the current RN either, I mean you seem to be pro at this and you can't even make it work, and i'm just a RN app developer, and unfortunately not a very good one :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests