You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One possible improvement would be to include the error object and success flag seen in the logcat message in the data object that is passed to the callback function. E.g.
interfaceAppRestoredResult{pluginId: string;methodName: string;data: any;success: boolean;error?: {message: string;}}// The error field might look differently depending on what kind of data can be added to an errorconstdata: AppRestoredResult={pluginId: "Camera",methodName: "getPhoto",data: {}success: false,error: {message: "User cancelled photos app"}}
How to reproduce
Write an app using the camera plugin and the appRestoredResult callback
In the developer settings on your device, enable "Don't keep activities". This will make sure that the capacitor activity is killed as soon as the device switches to the camera activity.
Open your app and trigger the camera app.
Don't actually take a picture but cancel in the camera app.
appRestoredResult will now return the data as described above.
The text was updated successfully, but these errors were encountered:
WIStudent
changed the title
Improvement: Return also error data on appRestoredResult on Android
Improvement: Return error data on appRestoredResult on Android
Jul 24, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Issue
Using the
callback I noticed that it doesnt return any helpful information if a plugin returns an error using:
Using the camera plugin for example, I can see in logcat the message
when canceling the camera app. But the
appRestoredResult
callback only getsImprovement
One possible improvement would be to include the
error
object andsuccess
flag seen in the logcat message in the data object that is passed to the callback function. E.g.How to reproduce
appRestoredResult
callbackappRestoredResult
will now return the data as described above.The text was updated successfully, but these errors were encountered: