App Not Working When Off Hydration

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
I have built an app that works fine as long as I have hydration enabled. However when I disable hydration I get the following alert message when trying to save input using ajax:

{"readyState"; 4, "responseText":"", "status": 404, "statusText": "Not Found"}

When I turn hydration back on everything works perfectly again.

I have tried both "Rebuild All" and "Update Code" after disabling hydration.
Photo of Margarete Koenen

Margarete Koenen

  • 13 Posts
  • 0 Reply Likes
  • frustrated

Posted 5 years ago

  • 1
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Hi

Can you share your build appid? It can be found at the URL bar:
https://build.phonegap.com/apps/xxxxxxx

Thanks
Photo of Margarete Koenen

Margarete Koenen

  • 13 Posts
  • 0 Reply Likes
Yes, of course, it is 1654596.

Thank you for jumping in and helping me with this.
Photo of Margarete Koenen

Margarete Koenen

  • 13 Posts
  • 0 Reply Likes
I actually found the problem. I had to use the whitelist plugin for android ajax calls to work.

Why hydration makes it unnecessary to use the whitelist plugin, while I have to use it when not enabling hydration, is a mystery to me.
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Glad you found the culprit.
Photo of Guillermo Ramirez

Guillermo Ramirez

  • 2 Posts
  • 0 Reply Likes
same problem here, could you tell me more about this whitelist plugin please. :)
Photo of Margarete Koenen

Margarete Koenen

  • 13 Posts
  • 0 Reply Likes
I actually have a further question. After installing the whitelist plugin I am getting an error message for the ios build. Both available whitelist plugins don't not seem to work with the current cordova ios version.

Other than building two different apps, one for android, the other for ios, is there anything else you would suggest?

Thank you again for your help.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You could try the legacy whitelist plugin. Or the previous version of the whitelist plugin.
Photo of Margarete Koenen

Margarete Koenen

  • 13 Posts
  • 0 Reply Likes
I am using phonegap build. I see 2 whitelist plugins in the list of plugins I can use, "Whitelist" and "Whitelist 2". I tried both and I tried changing the version number to a previous one in the config file. I get compilation errors when I change the versions and ios errors with the current versions of both plugins.

I did a search for legacy whitelist. Aside for the fact that I am not sure how I would use it on build, it also requires cordova-ios 4.

Is there any way that I can specify in the config file to only use the plugin for android?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
As far as I know, https://www.npmjs.com/package/cordova... works well with cli-5.2.0 and you don't need any other elements than 'access origin'

And no, you can't specify plugins for one OS, although such feature is currently on the feature wish list.
(Edited)