06-30-2011 02:20 AM
Hi All,
We are creating a Web application which will be hosted on some server, and it will accessed by mobile devices.
I need to get the Device ID of the mobile for authenticating them to access our web page. Is there any way to fetch Blackberry DeviceId using Javascript code
06-30-2011 08:03 AM
Hi
If you are building a webworks app you can do this - alert("PIN: " + blackberry.identity.PIN);
If it is just a html page with javascript, then NO.
Cheers
Andrew
06-30-2011 08:05 AM
Hi
Another method for a NON Webworks app is to add the PIN into the HTTP headers, this can be done by a setting on the BES.
You can then authenticate when the page is requested.
Obviously this will not work for users with BIS.
Cheers
Andrew
07-01-2011 12:59 AM
Hi,
Thanks for your valuable reply,
do i need yo add reference to access the object "blackberry.identity.PIN", when i execute the code on blackberry emulator am not getting any output
I am not using any of Blackberry plugins to my web app, we are just creating a normal website which can accessed through any device[PC/Mobile/Ipod..]
But our clients will open this on Blackberry only [ in far future all mobiles], also we dont give any installer to them, They just type the URL in their BB browser and access this as normal website.
When a user open this app on their Blackberry or any mobile device, we need to get their DeviceId when they login and save them in our DB for our business needs.
07-01-2011 08:55 AM
The only way you would be able to do this in the browser and not a WebWorks app would be using abarber's suggestion of grabbing the PIN from the header of the request IF that functionality is turned on in the BlackBerry Enterprise Server that they are using.
However, that means that the PIN will be sent to every website they visit.
The reason this information is not available through regular JavaScript and is not included in the headers by default is because it is a privacy issue. If you have someone's PIN you can then request them as a contact on BBM etc.