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

Michael Romanovsky commented on CB-8352:
----------------------------------------

OK, I don't know everything about Java and Android so correct me if I'm wrong:

1) To request a survey, PollFish needs an Activity that accesses/controls the 
screen. The main Cordova Activity is the only one that can access the webview.

2) PollFish has events which fire and call certain functions in the Activity in 
(1), if the Activity is extended via the "implements" operator. The events 
won't fire in any other Activity.

3) Since the main Cordova Activity does not pass any function calls other than 
onActivityResult, onPause, onResume, etc., the functions must be implemented 
inside the main Cordova Activity class to pass data to the plugin. That means 
this setup can't be used as a full-fledged plugin because it requires editing 
the Activity class / file.

Maybe I am not understanding something, but I don't see any way to get the 
various function calls like onPollfishSurveyReceived working inside of my 
plugin without modifying the Activity. Is there a bug or some gap in my 
understanding of the mechanism here?

> Need some way to expand an activity's functions, or relay them to a plugin.
> ---------------------------------------------------------------------------
>
>                 Key: CB-8352
>                 URL: https://issues.apache.org/jira/browse/CB-8352
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android, CordovaJS
>            Reporter: Michael Romanovsky
>              Labels: cordova, cordova-lib
>
> There is already startActivityForResult, which helps me run onActivityResult.
> I am having trouble integrating this: http://tinyurl.com/kptdph5
>  as a plugin, however. It calls for extending the main Activity to run the 
> events, but as far as I know, only onActivityResult will forward back to a 
> plugin.
> Some ideas:
> 1) A pre-processing step that rewrites the main Activity and adds functions 
> from a specific class into the Activity.
> 2) ???
> 3) PROFIT.



--
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