8 Replies Latest reply on Dec 11, 2014 5:06 PM by Mark Nongkhlaw

    Any workarounds/patches for SMS, Call, Email for WP?

    Mark Nongkhlaw

      I have code in my erb like :

       

            <li><a href="sms:+919863022351">SMS the Developer</a></li>

            <li><a href="tel:+919863022351">Call the Developer</a></li>

            <li><a href="mailto:someone@somewhere.com?subject=Mobile%20App%20Feedback">Email the Developer</a></li>

       

      However, none of the above work in WP. Are there any workarounds (in Ruby/JS)?

        • Re: Any workarounds/patches for SMS, Call, Email for WP?
          Kutir Mobility

          This issue needs help from Motorola. We will raise this issue with them to get an answer. Visnupriya R Kutir Mobility

          • Re: Any workarounds/patches for SMS, Call, Email for WP?
            Robert Galvin

            Mark This is a limitation of the Webview control that is implemented on WP. You would essentially have to HiJack the click handler for all A tags, parse it for the sms: tel:, mailto:  content and then do a native extension for executing that functionality.

            1 of 1 people found this helpful
              • Re: Any workarounds/patches for SMS, Call, Email for WP?
                Mark Nongkhlaw

                Hi Rob,

                 

                Not sure about Webview, but the framework is IE and Ive seen instances when certain number formats on web pages viewed thru IE invoke Skype when clicked on. Additionally, all these anchors work in WM with IE as the Webview framework (albeit an older version).

                 

                Can we assume then that support for these features have actually deteriorated, not improved?

                • Re: Any workarounds/patches for SMS, Call, Email for WP?
                  Mark Nongkhlaw

                  Alternatively, can we bypass the limitation of the Webview using meta tags in the header of the page (.erb)?

                    • Re: Any workarounds/patches for SMS, Call, Email for WP?
                      Mark Nongkhlaw

                      Is WebView control required at all for this? I tried putting code in the controller instead, like :

                       

                      require 'rho/rhocontroller'

                       

                       

                      class CustomUriController < Rho::RhoController

                        @layout = :simplelayout

                       

                        def index

                          render :back => '/app' 

                        end

                       

                        def send_sms

                          WebView.navigate( 'sms:+1222333444' )

                          render :action => :index

                        end

                       

                       

                        def send_call

                          WebView.navigate( 'tel:+1222333444' )

                          render :action => :index

                        end

                       

                        def send_mail

                          WebView.navigate( 'mailto:test@host.com' )

                          render :action => :index

                        end

                         

                        def open_external_url

                          System.open_url('http://www.rhomobile.com')

                          redirect :action => :index

                        end

                      end

                       

                      Unfortunately, above also does not work in WP. Does it mean this feature(s) is unsupported in WP? If yes, kindly update the API Compatibility matrix

                        • Re: Any workarounds/patches for SMS, Call, Email for WP?
                          Jon Tara

                          To clarify some terminology:

                           

                          WebView is a Rhodes class that is a wrapper for the native "webview".

                           

                          "webview",  is a generic term for an embedded browser control. For example, iOS has UIWebView. Other OSs call it something different.

                           

                          No hybrid app environment uses the actual mobile browser. They all use some sort of embeddable control, which is typically does NOT have exactly the same capabilities as the system browser on the same device.

                           

                          Just as a UIWebView is not Mobile Safari, a WM webview (whatever Microsoft calls it) is not IE.

                           

                          While Safari is a good "mule" for testing some HTML/CSS/JS code you are going to use in a Rhodes iOS app, and IE is a good mule for testing some HTML/CSS/JS code you are going to use in a Rhodes WM project, you should not assume that they are exactly equivalent, and final testing always has to be done on a real device or simulator (e.g. from Apple, Microsoft, etc.)

                           

                          What Rob is suggesting is that you would use a native extension for this functionality. The Rhodes WebView.navigate just passes the URL to the native webview. If the native webview can't do it, the native webview can't do it, and so you need to implement it using other native APIs that provide the functionality that you want.

                           

                          It "would be nice" if Rhodes would support this functionality transparently.

                            • Re: Any workarounds/patches for SMS, Call, Email for WP?
                              Mark Nongkhlaw

                              Thank you, Jon for the insights on 'WebView' and 'webview'. Ok, so there's a limitation to the IE WebView. Some more questions :

                               

                              1. Can not this limitation be addressed in a SP release or future release of RMS ? Maybe other WP issues could also be addressed then?

                               

                              2. Can Moto Webkit be used in WP 7 and/or 8 and if yes, how and will it solve this problem?

                               

                              3. Can we pass control to the 'mule' from a controller and let the 'mule' take care of it? Not sure if intents work this way or if they work at all in WP. I guess not.

                               

                              4. If we are to write a native extension for such functionality, where do we start and how do we go about it?

                            • Re: Any workarounds/patches for SMS, Call, Email for WP?
                              Jon Tara

                              I noticed something above that has nothing to do with your problem, though: when you use WebView.navigate don't render or redirect. Neither one make sense, since you've ALREADY told the WebView to navigate away. If you render, it will be for naught - the server will send content that will just be ignored. If you redirect, the redirect will be ignored.


                              System.open_url() is OS-dependant. It will open either the system browser (external to your app) or some specific other application, depending on the URL. Different OSs might support different applications. e.g. mail, telephone, SMS, etc. and send your app to background. This typically has nothing to do with the (small "w") webview. It's implemented through native code on each platform that can be used to open apps using a URL scheme. While TYPICALLY the OS might enable the use of URLs within a webview to access the same set of apps, that's not always the case with every webview control on every OS.


                              Don't use either render or redirect here, either, unless you actually want to change pages (which the user won't notice until they switch-back to your app.) If you do nothing, when they switch back to your app, they will be looking at the same page as when they clicked the link, unchanged.