Phonegap 3.5 on iOS navigator.connection is undefined - ios

I am porting an old Phonegap 2 app to Phonegap 3.5
I created a new project using the CLI. Added the core plugins, including network-information.
Then I copied my html, css and javascript files.
I am now using XCode to further develop the app.
The app starts on the ios simulator but gets stuck when calling navigator.connection in the code.
I checked that the plugin files are there at platforms/ios/[project name]/plugins/org.apache.cordova.network-information :
CDVConnection.h
CDVConnection.m
CDVReachability.h
CDVReachability.m
The feature tag is there at the config.xml
I found this question Cordova 3 - iOs - navigator.connection Undefined which is the more similar I found to what I am experiencing, but it has not helped me solve the issue.
What else can I check? I need this plugin working. The migration from old phonegap has been a nightmare so far.
Thanks for any help.

I solved this by uninstalling the plugin, and installing it again. Even though everything looked ok, this solved the issue.

Related

'Cordova/CDVViewController.h' not found when Archiving in Xcode (from Worklight)

I'm suffering this error message when trying to Archive my app prior to submission to the App Store.
The full error is:
In file included from /Users/Kevin/Documents/workspace/SongLink2/apps/SLPhone/iphone/native/Classes/CDVMainViewController.m:14:
In file included from Classes/CDVMainViewController.h:15:
/Users/Kevin/Documents/workspace/SongLink2/apps/SLPhone/iphone/native/WorklightSDK/include/MainViewController.h:34:9: fatal error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
^
1 error generated.
I'm using Worklight 6.2 to generate the project having added both Android and iPhone environments). I then switch to Xcode 6 to Run my app. This is successful for Run but fails when I Product->Archive with the error.
I've recently upgraded everything to:
IBM Worklight Studio 6.2.0.00-20140915-1601
Xcode 6.0.1 (6A317)
... but with no success.
I've tried:
Changing Header>Search Paths: but this had no effect. This also suggest reinstalling Cordova but I'm unsure how to do this in a Worklight environment.
Perform Product->Clean with no effect. This discussion also suggested running ./update_cordova_subproject /path/to/your/project but I don't know where Worklight installed cordova to try it.
Many discussions suggest Xcode->Preferences->Locations->Advanced and make sure it's set to Unique... but I'm already set to this value.
similar: but this didn't seem to get resolved
Please help me on my last step to app store submission!
In looking at the Header Search Path(s) I noticed I'd introduced an extra double quote which was causing Xcode some confusion! Once I removed that it worked fine.
Many thanks
I experienced this problem and the solution was a classic XCode mystery incantation to add to your search path:
"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"
Found on this website:
http://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/4

The app references non-public selectors in Payload/Cordova350.app/Cordova350

I have written and exported a Cordova 3.5.0 PhoneGap Application using the Telerik Platform. The app is using jQuery Mobile and an InAppPurchasing plugin.
The only other plugins used are Cordova Splashscreen and Cordova Statusbar.
I can run the app no problem when i install it via iTunes on to my iPad. However, when I submit the app via Application Loader, I get the following errors:
I was tempted to go in and edit/look for the lines that reference these 'non-public selectors' myself but the Cordova350 file is a unix executable file that when opened looks like bytes of hex codes.
I cant seem to find anything from googling around about anyone experiencing a similar issue. Is this just a setting somewhere I have forgotten to untick? Any help would be appreciated

InAppBrowser not launching

I've installed Phonegap using the npm and my app is working great, except when I call window.open to launch a website it does not give me the footer with the done button so my app get's stuck on the called web page.
I am using XCode to build an ios app.
I've used npm to add the InAppBrowser plugin. It added the to to the config.xml.
I've added the site to my whitelist in config.xml. The site opens fine, just without the done button/footer.
It added the InAppBrowser plugin entry to:
/#myapp#/platforms/#platform#/www/cordova_plugins.js
It added the InAppBrowser plugin folder in /#myapp#/platforms/#platform#/plugins/
The related SRC files for InAppBrowser are in the platform folder as well
(for example IOS plugin src files are: /#myapp#/platforms/#platform#/#appname#/Plugins/)
I added a console.log function to InAppBrowser.js to confirm that the plugin is loaded, but it does not generate a log entry.
I've tried many things to get the footer/done button to show without any success, but I seem to be missing something here.
I solved this problem by recreating the Xcode project using cordova (instead of phonegap). I went through all of the solutions several times with no luck, so I used the terminal to build a new cordova project, added the InAppBrowser to the project, then copied my code and assets from the old project to the new one. Launched the app on my ipad and it all worked just fine.
I don't suspect it's a problem with Phonegap 3.1.0. I think there was a project issue that kept it from working and starting over with a clean project did the trick.
All is well.
One note is that I saw postings that reported cordova interrupts the console.log function, so be careful with that. Alerts work just fine.

Sencha app with Cordova on Xcode

I am trying to build a ios package using sencha and phone gap. I followed the steps here http://vimeo.com/56673251. I am able to build and run the package on ios simulator. However, I can only see the index.html page. All the model, view and controller folders with js files created by sencha are not copied there. So, I am not able to run the app which i built using sencha.
When i click on the app/view/Main.js i get error The requested URL was not found on this server.
Any help on this would be great.
I think that the problem is that they expect you to run only the "production" version of you app inside cordova. When you set production the microloader is not used and everything is compiled into one file instead. That should solve the issue.

PhoneGap 0.9.6 (Blackberry) + Sencha Touch 1.1.0: deviceready does not fire

I'm trying to build an app that uses PhoneGap 0.9.6 and Sencha Touch 1.1.0 for Blackberry. (The app is already running fine on iOS and Android).
Unfortunately the crucial deviceready event does not fire anymore once I include the Sencha Touch files. This is how I tested:
Build the PhoneGap example app as described on http://www.phonegap.com/start#blackberry using the BlackBerry WebWorks Packager 2.0.0
Edit index.html so it's shorter and add alerts in init() and deviceInfo() and run the example on the Blackberry emulator 6.0.0.227. (Could not figure out how to add a code block with HTML so please go to http://pastebin.com/rUU1bDbL to see the modified code.) Everything is still working.
Include the css and js of Sencha Touch 1.1.0: http://pastebin.com/Y4Vydby1 After that change the function deviceInfo does not get called anymore.
According to this thread a similar problem with jQuery Mobile can be solved by changing the order of the includes but every combination I tried had the same problem.
Is this a general problem? Is someone successfully using PhoneGap 0.9.6 and Sencha Touch 1.1.0 on Blackberry?
Temporary solution: revert to PhoneGap 0.9.5.1
This seems to be a problem encountered by most people trying to work with Phonegap/Sencha on Blackberry recently.
We found that the basic PhoneGap Sample demo would break as soon as we included the sencha.js library, even though we were not even using it. I.e., the Sample demo runs fine on Blackberry, but if you then include sencha.js it no longer operates properly.
Someone reported that they resolved the problem by reverting to 0.9.5.1 version of PhoneGap. That worked for us, but 1.0.0 does not.
http://groups.google.com/group/phonegap/browse_thread/thread/3ed0192e44a49ad1/6be7980f9164c455?lnk=gst&q=blackberry+sencha#6be7980f9164c455
We would love to see this fixed so that we can be running the latest version of PhoneGap.
The issue has popped on on various forums lately, but doesn't appear to have Phonegap's attention yet.
e.g., https://github.com/phonegap/phonegap-blackberry-webworks/issues/44#issue_comment_form ("No one is assigned")
This seems like a major problem because it makes it impossible for anyone to do anything on a new Blackberry that uses PhoneGap/Sencha. I know there have been a lot of other things fixed between 0.9.5.1 and 1.0.0 so I am worried about fielding an app using the older version.
Keith Levi

Resources