10 Replies Latest reply on Jan 25, 2017 11:47 AM by dmatafonov

    Phonegap IOS tel: link doesnt work

    dmatafonov Level 1

      Hi all,

       

      My app uses href: tel links and it worked correctly, when I first released it a year ago.

       

      I used allow-intent in my config.xml:

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

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

       

      But now freshly compiled app for iOS with the same config doesnt work with href: tel links. Just nothing happens.

       

      As said here: cordova - Why tel:* links don't work on ios? - Stack Overflow

      I need to remove allow-navigation from config.xml. But I dont have it there.

       

      Should allow-intent be removed as well? What is the proper configuration to make it work under new cordova?

        • 1. Re: Phonegap IOS tel: link doesnt work
          dmatafonov Level 1

          Added everything else what I could think of, still no effedt. Anyone?

           

          <access origin="*"/>
          <access origin="tel:*" launch-external="yes"/>
          <access origin="sms:*" launch-external="yes"/>

          <plugin name="cordova-plugin-whitelist"/>
          <allow-intent href="http:///"/>
          <allow-intent href="https:///"/>
          <allow-intent href="tel:*"/>
          <allow-intent href="sms:*"/>
          <allow-intent href="mailto:*"/>
          <allow-intent href="geo:*"/>

          • 2. Re: Phonegap IOS tel: link doesnt work
            VectorP Level 4

            Perhaps the problem is not caused by something in your config, but by something else. Hard to say without seeing your app's code.

            For instance:

            - are you putting any event handler on the link's click event?

            - does the problem occur in all iOS versions, or just in one of them?

            - are you sure the hyperlinks with the 'tel:' url are syntactically correct?

            • 3. Re: Phonegap IOS tel: link doesnt work
              dmatafonov Level 1

              - are you putting any event handler on the link's click event?

               

              No, I dont. Not only tel or sms links STOPPED working, but ANY links - to external websites as well.

              I user visits mobile site which is actually the same as app, all links do works. And since my first build I've changed nothing about those links, they worked and now dont. Something deffinetly changed in cordova.

               

              - does the problem occur in all iOS versions, or just in one of them?

               

              Any

               

              - are you sure the hyperlinks with the 'tel:' url are syntactically correct?

               

              Yes, I'm sure - they do work on mobile site and android app.

              • 4. Re: Phonegap IOS tel: link doesnt work
                kerrishotts Adobe Community Professional

                Couple of thoughts:

                 

                • Are you including cordova.js or phonegap.js in your HTML file?
                • Do you have a content security policy meta tag? If so, what does it look like?
                • What other plugins do you have installed in the app?
                • 5. Re: Phonegap IOS tel: link doesnt work
                  dmatafonov Level 1

                  - Are you including cordova.js or phonegap.js in your HTML file?

                   

                  Of course, otherwise app wouldnt work at all, would it?

                   

                  - Do you have a content security policy meta tag? If so, what does it look like?

                   

                  I do have it in index.html and it was not changed since working release:

                  <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://drink-baikal.com"/>

                   

                   

                  - What other plugins do you have installed in the app

                   

                  I have only three plugins:

                  cordova-plugin-statusbar

                  phonegap-plugin-push

                  cordova-plugin-whitelist

                   

                  And permissions:

                  <preference name="permissions" value="none"/>

                  <preference name="orientation" value="default"/>

                  <preference name="target-device" value="universal"/>

                  <preference name="fullscreen" value="false"/>

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

                  <preference name="prerendered-icon" value="true"/>

                  <preference name="stay-in-webview" value="false"/>

                  <preference name="ios-statusbarstyle" value="black-opaque"/>

                  <preference name="detect-data-types" value="true"/>

                  <preference name="exit-on-suspend" value="false"/>

                  <preference name="show-splash-screen-spinner" value="true"/>

                  <preference name="auto-hide-splash-screen" value="true"/>

                  <preference name="disable-cursor" value="false"/>

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

                  <preference name="android-installLocation" value="auto"/>

                  <preference name="android-build-tool" value="gradle" />

                  <preference name="StatusBarOverlaysWebView" value="false" />

                  <preference name="StatusBarStyle" value="lightcontent" />

                  <preference name="StatusBarBackgroundColor" value="#0d8ccc" />

                  • 6. Re: Phonegap IOS tel: link doesnt work
                    VectorP Level 4

                    Not only tel or sms links STOPPED working, but ANY links

                    Now, this is totally new information. You never mentioned that at first, and you made it appear to be a "tel:" link problem.

                     

                    So, your hyperlinks "don't work".

                    - Have you checked if the click event was fired on those links when tapped?

                    - Since this is no normal or new behaviour, I am quite sure that something is not compatible anymore at your end. Is your PGB zip file available online somewhere, so forum participants can have a look and offer help?

                     

                    Something deffinetly changed in cordova.

                    Since your last release, a year ago? Yes, of course things changed. A lot changed. Most of it is documented in the Cordova/Phonegap Blog.

                     

                     

                    • 7. Re: Phonegap IOS tel: link doesnt work
                      dmatafonov Level 1

                      Here is the app:

                       

                      https://drink-baikal.com/www.zip

                       

                      Since your last release, a year ago? Yes, of course things changed. A lot changed. Most of it is documented in the Cordova/Phonegap Blog.

                      Last week all that I'm doing  - it is reading blogs and googling about what changed that prohibits regular behavior. No luck yet. On stackoverflow I offer 50 reputation for an advise, but still zero tryies.

                      Tel:* and Sms:* links don't work on ios under cordova in phonegap? - Stack Overflow

                       

                      - Have you checked if the click event was fired on those links when tapped?

                      No, I'll check. Thank for an idea. May be there is programmable way of opening the dialer is iOS with some kind of plugin?

                      • 8. Re: Phonegap IOS tel: link doesnt work
                        VectorP Level 4

                        That https-link above returns a server error.

                        However, I get the file when using http://

                         

                        Here's some feedback to your config:

                        1. (unrelated): you may want to delete the phonegap.com references in the author element

                        2. the /www directory of your zip file is superfluous. I recommend removing it. Have index and config in your zip's root!

                        3. In order to allow for regular links to show content in the webview (which is not recommended) use

                        <allow-navigation href="*" />

                        This can be limited to certain domains later.

                        4. (unrelated) You are missing a whole bunch of iOS splashscreens, which may lead to inability to publish and incorrect scaling on several devices.

                         

                        To your index.html:

                        You are using a collection of javascript libraries which eventually set up your page content. I haven't checked all those scripts. However, may I recommend to test with an index.html without all those libraries and with just a hyperlink and a tel: link in the html source (directly). Nothing more.

                        See if that mini-index.html displays and "works" as expected. That way, you would at least have a hint about where to isolate trouble.

                         

                         

                         

                        • 9. Re: Phonegap IOS tel: link doesnt work
                          dmatafonov Level 1

                          VectorP thanks for digging in. Here is what else I've found.

                          I've decided to check if links will work if I disable all js scripts and make simple index.html with just two links, as you advised.

                           

                          Ok, I ve the app, compiled it at build.phonegap.com for my iphone with my provisioning key (Id dont know may be it matters?).

                          It worked!

                           

                          OK, then I decided to keep digging. I installed the phonegap for desktop (windows) and downloaded phonegap app from appstore.

                          I started server, and found out that all links work as expected in phonegap app without removing ANY of js.

                          So, actually the same code works properly in local phonegap app, but does not work when compiled and released through appstore.

                           

                          Here is what I see in PhoneGap log:

                           

                          I have no idea what it means, but I see that desktop phonegap adds some Content Security Policies.

                          But I do have them in my index.html - could it be the issue?

                           

                          Now I even more confused. Why does it work in phonegap app but doesnt in released app?

                          • 10. Re: Phonegap IOS tel: link doesnt work
                            dmatafonov Level 1

                            I found the solution. Actually bought it at stackoverflow

                             

                            I added this to my config.xml and now it works.

                            <preference name="phonegap-version" value="cli-6.4.0" />

                             

                            So the problem is 6.3.0 version, which is build.phonegap.com default.