-
Notifications
You must be signed in to change notification settings - Fork 991
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(android): activity result use new API and updated permission result callbacks to match #4127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been doing some testing on the sample app and on camera page the app crash on the second time I click the "Request all permissions" button (or with the photo permissions too) because of null savedCall
on triggerPermissionCallback
method.
I tried to put a null check and that only avoids the crash, then one of each call works and the following doesn't because it's null, then the following works again and so on, so loos like the bridge.getPermissionCall(handle.getId());
is not working properly or it's not getting stored properly
Nice catch. Thanks for testing, the call was being saved twice so subsequent permissions checks on the same plugin were trying to find an old call and fetching |
requestCodes
element removed from@CapacitorPlugin
annotation (breaking change for plugins with activity results on Capacitor 3 beta)@ActivityCallback
annotation to a method with the parameters (PluginCall, ActivityResult).@PermissionCallback
annotation to a method with the parameter (PluginCall)permissionCallback
element is removed from the@PluginMethod
annotation (breaking change for plugins with permission requests on Capacitor 3 beta)startActivityForResult(PluginCal call, Intent intent, String callbackName);
and link to the registered callback by providing the name of the callback method.requestPermissionForAlias(String alias, PluginCall call, String callbackName);
Resolves #4050