10 Replies Latest reply on Mar 8, 2018 10:16 PM by amow31609571

    My Phonegap app is redirected to annoying isp page,help

    amow31609571

      When my mobile data credit expires ,isp redirects to its page ,how can i prevent that via config file or security index meta tag,i have already done on config this

      <access origin="*://*.mysite/*" subdomains="true" />

      please help me, because its really important.

        • 1. Re: My Phonegap app is redirected to annoying isp page,help
          jcesarmobile_ Adobe Community Professional

          do you have an allow-navigation tag in your config.xml? if you have it with *, change it to only allow navigation to your site

          • 2. Re: My Phonegap app is redirected to annoying isp page,help
            amow31609571 Level 1

            thank you so much i will reply back with outcome

            • 3. Re: My Phonegap app is redirected to annoying isp page,help
              amow31609571 Level 1

              Hi again i tested the url as instructed,the ajax loads isp page instead of showing no network when data credit is off

              here is what i did .Can you direct me whats wrong with my config code

              <allow-navigation href="*://*.mysite.php/*" />

               

               

              <!-- The above is equivalent to these three declarations -->

              <allow-navigation href="http://*/*" />

              <allow-navigation href="https://*/*" />

              <allow-navigation href="data:*" />

                 

               

              <access origin="*://*.googleapis.com/*" subdomains="true" />

              <access origin="*://*.gstatic.com/*" subdomains="true" />

              <access origin="*://*.google.com/*" subdomains="true" />

              <access origin="*://*.googleusercontent.com/*" subdomains="true" />

                  <allow-intent href="http://*/*" />

                  <allow-intent href="https://*/*" />

                  <allow-intent href="tel:*" />

                  <allow-intent href="sms:*" />

                  <allow-intent href="mailto:*" />

                  <allow-intent href="geo:*" />

              • 4. Re: My Phonegap app is redirected to annoying isp page,help
                jcesarmobile_ Adobe Community Professional

                Can you post your actual, real config.xml?

                 

                This is for allowing internal navigation to your site

                <allow-navigation href="*://*.mysite.php/*" />

                 

                For ajax the access tag is used, so you should use

                 

                <access origin="*://*.mysite.php/*" />

                 

                Also try adding a connect-src to your Content-Security-Policy tag (if you have one)

                 

                connect-src *://*.mysite.php/*

                • 5. Re: My Phonegap app is redirected to annoying isp page,help
                  amow31609571 Level 1

                  Thank you so much  below is my config file and how

                  ajax loads remote page to my  index file,when credit expires the isp page is loaded.

                  Index file

                  <script type="text/javascript">

                              $(document).ready(function(){

                                  $('#form-id').load('http://mysite/', '', function(response, status, xhr) {

                                      if (status == 'error') {

                                          var msg = "Sorry but there was an error: ";

                                          $(".content").html(msg + xhr.status + " " + xhr.statusText);

                                      }

                                  });

                              });

                      </script>

                  <div id="form-id">Please  check network</div>

                   

                  My config file

                  <?xml version='1.0' encoding='utf-8'?>

                  <widget id="com.com.com" version="4.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">

                      <name>BuyOuts</name>

                      <description>

                         Deals

                      </description>

                      <author email="support@phonegap.com" href="my site">

                          Motor deals and spares

                      </author>

                      <content src="index.html" />

                  <preference name="LoadUrlTimeoutValue" value="70000"/>

                  <preference name="SplashScreenDelay" value="7000" />

                      <preference name="DisallowOverscroll" value="true" />

                      <preference name="android-minSdkVersion" value="14" />

                      <plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />

                      <plugin name="cordova-plugin-camera" source="npm" spec="~2.1.1" />

                      <plugin name="cordova-plugin-media-capture" source="npm" spec="~1.2.0" />

                      <plugin name="cordova-plugin-console" source="npm" spec="~1.0.2" />

                      <plugin name="cordova-plugin-contacts" source="npm" spec="~2.0.1" />

                      <plugin name="cordova-plugin-device" source="npm" spec="~1.1.1" />

                      <plugin name="cordova-plugin-device-motion" source="npm" spec="~1.2.0" />

                      <plugin name="cordova-plugin-device-orientation" source="npm" spec="~1.0.2" />

                      <plugin name="cordova-plugin-dialogs" source="npm" spec="~1.2.0" />

                      <plugin name="cordova-plugin-file" source="npm" spec="~4.1.1" />

                      <plugin name="cordova-plugin-file-transfer" source="npm" spec="~1.5.0" />

                      <plugin name="cordova-plugin-geolocation" source="npm" spec="~2.1.0" />

                      <plugin name="cordova-plugin-globalization" source="npm" spec="~1.0.3" />

                      <plugin name="cordova-plugin-inappbrowser" source="npm" spec="~1.3.0" />

                      <plugin name="cordova-plugin-media" source="npm" spec="~2.2.0" />

                      <plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />

                      <plugin name="cordova-plugin-splashscreen" source="npm" spec="~3.2.1" />

                      <plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.2" />

                      <plugin name="cordova-plugin-vibration" source="npm" spec="~2.1.0" />

                      <plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />

                      <platform name="android">

                   

                   

                  <icon density="ldpi" src="www/res/icon/android/drawable-ldpi-icon.png" />

                          <icon density="mdpi" src="www/res/icon/android/drawable-mdpi-icon.png" />

                          <icon density="hdpi" src="www/res/icon/android/drawable-hdpi-icon.png" />

                          <icon density="xhdpi" src="www/res/icon/android/drawable-xhdpi-icon.png" />

                          <icon density="xxhdpi" src="www/res/icon/android/drawable-xxhdpi-icon.png" />

                          <icon density="xxxhdpi" src="www/res/icon/android/drawable-xxxhdpi-icon.png" />

                          <splash density="land-ldpi" src="www/res/screen/android/drawable-land-ldpi-screen.png" />

                          <splash density="land-mdpi" src="www/res/screen/android/drawable-land-mdpi-screen.png" />

                          <splash density="land-hdpi" src="www/res/screen/android/drawable-land-hdpi-screen.png" />

                          <splash density="land-xhdpi" src="www/res/screen/android/drawable-land-xhdpi-screen.png" />

                          <splash density="land-xxhdpi" src="www/res/screen/android/drawable-land-xxhdpi-screen.png" />

                          <splash density="land-xxxhdpi" src="www/res/screen/android/drawable-land-xxxhdpi-screen.png" />

                          <splash density="port-ldpi" src="www/res/screen/android/drawable-port-ldpi-screen.png" />

                          <splash density="port-mdpi" src="www/res/screen/android/drawable-port-mdpi-screen.png" />

                          <splash density="port-hdpi" src="www/res/screen/android/drawable-port-hdpi-screen.png" />

                          <splash density="port-xhdpi" src="www/res/screen/android/drawable-port-xhdpi-screen.png" />

                          <splash density="port-xxhdpi" src="www/res/screen/android/drawable-port-xxhdpi-screen.png" />

                          <splash density="port-xxxhdpi" src="www/res/screen/android/drawable-port-xxxhdpi-screen.png" />

                      </platform>

                      <platform name="ios">

                          <icon height="57" platform="ios" src="www/res/icon/ios/icon.png" width="57" />

                          <icon height="114" platform="ios" src="www/res/icon/ios/icon@2x.png" width="114" />

                          <icon height="40" platform="ios" src="www/res/icon/ios/icon-40.png" width="40" />

                          <icon height="80" platform="ios" src="www/res/icon/ios/icon-40@2x.png" width="80" />

                          <icon height="50" platform="ios" src="www/res/icon/ios/icon-50.png" width="50" />

                          <icon height="100" platform="ios" src="www/res/icon/ios/icon-50@2x.png" width="100" />

                          <icon height="60" platform="ios" src="www/res/icon/ios/icon-60.png" width="60" />

                          <icon height="120" platform="ios" src="www/res/icon/ios/icon-60@2x.png" width="120" />

                          <icon height="180" platform="ios" src="www/res/icon/ios/icon-60@3x.png" width="180" />

                          <icon height="72" platform="ios" src="www/res/icon/ios/icon-72.png" width="72" />

                          <icon height="144" platform="ios" src="www/res/icon/ios/icon-72@2x.png" width="144" />

                          <icon height="76" platform="ios" src="www/res/icon/ios/icon-76.png" width="76" />

                          <icon height="152" platform="ios" src="www/res/icon/ios/icon-76@2x.png" width="152" />

                          <icon height="29" platform="ios" src="www/res/icon/ios/icon-small.png" width="29" />

                          <icon height="58" platform="ios" src="www/res/icon/ios/icon-small@2x.png" width="58" />

                          <icon height="87" platform="ios" src="www/res/icon/ios/icon-small@3x.png" width="87" />

                          <splash height="1136" platform="ios" src="www/res/screen/ios/Default-568h@2x~iphone.png" width="640" />

                          <splash height="1334" platform="ios" src="www/res/screen/ios/Default-667h.png" width="750" />

                          <splash height="2208" platform="ios" src="www/res/screen/ios/Default-736h.png" width="1242" />

                          <splash height="1242" platform="ios" src="www/res/screen/ios/Default-Landscape-736h.png" width="2208" />

                          <splash height="1536" platform="ios" src="www/res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />

                          <splash height="768" platform="ios" src="www/res/screen/ios/Default-Landscape~ipad.png" width="1024" />

                          <splash height="2048" platform="ios" src="www/res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />

                          <splash height="1024" platform="ios" src="www/res/screen/ios/Default-Portrait~ipad.png" width="768" />

                          <splash height="960" platform="ios" src="www/res/screen/ios/Default@2x~iphone.png" width="640" />

                          <splash height="480" platform="ios" src="www/res/screen/ios/Default~iphone.png" width="320" />

                      </platform>

                      <platform name="wp8">

                          <icon height="99" platform="wp8" src="www/res/icon/wp8/ApplicationIcon.png" width="99" />

                          <icon height="159" platform="wp8" src="www/res/icon/wp8/Background.png" width="159" />

                          <splash height="1280" platform="wp8" src="www/res/screen/wp8/screen-portrait.jpg" width="768" />

                      </platform>

                      <platform name="windows">

                          <icon height="150" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-100.png" width="150" />

                          <icon height="30" platform="windows" src="www/res/icon/windows/Square30x30Logo.scale-100.png" width="30" />

                          <icon height="50" platform="windows" src="www/res/icon/windows/StoreLogo.scale-100.png" width="50" />

                          <splash height="300" platform="windows" src="www/res/screen/windows/SplashScreen.scale-100.png" width="620" />

                          <icon height="120" platform="windows" src="www/res/icon/windows/StoreLogo.scale-240.png" width="120" />

                          <icon height="44" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-100.png" width="44" />

                          <icon height="106" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-240.png" width="106" />

                          <icon height="70" platform="windows" src="www/res/icon/windows/Square70x70Logo.scale-100.png" width="70" />

                          <icon height="71" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-100.png" width="71" />

                          <icon height="170" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-240.png" width="170" />

                          <icon height="360" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-240.png" width="360" />

                          <icon height="310" platform="windows" src="www/res/icon/windows/Square310x310Logo.scale-100.png" width="310" />

                          <icon height="150" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-100.png" width="310" />

                          <icon height="360" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-240.png" width="744" />

                          <splash height="1920" platform="windows" src="www/res/screen/windows/SplashScreenPhone.scale-240.png" width="1152" />

                      </platform>

                   

                   

                   

                  <!-- Wildcards are allowed for the protocol, as a prefix

                       to the host, or as a suffix to the path -->

                  <allow-navigation href="*://*.mysite/*" />

                  <allow-navigation href="http://*/*" />

                  <allow-navigation href="https://*/*" />

                  <allow-navigation href="data:*" />

                   

                  <!-- The above is equivalent to these three declarations -->

                   

                  <allow-navigation href="http://*/*" />

                  <allow-navigation href="https://*/*" />

                  <allow-navigation href="data:*" />

                   

                  <access origin="*://*.googleapis.com/*" subdomains="true" />

                  <access origin="*://*.gstatic.com/*" subdomains="true" />

                  <access origin="*://*.google.com/*" subdomains="true" />

                  <access origin="*://*.googleusercontent.com/*" subdomains="true" />

                      <allow-intent href="http://*/*" />

                      <allow-intent href="https://*/*" />

                      <allow-intent href="tel:*" />

                      <allow-intent href="sms:*" />

                      <allow-intent href="mailto:*" />

                      <allow-intent href="geo:*" />

                      <platform name="android">

                          <allow-intent href="market:*" />

                      </platform>

                      <platform name="ios">

                          <allow-intent href="itms:*" />

                          <allow-intent href="itms-apps:*" />

                      </platform>

                  </widget>

                  • 6. Re: My Phonegap app is redirected to annoying isp page,help
                    jcesarmobile_ Adobe Community Professional

                    You have multiple

                    <allow-intent href="http://*/*" />

                    <allow-intent href="https://*/*" />

                     

                    You have to remove all those

                    • 8. Re: My Phonegap app is redirected to annoying isp page,help
                      amow31609571 Level 1

                      hi i removed the intents above also i have put this as csp on my index page

                      <meta http-equiv="Content-Security-Policy"

                      content="default-src 'self' https://*.mysite;

                                    script-src 'unsafe-inline'

                                 script-src 'self' https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js">

                      when i open app scripts are not loading and css

                      neither remote page..i guess iam still trying to understand how works...can please help.

                      • 9. Re: My Phonegap app is redirected to annoying isp page,help
                        jcesarmobile_ Adobe Community Professional

                        Sorry, wrong copy/paste

                         

                        You have multiple

                         

                         

                        <allow-navigation href="http://*/*" />

                        <allow-navigation href="https://*/*" />

                         

                        remove all those and only keep the <allow-navigation href="*://*.mysite/*" />
                        But allow-navigation is for page navigation, XHR calls are handled by access tags and you don't have any for allowing connections other than google sites, are you sure you provided the right config.xml and didn't forgot any access tag?

                        • 10. Re: My Phonegap app is redirected to annoying isp page,help
                          amow31609571 Level 1

                          Hi thank you so much ...am really making progress especially after you mentioned csp

                          i removed tags,

                          i also played around with csp

                          <meta http-equiv="Content-Security-Policy" content="default-src 'self' http://*.mysite http://mysite.com/php  data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline';style-src 'self'https://fonts.googleapis.com/icon?family=Material+Icons;img-src https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css 'self' http://mysite.com/ data:; script-src 'self' 'unsafe-inline'; media-src *;style-src 'self' 'unsafe-inline'">

                           

                          However

                          google map script  not working  nor when i upload a pic it doesn't show up in div