Search code examples
tizentizen-web-app

Launching messaging application with body text in tizen web app


I am developing tizen web applicatin.In that application there is a option like share application through message.I am able to open messaging app by using appcontrol but i am unable to pass the text as message body.Is there anyway to pass the text to messaging app.i've searched all tizen api's and found we can pass files as data to other applications but couldn't find passing text as data.

I'm using tizen appcontrol to launch the application,actually you can pass the data while using that appcontrol like below piece of code.

var appControl =  new tizen.ApplicationControl(
    "http://tizen.org/appcontrol/operation/share",
    "shareimage.html",
    "image/*",
     null,
    [new tizen.ApplicationControlData("images", [imagedata1, imagedata2])] ); 

//Explicit launch with control data
tizen.application.launchAppControl( appControl, "3lqX1bKgbi.ServiceApp",
function() {console.log("launch application control succeed"); },
function(e) {console.log("launch application control failed. reason: " + e.message); },
appControlReplyCallback );

But above code is for passing image files,i tried to pass the text like below

var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/share",null,"text/*",null ,[new tizen.ApplicationControlData("text", [message])]);
tizen.application.launchAppControl(appControl, null,function()console.log("launch application control succeed");},           function(e) {alert("ERROR")});

but it's not working.

Any help would be appreciated.Thanks in advance


Solution

  • You can do this with a simple html content using anchor tag.

    <a href="sms:?body=Hello'>Share<a/>
    

    Above code will open the message application with a predefined message.