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
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ
Accepted Solution

Incoming/Outgoing call phone number, Phone log listener?

Yes. There is a object phone exists, there is a signal onCallUpdated. But how to retrieve phone number?

 

Another question - in BBOS has been PhoneLogListener object. I can't find alternative in new BB10. How to access to the Phone Log?

Please use plain text.
Developer
simon_hain
Posts: 15,944
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Incoming/Outgoing call phone number, Phone log listener?

the phone number is linked in the line object, you could get it by using sender() on the event i think (to get the phone object and query that).

i don't think phonelogs are available as an api yet, but i would not mind to be proved wrong :smileyhappy:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Incoming/Outgoing call phone number, Phone log listener?

Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Incoming/Outgoing call phone number, Phone log listener?

Can you provide example?

 

void TestPhone::onCallUpdated(const bb::system::phone::Call &call) {
	m_CallState = 0;
    CallState::Type state = call.callState();

    if(state ==  CallState::Incoming )
    {
    	m_CallState = 1;
    }
    emit callStateChanged();
}

 

Please use plain text.
Developer
simon_hain
Posts: 15,944
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Incoming/Outgoing call phone number, Phone log listener?

you can access the sender of a signal by calling sender(), in your case that would be the Phone class i guess.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Incoming/Outgoing call phone number, Phone log listener?

Thanks! Found it!!!

 

Works! :smileyhappy:

Please use plain text.
Developer
smiley
Posts: 1,434
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Incoming/Outgoing call phone number, Phone log listener?

Does is give you the caller phone number or just the line number of your own phone?


Please use plain text.
Contributor
danguito
Posts: 17
Registered: ‎09-05-2012
My Device: 9780 Bold
My Carrier: Bouygues Telecom

Re: Incoming/Outgoing call phone number, Phone log listener?

Hello, with the phone object, i can only get my own number with:

Phone phone;
phone.activeLine().description();

 What did you do to get the caller number or the number called?

Thanks

Please use plain text.
Developer
StevenKader
Posts: 635
Registered: ‎02-03-2010
My Device: Z10 LE
My Carrier: Rogers

Re: Incoming/Outgoing call phone number, Phone log listener?


AlexXF wrote:

Thanks! Found it!!!

 

Works! :smileyhappy:


Would you mind sharing the code to get the phone number of the person who called....haven't figured out how to that yet.  Thanks.


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Please use plain text.
New Member
yvalensi
Posts: 4
Registered: ‎04-01-2013
My Device: blackberry z10
My Carrier: bouygues

Re: Incoming/Outgoing call phone number, Phone log listener?

Alex, do you ses the number you calcul or your own number?
Please use plain text.