Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update android plugin instructions #254

Merged

Conversation

teaqu
Copy link
Contributor

@teaqu teaqu commented Jan 27, 2023

Hello,

For android, this.init() has been depreciated for a while and is not even usable in the latest capacitor.
I've updated the readme with the new way to add plug-ins.

To use new and current bridgeBuilder.addPlugin() method over depreciated and removed init().
@reslear
Copy link
Collaborator

reslear commented Jan 27, 2023

@teaqu thx for PR :)
could still, everything else d in the documentation check and correct ?
since i am not a java developer

@teaqu
Copy link
Contributor Author

teaqu commented Jan 27, 2023

Hey reslear I unfortunately also have limited Java / android experience however everything else seems OK. I have it running on an emulator and appears to work correctly following the instructions, this was the only change I had to make.

@teaqu
Copy link
Contributor Author

teaqu commented Jan 27, 2023

Updated pull request to use suggested method in https://github.com/ionic-team/capacitor/blob/3.x/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java (see doc for init()).

@reslear
Copy link
Collaborator

reslear commented Jan 27, 2023

@teaqu thx

@reslear reslear merged commit 476b1b8 into CodetrixStudio:master Jan 27, 2023
@mariusbolik
Copy link

Plugin Registration isn't needed anymore since capacitor 3. Lots of plugins removed java part from the docs. See here: https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading

So is the registration in MainActivity really required for this plugin?

@reslear
Copy link
Collaborator

reslear commented Feb 6, 2023

@mariusbolik could have checked ?

@mariusbolik
Copy link

@reslear Plugin is registered correctly along all other Plugins, without putting it in MainActivity.java. I just checked in Logcat:

Bildschirm­foto 2023-02-06 um 16 26 31

@reslear
Copy link
Collaborator

reslear commented Feb 6, 2023

@mariusbolik Okay, what's the plan?

@mariusbolik
Copy link

You cloud update the Documentation and remove the Part where the User should add the Code to MainActivity.java or you leave it as it is. Result is the same, but the end of the story is that no additional code needs to be added to MainActivity.java.

@reslear
Copy link
Collaborator

reslear commented Feb 6, 2023

@mariusbolik cool, could you open a PR ?

@teaqu
Copy link
Contributor Author

teaqu commented Feb 8, 2023

Yeah seems to work without for me too created a pull request.

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

Successfully merging this pull request may close these issues.

3 participants