3

I'm having some issues with Phonegap Build and my Iphone.

At the moment I have the following preferences in my config.xml

<preference name="webviewbounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="UIWebViewBounce" value="false" />

and the following meta tag;

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />

The application compiles fine and my app runs off the 'Test flight' system very well, barring this one issue. The application seems to be 'Draggable' (which I believe is the bounce problem).

Things i've tried;

Delete my Phonegap Build Project.

Remove all config.xml files barring my main one located in the project root.

Using only one of the preferences etc.

Does anyone have any idea how I can prevent the app from being dragged down the screen (I have elements that have overflow on them, and they scroll fine, but the whole app scrolls some times which really effects the user experience).

Thanks.

*Edit 1

So i've opened up my .ipa file on a mac and it seems that in the config.xml the "DisallowOverscroll" is being set to false. I'm not quite sure why this would be happening?

Feedel
  • 163
  • 2
  • 14
  • 1
    webview bounce appears to be no-longer supported. See current config options here: http://cordova.apache.org/docs/en/5.1.1/config_ref/index.html – Dawson Loudon Nov 05 '15 at 18:23
  • 1
    There is a new [Cordova version ready for iOS](https://cordova.apache.org/announcements/2015/11/02/cordova-ios-3.9.2.html). However, it is [not yet available](http://community.phonegap.com/nitobi/topics/cordova-ios9-is-officially-supported-as-apache-cordova-ios-3-9-2) for *Phonegap Build*. Watch [the blog](http://phonegap.com/blog/) for a new version. Best of Luck –  Nov 08 '15 at 01:12

2 Answers2

4

Well, actually just the <preference name="DisallowOverscroll" value="true" /> should be enough, your viewport tag looks good enough. Try to completely remove the ios platform, and re-add it again.

Dmitry Sokurenko
  • 6,042
  • 4
  • 32
  • 53
  • That's what I thought too. I checked inside my config.xml (opening up the .ipa file) and it appears that value is being set to false. Also, it seems that the config.xml is just a generic Cordova one... I've deleted the app from Phonegap build and re-added it. still no luck! – Feedel Nov 06 '15 at 10:37
  • 1
    It seems that either you've just messed up something with the build process (try to change any other config.xml setting to see whether the change is reflected on the app), or maybe you have some plugin installed which set the `DisallowOverscroll` to false. – Dmitry Sokurenko Nov 06 '15 at 12:27
  • Yeah, i'm kind of that same thinking too. I don't have any plugins installed bar the default whitelist plugin. - I don't know quite what i can mess up though. I only have 1 config file (located in my root, not in www/) and then build it using ("phonegap serve" cmd line. as i'm on win7 with my project). – Feedel Nov 06 '15 at 13:43
  • 1
    Try to rebuild it before serving, e.g. `phonegap build` or `cordova build`. Btw, check which node.js version you are using, I've upgraded to node 5.0 few days ago and it just doesn't work with cordova at all, so I've reverted to 0.12. – Dmitry Sokurenko Nov 06 '15 at 14:22
  • I've tried that, along with the remote building features for phonegap. The remote one didn't work properly (through command line anyway). I'm convinced it's something to do with the placement of my config.xml file. Not sure what exactly is wrong with it, but i assume it should be in the /www/ folder too? – Feedel Nov 06 '15 at 15:56
  • Removing and adding back the iOS platform (after adding the preferences) worked for me. – Form May 17 '19 at 20:32
3

Okay, So I figured it out, thanks to dsokurenko who put the idea in my head that the config.xml wasn't actually being read!

So my steps to fix this;

  • Create a new phonegap project

  • Copy my files across

  • Move config.xml to /www/ folder (I believe this was the key to fix the issue, change any config values that have /www/ in them

  • Create new app on Phonegap Build, re-build and install!

This worked for me and I hope it helps someone else.

Feedel
  • 163
  • 2
  • 14
  • 2
    btw, `confix.xml` should be placed to the root project folder, not to the `www` one. – Dmitry Sokurenko Nov 06 '15 at 19:35
  • Thanks Dmitry, I did think that was the case, however going by what i've seen, it seems it is more imporatnt for the config.xml to be in the same place as your index.html. – Feedel Nov 09 '15 at 09:57
  • 1
    @Feedel you just made your www your root folder. Phonegap build !== phonegap. Phonegap/Cordova uses a WWW folder, phonegap build does *not*. You need to have both the index.html and config.xml within the root of the zip-file you upload and that is all, no matter the name. Common PGB misconception. Fell for it myself.. – NoobishPro Jan 07 '18 at 20:20