1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5
    Vote Rating
    0
    BörnR is on a distinguished road

      0  

    Default Unanswered: Build Phonegap with Plugins

    Unanswered: Build Phonegap with Plugins


    Hello,
    i got an app with sencha touch 2 and phonegap 1.6.1.
    I use the Facebook Plugin and Native Plugins.

    1. Cause my Development and testing i got an Project with Xcode, with the complete Project from sencha.
    All works fine with the iOS Simulator but i want to minify my Project.

    The Problem is, if i want to build a package, i get an error with undefined type.

    When i start the index.html in the browser an error occurs with the message:
    TypeError: 'undefined' is not a function (evaluating 'cordova.exec')
    cdv-plugin-fb-connect.js


    I know that the browser don't know the Cordova Functions but i want to build my app and want to avoid this.

    can anyone help me with that?


    2. I want to test my app on my real device with Xcode, but it didn't work with the same repo like the Simulator.
    I don't need to make any configurations at the app.json or packager,json right?
    So i dont understand why it still not work.
    I get the Splashscreen and my testing alerts appears.
    I got two alerts in sencha-touch.js at the start and the end. These two alerts appear.
    My alert at the app.js at the start appears to, but not in my Application Launch function.

    To be sure that the installing is right, i make a new app with Xcode, phone gap and sencha. Now with build app package and this works on my device. It works with build package and without any build.

    Did anyone know this Problem and can me help out with that?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,013
    Answers
    3490
    Vote Rating
    848
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Sounds like you aren't including the phonegap lib. You may enjoy this blog post: http://robertdougan.com/posts/packag...onegap-cordova
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5
    Vote Rating
    0
    BörnR is on a distinguished road

      0  

    Default


    thx for your reply, this could solve my Problem.
    I didnt know anything about the all command from creating.

    The whole problem is thaf i use the Facebookplugin written with objective C, cause i dont want to build server side thinks for this connection.

    If i search for the app id in my project, i added the plugin vaeiables that creates my error, not nice, but i will see what i get when creating a project with the all command.

    my second question is solved with building the app with package and placed in xcode.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5
    Vote Rating
    0
    BörnR is on a distinguished road

      0  

    Default


    no this didn't helps, cause aim using the iOS Facebook Plugin i think.

    I use at the FB.init the option
    nativeInterface: CDV.FB,
    and thats the error for the build.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    darren707 is on a distinguished road

      0  

    Default


    Did you ever find a solution for this?

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5
    Vote Rating
    0
    BörnR is on a distinguished road

      0  

    Default


    just add this

    PHP Code:
    if(cordova.exec()){...} 

  7. #7
    Sencha User
    Join Date
    Oct 2012
    Posts
    11
    Vote Rating
    0
    josser is on a distinguished road

      0  

    Default


    Quote Originally Posted by BörnR View Post
    just add this

    PHP Code:
    if(cordova.exec()){...} 
    Hm, this doesn't help. The code in the if() just doesn't execute.
    My first thought that i miss cordova.js file.
    But I tried several ways to include cordova.js (via app.json and directly in index.html) without luck

    Does anybody solved this?

  8. #8
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5
    Vote Rating
    0
    BörnR is on a distinguished road

      0  

    Default


    no,
    just write

    if(cordova.exec()){cordova.exec("ACTION");}

    only if cordova.exec() is tru, you can make your Action with cordova.
    And the compiler wont throw an error.