×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2004
    Location
    Vienna
    Posts
    321

    IMessaging, TypeError()

    Hi,

    I'm using S60, 5th Edition 0.9 SDK and I'd like to send a short message thru the provided API with the following code

    Initialization of the ServiceObject; works fine
    <code javascript>
    try{
    // get instance from device.
    so = device.getServiceObject("Service.Messaging", "IMessaging");
    }
    catch(ex)
    {
    alert("Error Creating ServiceObject for Messaging:" + ex);
    }
    </code>

    During Sending the MMS I get the 'TypeError: Type Error' expetion; actually the emulator shows the pop-up "MMS sending completed"; changing between sychnroous call or asychn and SMS or SMS do not make a difference.
    <code javascript>
    try{
    // create a new SMS to buy the ticket
    var criteria = new Object();
    criteria.MessageType = "MMS";
    criteria.To = "+43xxxxxx";
    criteria.BodyText = "some String";
    var resultSMS = so.IMessaging.Send(criteria, smsCallBack);
    alert("Result SMS: " + resultSMS);
    }
    catch(ex)
    {
    alert("Error doBuy(): " + ex);
    }
    </code>

    any idea? cheers, geri-m

  2. #2
    Registered User
    Join Date
    Apr 2004
    Location
    Vienna
    Posts
    321

    Re: IMessaging, TypeError()

    okay fixed it; you must NOT do that

    alert("Result SMS: " + resultSMS);

    Instead I do that:

    var result = so.IMessaging.Send(criteria);

    var errCode = result.ErrorCode;

    if (errCode)
    {
    temp.innerHTML += "errCode: " + errCode + "<br />";
    if(resultList.ErrorMessage != undefined)
    temp.innerHTML += "ErrorMessage: " + resultList.ErrorMessage + "<br />";
    }
    else
    temp.innerHTML += "SMS sent!<br />";

Similar Threads

  1. try to get cellid but receive typeerror
    By web_tur in forum Symbian
    Replies: 2
    Last Post: 2007-12-24, 14:09

Posting Permissions

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