Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Calling chcp.configure() throws error in iOS #77

@TrevorMills

Description

@TrevorMills

Hi there,

I'm trying to do this:

function myDeviceReady() {
    var options = {
        'auto-download': false,
        'auto-install': false,
        'config-file': 'http://asdf.ngrok.com/chcp.json' // will eventually be a manufactured server URL
    } 
    chcp.configure( options );
}    

When I run the app in iOS simulator, I get the following in the Xcode console:

2015-12-30 15:57:22.531 Simple[3326:41957] -[__NSDictionaryM dataUsingEncoding:]: unrecognized selector sent to instance 0x7ff5a3cba5d0
2015-12-30 15:57:22.533 Simple[3326:41957] *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[__NSDictionaryM dataUsingEncoding:]: unrecognized selector sent to instance 0x7ff5a3cba5d0

It's as if the chcp.configure() function was expecting a string. I was able to get it working by using:

chcp.configure( JSON.stringify( options ) );

But, that seems wrong. I'm using the latest version of your plugin from npm - 1.1.2. In this phase of my development I am NOT using the dev add-on.

I'm building a Sencha Touch app, if that makes a difference, so the above code is not actually run on 'deviceready'. Rather, it's in a controller that gets initiated after 'deviceready' ( putting the code in a 'deviceready' listener doesn't make a difference ). It could be an issue with Sencha Touch, but I struggle to see how.

In Android, if I pass in the stringified version, then CHCP plugin does not work ( it doesn't have a config-file to load ).

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions