facebook

SMS could not be launched through home screen app

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #318882 Reply

    raed_saud
    Member

    Hi,

    I have two javascript functions, one for placing call and other for sending SMS message they are working fine on emulator and iphone web browser but after adding the app to home screen, the SMS function raises this error ” Cannot Open application name The error was The URL can’t be show”. but tel function works fine.

    any help will be appreciated.

    #318883

    support-michael
    Keymaster

    @raed_saud

    This is a known issue with the iOS mobile safari. Only HTML anchor tags with sms url will launch the iOS messaging application when the webapp is run in standalone mode. We have a workaround for it if a component’s Link property is set to an sms url, e.g., sms:8001234567. Following is the snippet of code from the phoneui.js library from MobiOne. You can see it creates an <a> tag in the DOM, simulates a click of the link and then removes the link.

    if (href.match(/^sms:/i)) {
                // Special processing for SMS URL - they do not work in standalone mode
                // when set directly as window.location.href. So, we're implementing
                // workaround here
                var el = jQuery('<a href="' + href + '" style="position:absolute;"/>')
                    .appendTo(document.body);
                var e = el[0];
                
                var evt = e.ownerDocument.createEvent('MouseEvents');
                evt.initMouseEvent('click', true, true, 
                        e.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
                e.dispatchEvent(evt);
                el.remove();
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: SMS could not be launched through home screen app

You must be logged in to post in the forum log in