×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    20

    Background SMS Send s60 3rd Ed

    Hi, anybody knows how i can send SMS in the background without the editor?
    Passing the TBool aLaunchEditorEmbedded as ETrue/False into CSendUi::CreateAndSendMessageL() dosent seem to make a difference

    Thanks!

  2. #2
    Registered User
    Join Date
    Oct 2003
    Posts
    13

    Re: Background SMS Send s60 3rd Ed

    You should be able to send SMS in the background with SendAs API that is provided by RSendAs and RSendAsMessage classes.

    Sending a message is done using e.g. RSendAsMessage::SendMessageAndCloseL(). The caller must hold sufficient capabilities to perform this action.

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    20

    Question Re: Background SMS Send s60 3rd Ed

    ic, thanks for the help! :)

    hmm..i've looked at the RSendAsMessage class but not quite sure how to begin. I know i've got to first start a RSendAs session first..but from then onwards??? Couldnt find any examples or thread on any forum either besides this one either. Anybody got any ideas/clues/hints/code(:)) to share?

    Thanks!
    Last edited by jamespoh; 2006-02-02 at 07:46.

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    21

    Re: Background SMS Send s60 3rd Ed

    Hello,

    Hope this helps. I just wrote it and seems to work.

    RSendAs sendAs;
    User::LeaveIfError(sendAs.Connect());
    CleanupClosePushL(sendAs);

    RSendAsMessage sendAsMessage;
    sendAsMessage.CreateL(sendAs, KUidMsgTypeSMS);
    CleanupClosePushL(sendAsMessage);

    // prepare the message
    sendAsMessage.AddRecipientL(aRecipient, RSendAsMessage::ESendAsRecipientTo);
    sendAsMessage.SetBodyTextL(aMessageBody);

    // send the message
    sendAsMessage.SendMessageAndCloseL();

    // sendAsMessage (already closed)
    CleanupStack::Pop();

    // sendAs
    CleanupStack::PopAndDestroy();

  5. #5
    Registered User
    Join Date
    Mar 2004
    Posts
    21

    Re: Background SMS Send s60 3rd Ed

    Hello,

    Does anybody have some code for getting notified when an incomming SMS comes?

    Thank you!

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Background SMS Send s60 3rd Ed

    Quote Originally Posted by mantonenco
    Does anybody have some code for getting notified when an incomming SMS comes?
    Yes. You can create a CMsvSession, and the supplied observer will get notifications (EMsvEntriesCreated and EMsvEntriesChanged events occuring in the Inbox with messages of SmsMtm usually mean that an SMS has just arrived). Check other SMS-related threads for further information and examples.

  7. #7
    Registered User
    Join Date
    Mar 2004
    Posts
    21

    Re: Background SMS Send s60 3rd Ed

    I made in that way that I have a strange problem: I do not get the notification always.
    I do not understand why.

  8. #8
    Registered User
    Join Date
    Mar 2004
    Posts
    21

    Re: Background SMS Send s60 3rd Ed

    I found the problem. Thanks wizard_hu_. The problem was that I was expecting only the EMsvEntriesCreated event on Inbox. Note for other people that run into the same problem: also EMsvEntriesChanged events occuring on Inbox may mean that an SMS has just arrived.

  9. #9
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Background SMS Send s60 3rd Ed

    hi,

    the code works fine to send sms..but the issue i face is that it asks the user for confirmation b4 sendin the sms...i believe that there is some security issue...can somone please clarify on that..

    basically i want to send sms/email through my code without asking the user for anything...everything should happen in te background...

    for email i change the mtm uid to the smtp type..but it crashes at that line....wonder why though

    cheers
    mayank

  10. #10
    Registered User
    Join Date
    Oct 2003
    Posts
    13

    Re: Background SMS Send s60 3rd Ed

    Yes, this is a security issue. If your code has the platform security capabilities for sending the SMS, the user is not asked for confirmation.

Similar Threads

  1. to receive and send sms from and to mobile and PC in java
    By manoj_2580 in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2010-10-22, 16:21
  2. Replies: 2
    Last Post: 2007-11-10, 13:19
  3. chinese sms send solution!
    By serverclient2004 in forum General Messaging
    Replies: 0
    Last Post: 2005-06-03, 06:36
  4. Use WiressToolkit2.0 to send SMS to N3650 emulator.
    By akokchai in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-31, 08:46
  5. Replies: 1
    Last Post: 2002-07-23, 14:39

Posting Permissions

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