External link work with Hydration but not without

  • 1
  • Question
  • Updated 4 years ago
External link works with Hyration but it will not work with out Hydration.
I added my external link to my white-list (allow-navigation) but still not working and also I added following meta data
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1. If you want to post code here, wrap it in an html CODE element as described under "some HTML allowed"

2. You would be better off using the inAppBrowser plugin to display external content

3. However, if you really insist on using regular hyperlinks, make sure you have included the whitelist plugin properly and also make sure that PGB will find, read and parse your config: have config and index both in the root of your zip and check if the xml is well-formed

4. Changes made to config while app is hydrated are ignored!
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes
Dear Petra,
Thanks for you fast reply
I have website and I am using phonegap to redirect to the my website.

When I checked the build log I found that when I have hydration I have
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Installing "com.phonegap.plugins.hydration" at "5.0.1" for android
Installing "cordova-plugin-network-information" at "1.0.1" for android
Fetching plugin "cordova-plugin-whitelist" via npm
Installing "cordova-plugin-whitelist" at "1.2.2" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
--------------------------------------------------------------------------------

but when I turn of the hydration the plugin output is empty.

PLUGIN OUTPUT
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Maysam
Since this is your first post, please answer the following question:
- is this your first hybrid app?
- are you using Desktop App?
- are you using CLI, Build, or SDK? Please do not assume the answer, please read the link.

Thanks
Jesse
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes
@Jesse
Yes this is my first app.
Yes I am using phonegap emulator app as well for tetsing before I build it in the phonegap website.
I am using build.phonegap.com to build my application.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
I am using phonegap to redirect to the my website
That is different from what you wrote in your first post, since you mentioned "a link" there.

Most likely, your config isn't found.
- Can you confirm that you have both index.html and config.xml in the ROOT ("/") of your zip file?
- Can you confirm that you are using PGB 'cli-5.1.0' or higher?
- Can you confirm that the problem only occurs in Android4+, not in iOS?


@Jesse: he is using Build, otherwise there would not be any Hydration.
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes
@prev
sorry about confusion.

I have www folder and index.html file is in the www folder. www folder is in the root of zip folder
Config file is sibling of www folder and is in the root of the zip file

I am not using CLI to build the application. I am using build.phonegap.com.
My app works for in IOS.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
I have www folder and index.html file is in the www folder. www folder is in the root of zip folder
Config file is sibling of www folder and is in the root of the zip file
Well, there's your problem. You can't do that.
The best way to correct this:
- move config.xml into /www
- adjust the paths to icons and splashes
- zip up the CONTENTS of /www (not the directory itself!) and rebuild
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes
Thanks
That resolved my issue.
How come the phonegap app did not put the config file in the right place when it createa project for me.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
The Phonegap app prepares for working with Phonegap (locally). Phonegap/Cordova requires a certain directory structure and directory names.

Phonegap Build is a service which doesn't require any directories at all, so also no predefined directory structure or directory naming.
All PGB wants is a zip file with index and config in the root (of course, because that's the only directory of which you know that it exists in any zip file). Everything else is up to the developer.
Photo of Maysam K Dabbagh

Maysam K Dabbagh

  • 6 Posts
  • 0 Reply Likes
I moved the config.xml and it resolved the issue.

Thanks