You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Björn Vermeule (JIRA)" <ji...@apache.org> on 2014/05/06 10:04:17 UTC

[jira] [Comment Edited] (CB-6633) Embedding the WebView on iOS breaks all plugins

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

Björn Vermeule edited comment on CB-6633 at 5/6/14 8:03 AM:
------------------------------------------------------------

I have attached the following project. This is basically the Cordova hello world project generated by the CLI. I have added a storyboard where I embed a Cordova WebView and prevented Cordova from setting the root view model by commenting out the code in AppDelegate.didFinishLaunchingWithOptions. The MainViewModel also no longer derives from CDVViewModel but from UIViewModel.

There's a simple plugin that only logs to console when called. You'll see that with the embedded WebView the function never gets called. However, when enabling the code again in AppDelegate.didFinishLaunchingWithOptions (and thus letting Cordova set the root view model again) the plugin gets called successfully.

Worth noting is that in the attached project the DeviceReady event does get fired.


was (Author: bvermeule):
I have attached the following project. This is basically the Cordova hello world project generated by the CLI. I have added a storyboard where I embed a Cordova WebView and prevented Cordova from setting the root view model by commenting out the code in AppDelegate.didFinishLaunchingWithOptions. The MainViewModel also no longer derives from CDVViewModel but from UIViewModel.

There's a simple plugin that only logs to console when called. You'll see that with the embedded WebView the function never gets called. However, when enabling the code again in AppDelegate.didFinishLaunchingWithOptions (and thus letting Cordova set the root view model again) the plugin gets called successfully.

> Embedding the WebView on iOS breaks all plugins
> -----------------------------------------------
>
>                 Key: CB-6633
>                 URL: https://issues.apache.org/jira/browse/CB-6633
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.4.0
>            Reporter: Björn Vermeule
>            Assignee: Shazron Abdullah
>              Labels: cordova, cordova_plugins.js,, ios
>         Attachments: hello.zip
>
>
> I have manually embedded the WebView on a Storyboard in iOS. I've done this by generating a new application using the Cordova CLI and then commenting the initialization part in AppDelegate.didFinishLaunchingWithOptions. I have then created a ViewController that sits between the Storyboard and the generated controller that derives from CDVViewController. Embedding the WebView works perfectly fine this way. However, all communication between JavaScript and the native code has stopped working. This also means the DeviceReady event does not get fired.
> I have tried the following:
> * It works fine on Android (but this might be less relevant)
> * Tried overriding CDVCommandQueue and CDVCommandDelegateImpl but the implemented functions do not get called.
> * I have put breakpoints in all functions of CDVCommandQueue in CordovaLib but none get called.
> * cordova.exec gets successfully called on JavaScripts' end.
> * Uncommenting the code in AppDelegate.didFinishLaunchingWithOptions (and thus overriding the embedded view) works perfectly
> * This applies to the Camera plugin and a simple custom plugin I made.
> I'm completely lost trying to find what the cause of this is. All I could find was this which seemed pretty much the same: http://stackoverflow.com/questions/19634361/cordova-3-0-on-ios-plugin-method-not-being-called/19854528
> If you want code or let me debug something please let me know. This applies to Cordova 3.4.1



--
This message was sent by Atlassian JIRA
(v6.2#6252)