Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 83
Registered: ‎06-20-2013
My Device: Blackberry 10
My Carrier: idea

Getting signal for sms sent

hello,

Can we get a signal for  "Message Sent" as we get for Message received (MessageAdded signal).....im trying to develop an app which gets notified every time a sms is sent from my device...

 

Any help would be appreciable...

 

Thanks

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Getting signal for sms sent

I believe the best you can currently do at the moment is have a background app read the messages and report to your app when changed.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Getting signal for sms sent

If you are in control of the sms you can use a trigger...

 

http://developer.blackberry.com/native/documentation/cascades/device_platform/headless_apps/triggers...


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 237
Registered: ‎05-21-2012
My Device: BlackBerry RED Z10
My Carrier: WiFi

Re: Getting signal for sms sent

Hi. You can do it with this. Add a signal to the onMessageAdded or onMessageUpdated (which listens to any sms coming in your HUB)

 

// this is the connection to the signal
connect(
			m_messageService,
			SIGNAL(messageAdded(bb::pim::account::AccountKey, bb::pim::message::ConversationKey, bb::pim::message::MessageKey)),
			SLOT(onMessageAdded(bb::pim::account::AccountKey, bb::pim::message::ConversationKey, bb::pim::message::MessageKey))
		)

// this is the slot to the signal
void ApplicationUI::onMessageAdded(bb::pim::account::AccountKey accountId, bb::pim::message::ConversationKey conversationId, bb::pim::message::MessageKey messageId)
{
	Message message = m_messageService->message(accountId, messageId);

		if(message.isSent() && (message.transmissionStatus() == MessageTransmissionStatus::Sent))
		{
			// message sent
		}
		else if(message.transmissionStatus() == MessageTransmissionStatus::FailedToSent)
		{
			// message failed to send
		}
}

 

I hope this helps. Smiley Happy

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Getting signal for sms sent

Your app would of course have to be running all the time (or headless) to use the MessageService.

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.