×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    15

    openURL for SMS & Email

    hi,

    I am now using openURL for SMS & Email, the main reason is that the user could access his own address book more easily (And for the fact that there is no API from WRT for sending emails.)

    However, each time openURL is called there is an empty browser remained, and the user needs to close the browser before going back to the program.

    Just wonder if there is any way to automatically close that browser?

    Any help is appreciated!

    Thanks a lot


    have a nice day
    walty

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: openURL for SMS & Email

    Hello,

    I don't know if the empty browser window can be avoided when using openURL, but there is a workaround to launch just the editor by using the anchor tag.

    The following code will also include the text written into the input field as message body.
    Code:
    <input type="text" id="smsText"/>
    <a href="sms:" id="msglinkII" onclick="sendSMS();">Send Message</a>
    and then in Javascript side modify the href -attribute on the fly
    Code:
    function sendSMS(){	
     var msglink = document.getElementById("msglinkII");
     var message =document.getElementById("smsText").value;
     msglink.setAttribute("href","sms:First Last<+1234567890>?body="+message);
    }
    Hope these help

    -Ilkka

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    15

    Re: openURL for SMS & Email

    thx isalento, that works.

    I guess the key is to use direct URL transfer instead of "openURL", so one less browser would be required (and when user closes the editor, they could still fall back to the previous page).

    I fact I found that, using "window.location='sms:xxxx'" will also do the trick

    Thanks.

    have a nice day
    walty


    Quote Originally Posted by isalento View Post
    Hello,

    I don't know if the empty browser window can be avoided when using openURL, but there is a workaround to launch just the editor by using the anchor tag.

    The following code will also include the text written into the input field as message body.
    Code:
    <input type="text" id="smsText"/>
    <a href="sms:" id="msglinkII" onclick="sendSMS();">Send Message</a>
    and then in Javascript side modify the href -attribute on the fly
    Code:
    function sendSMS(){	
     var msglink = document.getElementById("msglinkII");
     var message =document.getElementById("smsText").value;
     msglink.setAttribute("href","sms:First Last<+1234567890>?body="+message);
    }
    Hope these help

    -Ilkka

  4. #4
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: openURL for SMS & Email

    Hi,
    I try to use window.location for starting the SMS-Editor with a prefilled body. My code:
    Code:
    function sendSMS(){	
       var message = "sms:?body="+escape(document.getElementById("url_field").value);
       window.location = message;
       alert("Composing SMS.")
    }
    The function is called by an "onclick"-event on a button.
    Without the alert, the editor does not start.

    When I close the editor, another one pops up having the encoded url_field ("?url_field=....") in the "TO" box. Why? I don't get it.

    Any better solution to start the Editor without a filled TO-field, without the alert and without a second editor?

    Thx!

  5. #5
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: openURL for SMS & Email

    Code:
    function sendSMS(){	
     var message = "sms:?body="+escape(document.getElementById("url_field").value);
     window.location = message;
     alert("Composing SMS.")
    }
    This function is called by a button onclick. Without the "alert" the editor does not open. After closing the editor another one pops up with the encoded url_field in the "TO"-field (?url_field=blub....).

    How can I avoid the use of Alert and the second editor?
    Testing device is a Nokia E5.

    Bye

Similar Threads

  1. How to Close built in Email Client Application
    By om.prakash in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2008-11-26, 08:05
  2. Checking for new email
    By smileyyhl in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2008-06-12, 09:03
  3. 6300: Email client disappeared.
    By mcdj in forum General Development Questions
    Replies: 1
    Last Post: 2007-06-20, 21:14
  4. email mtm help is needed
    By siemensc55 in forum Symbian
    Replies: 0
    Last Post: 2004-07-18, 18:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×