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

feat(app): return promise in exitApp #777

Merged
merged 9 commits into from
Mar 1, 2022

Conversation

riderx
Copy link
Contributor

@riderx riderx commented Jan 24, 2022

document the type change in v2 of the plugin

closes #750

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

You also need to change CAP_PLUGIN_METHOD(exitApp, CAPPluginReturnNone); to CAP_PLUGIN_METHOD(exitApp, CAPPluginReturnPromise); in AppPlugin.m file.

We are not merging this yet as it's a breaking change and it's planned for when we start working in Capacitor 4 and version 2 of the plugins.

@jcesarmobile jcesarmobile added this to the @capacitor/app 2.0.0 milestone Jan 24, 2022
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot, you also have to run npm run build so the docs get re generated with the type change

@riderx
Copy link
Contributor Author

riderx commented Jan 24, 2022

@jcesarmobile thanks for the report. Do we have a doc somewhere do learn oh to code and test ?
Edit: sorry i missed the page : https://github.com/ionic-team/capacitor-plugins/blob/main/CONTRIBUTING.md

@jcesarmobile
Copy link
Member

jcesarmobile commented Jan 24, 2022

we test on the capacitor-testapp, check its readme
https://github.com/ionic-team/capacitor-testapp#developing-capacitor

@riderx
Copy link
Contributor Author

riderx commented Jan 24, 2022

My issue is more about installing package and using git with Lerna, i see 0 changes do i need a specific VSCode plugin ?

@jcesarmobile
Copy link
Member

If you run npm install on the root, lerna runs npm install on all plugins, same if you run npm run build, lerna runs it for all.
But you can also go to the plugin folder and run the same commands there, it will be faster as it will only run for that plugin instead of all.

@riderx
Copy link
Contributor Author

riderx commented Jan 25, 2022

@jcesarmobile it seems from the doc i have to install Lerna in global right ? https://lerna.js.org/

@jcesarmobile
Copy link
Member

Not sure, it’s on the devDependencies, so shouldn’t be needed globally, but if it’s not working then you can give it a try.

@riderx
Copy link
Contributor Author

riderx commented Jan 25, 2022

@jcesarmobile yes with Global install that do way different install flow ! Now i'm able to run all commands !

@riderx
Copy link
Contributor Author

riderx commented Jan 25, 2022

@jcesarmobile i think that good in my side

@@ -9,5 +9,5 @@
CAP_PLUGIN_METHOD(getLaunchUrl, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(getState, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(minimizeApp, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to change it in exitApp, not in removeAllListeners

Suggested change
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(removeAllListeners, CAPPluginReturnNone);

@riderx
Copy link
Contributor Author

riderx commented Jan 25, 2022

Sorry @jcesarmobile i was sick yesterday :/ i updated

@riderx
Copy link
Contributor Author

riderx commented Feb 22, 2022

@jcesarmobile good for you ?

@jcesarmobile jcesarmobile changed the base branch from main to capacitor-4 March 1, 2022 13:15
@jcesarmobile jcesarmobile changed the title fix: return promise in exitApp to allow catch in ios #750 feat(app): return promise in exitApp Mar 1, 2022
@jcesarmobile jcesarmobile merged commit 38e1efc into ionic-team:capacitor-4 Mar 1, 2022
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.

2 participants