1

Is there a way to redirect user from web page to sms editor with a time delay? Something like this:

function Redirect() {
           window.location="http://www.tutorialspoint.com";
        }

        document.write("You will be redirected to main page in 10 sec.");
        setTimeout('Redirect()', 10000);

only instead of the "http://www.tutorialspoint.com" using "sms:?body=Hello world" for example?

Aleksa
  • 31
  • 5
  • This might help http://stackoverflow.com/questions/10172499/mailto-using-javascript –  Aug 16 '15 at 20:46
  • @Locercus I've tried but it's not working with "sms:", just with "mailto:". – Aleksa Aug 17 '15 at 15:52
  • Correction: it's actually not working just in Chrome. – Aleksa Aug 17 '15 at 16:09
  • That might be a feature/bug in Chrome. See http://superuser.com/questions/451350/chrome-doesn-t-handle-custom-protocols-correctly –  Aug 17 '15 at 16:58

1 Answers1

0

After a few tests on different browsers, I've came out with this:

function Redirect() {
       window.location.href="sms:?body=Hello world";
    }

    document.write("You will be redirected to main page in 10 sec.");
    setTimeout('Redirect()', 10000);

This is working in Android but I guess it could be modified to work with IOS also. Please notice: sms:& for iOS 8, sms:; for iOS 5,6 and sms:? for Android.

Aleksa
  • 31
  • 5