Skip to content

Titanium.Network undefined in cocoafish-1.2.min.js #5

@fariazz

Description

@fariazz

Hi,
I have a HTML5 app which uses the Javascript SDK, it works fine when I run it in a web browser. I want to wrap it in a webview using Titanium so that I can package it for Android.

When I run this HTML5 app inside of a webview in Titanium, I get the following error when running any sdk.sendRequest(), and it doesn't retrieve info from the ACS cloud:

[INFO][TiWebChromeClient.console(  390)] (main) [2796,30865] TypeError: Result of expression 'Titanium.Network' [undefined] is not an object. (1:http://sdk.cocoafish.com/js/cocoafish-1.2.min.js)

The code in Titanium's app.js is very simple:

var win = Ti.UI.createWindow({
    fullscreen:false,
    navBarHidden:true,
});
var webview = Ti.UI.createWebView({
    url: 'login.html',
    navBarHidden:true,
    fullscreen:true
});
win.add(webview);
win.open();

And login.html is very simple, it creates a new Cocoafish object with the app's key, then it uses sendRequest for login. It works well in all desktop web browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions