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

MOBILE-4331: Implement native plugin #3729

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

NoelDeMartin
Copy link
Contributor

This PR only implements the plugin, but it's not actually used anywhere in the app (this will be implemented in a follow-up PR). It can be used like this:

CoreNative.plugin('systemUI')?.setNavigationBarColor('#ff00ff');

Also, keep in mind that I just copied the code from fagundes/cordova-plugin-navigationbar, but presumably that has to be updated in some way (that's the whole reason why we're doing our own plugin to begin with).

Finally, I wasn't able to test this in an emulator because I didn't manage to display the navigation bar :/. But I tried with a real device and it worked.

@crazyserver crazyserver merged commit a722e2c into moodlehq:main Jul 7, 2023
2 checks passed
@phyr0s
Copy link
Contributor

phyr0s commented Jul 9, 2023

Hello @NoelDeMartin, Hope you are well in Japan :)
Since this merge ionic serve stop working in master --> MoodleAppPlugins is not found.

@NoelDeMartin
Copy link
Contributor Author

Hey @phyr0s thanks :D.

About serving the app, that's probably happening because you haven't run npm ci or npm install after updating the code, can you double-check?

Other than that, I realized you may have some problems trying to build for android if you haven't run npm ci or npm install inside of the plugin folder (/cordova-plugin-moodleapp), but I'm trying to work on a fix so that it isn't necessary. In this PR I also modified the scripts you run with npm run dev:android and npm run prod:android so that the plugin is rebuilt when necessary, so that shouldn't be a problem.

@phyr0s
Copy link
Contributor

phyr0s commented Jul 10, 2023

Runned npm install and same :( @NoelDeMartin

@NoelDeMartin
Copy link
Contributor Author

@phyr0s Hm can you try running npm ci instead? And also make sure you're using the proper npm version (we recommend using nvm and doing nvm install).

In any case, to double check that everything is working properly, you should have a cordova-plugin-moodleapp folder within your node_modules, and that folder should be a symlink to the plugin folder, which has the MoodleAppPlugins type defined so it should be fine. We actually know it should work because that's what the ci pipeline is doing and tests pass, so it should be working for you as well.

@phyr0s
Copy link
Contributor

phyr0s commented Jul 12, 2023

with npm ci is working @NoelDeMartin, maybe is better to add post install to execute same as npm ci when npm install.

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