How to Get Sender Phone Number from ReceivedMessage in Tizen

Original Created Aug 24, 2019 | Regeneration Apr 22, 2026

I'm using EventHandlerMessageReceived to receive SMS messages in my Tizen application. While I can successfully read the message content using ReceivedMessage.Text, I'm unable to find a way to retrieve the sender's phone number.

Could you please explain how to get the sender's phone number when using EventHandlerMessageReceived?

Problem Understanding

The user wants to retrieve the sender's phone number from an SMS message received through the EventHandlerMessageReceived event in a Tizen application. While they can access the message content, they need help accessing the sender's information.

Solution Methods

  1. Access the Message object from the event arguments
  2. Use the From property of the Message object to get the sender's address
  3. Extract the phone number from the address information

Code Examples

private void OnMessageReceived(object sender, MessageReceivedEventArgs e)
{
    // Get the received message
    Message receivedMessage = e.ReceivedMessage;
    
    // Get sender's address
    MessagesAddress senderAddress = receivedMessage.From;
    
    // Get sender's phone number
    string senderPhoneNumber = senderAddress.Number;
    
    // Use the phone number as needed
    Console.WriteLine($"Message from: {senderPhoneNumber}");
}

Additional Tips

  • Make sure you have the proper privileges declared in your tizen-manifest.xml file:
<privileges>
    <privilege>http://tizen.org/privilege/message.read</privilege>
    <privilege>http://tizen.org/privilege/message.write</privilege>
</privileges>
  • The From property returns a MessagesAddress object which contains not only the phone number but potentially other address information as well.
  • Always handle cases where the sender information might be null or unavailable.

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.