Prabhakar Shanmugam
Prabhakar Shanmugam

Reputation: 6144

Phonegap 2 + Sencha Touch2 + iOS

This is my first question on Stack Overflow. Please be kind on my mistakes. I want to combine Sencha Touch 2 and Phonegap 2 for iOS in XCode.

Steps I took:

  1. Created a Phonegap project for iOS.
  2. Created a Sencha Touch 2 project separately.
  3. Removed all the contents inside the www folder except cordova.2.0.0.js.
  4. Copied the entire Sencha Touch 2 project contents and put it in the www folder of the Phonegap project.
  5. Added cordova js to app.json path. [somebody told me that including that in index.html will not include that and it has to be done this way. Please correct me if I'm wrong.]

Result :

Sencha Touch 2 app runs fine when I run it from XCode. But the Phonegap script doesn't work. I put a simple Phonegap works alert inside html of main.js.

html: [
       "<script type='text/javascript'>",
       "document.addEventListener('deviceready', function () {",
       "alert('Our first PhoneGap app');",
       "}, false);",
       "</script>",
       "You've just generated a new Sencha Touch 2 project. What you're looking at right now is the ",
       "contents of <a target='_blank' href=\"app/view/Main.js\">app/view/Main.js</a> - edit that file ",
       "and refresh to change what's rendered here."
       ].join("")

While the content shows, the script doesn't run. I tried this tutorial. But I believe it's old and doesn't cover Phonegap 2. Also I've seen Sencha built for iOS instead of Phonegap, that packs everything nicely. But I need Phonegap and its features.

Please help me with any updated tutorial, hints, code sample/download [not greedy, helpless].

Thanks all,

Prabhakar S

Upvotes: 0

Views: 1932

Answers (1)

eddie.vlagea
eddie.vlagea

Reputation: 667

You need to include cordova.js in your index.html file.

Upvotes: 2

Related Questions