Solution: Viewport meta tag being ignored in PhoneGap iOS

22nd May 2013 • No Comments

Another common PhoneGap issue I came across with no up to date instructions how to solve (seems to be for older versions of PhoneGap) is the viewport meta tag being ignored. It is actually a very easy fix. Here is how to do it in the most recent version of PhoneGap for iOS at the time of writing (2.7.0).

In your Xcode project click on “config.xml”, find the tag that says “<preference name=”EnableViewportScale” value=”false” />”, change the value to true “<preference name=”EnableViewportScale” value=”true” />”, save and you’re done.

I told you it was easy, shame it’s not well documented.

Read More

Solution: PhoneGap, tracking geolocations in the background iOS

16th May 2013 • 10 Comments

Today I was freaking out, I just started this app and it required the ability to track geolocations, obviously this would need to work in the background if the user got a call, or wanted to do another task on their phone. I searched the web and saw many responses saying it wasn’t possible, but it is!

If you’re using the¬†javascript¬†navigator.geolocation.watchPosition the following worked for me using the latest version of PhoneGap at the time of writing (2.7.0).

Go to the “Resources” folder in your XCode project, click on the file that is called “yourprojectname-Info.plist” (this file may be located elsewhere in other versions of PhoneGap). Click the plus next to “Information Property List”. Type in the new field “Required background modes”, click the arrow located next to the new row and in the value for “Item 0″ type “App registers for location updates”.

Screen Shot 2013-05-16 at 5.40.41 PM

That should do the trick.

Read More