I am trying to integrate the ST2 application into PhoneGap; but i have problems.
I added cordova.js in app.json:
{
"path": "resources/js/cordova-1.6.1.js",
"update": "delta"
},
{
"path": "resources/js/test.js",
"update": "delta"
}
Test.js:
function alertDismissed() {}
function showAlert() {
navigator.notification.alert(
'You are the winner!',
alertDismissed,
'Game Over',
'Done'
);
}
Inside the view, I created a dummy button:
items: [{
text: 'test',
action: showAlert(),
}],
When I press the button; the function 'showAlert ()' starts correctly; but it doesn't execute correctly, I have an error:
Uncaught TypeError: Cannot call method 'alert' of undefined
Obviously, because the navigator object does not start.
Question: is it possible to run the / senchatouch 2 cordon too? If so, what is the correct way to do this?
SOLVED:
Add cordova.js to app.js
{
"path": "resources/js/cordova-1.6.1.js",
"update": "delta"
},
{
"path": "sdk/sencha-touch.js"
},
{
"path": "app.js",
"update": "delta"
},