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

Web and WebWorks Development

Reply
Contributor
Posts: 11
Registered: ‎07-30-2012
My Device: 9900
My Carrier: work
Accepted Solution

Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

I am trying to retrieve the phone number from a BB 10 device.  Currently testing with Ripple and the BlackBerry 10 Dev simulator.  I have tried many variations, and when the code runs the result is always that phone is always undefined.  Has anybody succesfully made a call to blackberry.identity.phone.getLineIds() or blackberry.identity.phone.getLineNumber()? 

If so, would you post the config.xml and the code that you used to get this working?

 

I've seen this post, and I tried the sample code that is supposed to work, but i can' t get the listed code working.

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/blackberry-identity-phone-doesn-...

 

 

Retired
Posts: 203
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

Hi,

 

That API is not supported on BB10 (only BBOS).

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Contributor
Posts: 11
Registered: ‎07-30-2012
My Device: 9900
My Carrier: work

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

Thanks for the quick reply.  That would explain why it doesn't work.  The other post was a little misleading.  Is there any way to get the phone number on one of these devices?

Visitor
Posts: 1
Registered: ‎05-02-2013
My Device: Limited Edition Z10
My Carrier: o2

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

What about creating a native extension for this ?
Contributor
Posts: 11
Registered: ‎07-30-2012
My Device: 9900
My Carrier: work

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

It's a good idea.  I've never created an extension, but I'm definitely going to look into it.

Trusted Contributor
Posts: 118
Registered: ‎03-06-2013
My Device: Blackberry Z10
My Carrier: Airtel

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

blackberry.pim.contacts webworks api for retrieving the phone number. u might get some clue. please find documentation here:
http://developer.blackberry.com/html5/apis/blackberry.pim.contacts.html
--------
- If a post contains the solution to the problem, please click "Accept as Solution"
- If a post contains helpful content, please give it a "Thumbs Up"

developer.blackberry.com
@BlackBerryDev
Contributor
Posts: 11
Registered: ‎07-30-2012
My Device: 9900
My Carrier: work

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

I have looked through the api for contacts, but I don't see a function for getting the phone number.

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: Retrieving Phone Number from BB 10 Device using blackberry.identity.phone.getLineIds()

I'm accepting bryanhiggins' response as the solution as it answer the question of why blackberry.identity.phone.getLineIds was not working.

 

In terms of retrieving the device's phone number on a BB10 device, there aren't APIs for this as far as I am aware so the custom extension is definitely the best approach for the time being. A good starting point is the Template here:

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10

 


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.