[ 
https://issues.apache.org/jira/browse/CB-8917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15112737#comment-15112737
 ] 

ASF GitHub Bot commented on CB-8917:
------------------------------------

Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/461#discussion_r50564887
  
    --- Diff: www/docs/en/dev/guide/platforms/android/lifecycle.md ---
    @@ -80,14 +150,20 @@ The payload for the `resume` event adheres to the 
following format:
     {
         action: "resume",
         pendingResult: {
    -        pluginServiceName: <name of the plugin e.g. "Camera">,
    -        pluginStatus: <description of the result's status (see below)>,
    -        result: <argument(s) that would have been given to the callback>
    +        pluginServiceName: string,
    +        pluginStatus: string,
    +        result: any
         }
     }
     ```
     
    -The possible plugin statuses in the `pendingResult` field include the 
following values:
    +The fields of that payload are defined as follows:
    +
    +* `pluginServiceName`: The name of the plugin return the result (e.g. 
"Camera"). This can be found in a plugin's plugin.xml
    +* `pluginStatus`: The status of the plugin call (see below)
    +* `result`: Whatever the result of the plugin call is
    +
    +The possible values for `pluginStatus` in the `pendingResult` field 
include the following:
    --- End diff --
    
    There is no real reason it is a string vs an enum. I tried to clarify below 
that the meaning of statuses are for the most part determined by the author of 
the plugin. The other ones (class not found, etc.) are really intended for 
plugin developers and don't really make sense to expose to the user. However, 
we don't really have a choice in exposing them thanks to how cordova-android 
handles plugin results. I will try and define them here, but I think plugin 
developers should be the ones to specify what to check for.


> Add api/way to get plugins results even when Cordova activity restarts  
> ------------------------------------------------------------------------
>
>                 Key: CB-8917
>                 URL: https://issues.apache.org/jira/browse/CB-8917
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Bnaya
>            Assignee: Richard B Knoll
>
> In android when you have a plugin that opens new activity the CordovaActivity 
> will be killed and you won't get the result from the plugin.
> The new activity will get the results but because the plugin objects are dead 
> and the webview reloaded you can get the data to the js callback.
> The most noticeable example is the camera plugin. (And maybe its the same 
> with even more platforms)
> possible solution for this is to add metadata to the device ready event with 
> incoming data from plugins.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to