Identity
The Identity object contains information regarding the user's identity and accounts on a BlackBerry smartphone.
Warning ( Playbook 1.0 Notice):
For URI based APIs, webworks:// has been deprecated and replaced with http://localhost:8472. This change does not affect the procedural APIs.Supported Platform(s)
- BlackBerry OS 5.0+
- BlackBerry PlayBook
- Ripple Emulator
API | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
getServiceList | Y | Y | Y | Y | |
getTransportList | Y | Y | Y | Y | |
http://localhost:8472/blackberry/identity/get | Y | ||||
IMEI | Y | Y | Y | Y | |
IMSI | Y | Y | Y | Y | |
PIN | Y | Y | Y | Y | Y |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document:
You must declare the feature element(s) below in your configuration document:
Feature ID | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
<feature id="blackberry.identity" /> | Y | Y | Y | Y | Y |
<feature id="blackberry.identity.phone" /> | Y | Y | Y | Y | Y |
You must declare the permission element(s) below in your configuration document:
Permission Elements (PlayBook Only) |
---|
- <rim:permit>read_device_identifying_information</rim:permit> Permits your app to access device identifiers.
|
API Summary
Functions
URI Functions
getServiceList
static Service[] getServiceList() |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
Returns the list of Service objects that describe each of the services that the user has for their device.
getTransportList
static Transport[] getTransportList() |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
Returns a list of possible communications transports that can be used.
Code Example(s)
<script type="text/javascript"> var transportList = blackberry.identity.getTransportList(); for (var i = 0; i < transportList.length; i++) { alert("Transport name is:" + transportList[i].name + "\ntransport type:" + transportList[i].type); } </script>
Properties:
Property | Type | Description | Supported Platform(s) |
---|---|---|---|
IMEI |
Static String readonly |
Contains the IMEI number for the smartphone.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
IMSI |
Static String readonly |
Contains the IMSI number for the smartphone.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
PIN |
Static String readonly |
Contains the Personal Identification number for the smartphone.
|
- BlackBerry OS 5.0+
- BlackBerry PlayBook - Ripple Emulator |
http://localhost:8472/blackberry/identity/get
Supported Platform(s)
- BlackBerry PlayBookDescription
Returns a JSON object containing the PIN of the device.
Returns
{ "data":{ "PIN":"0x12345678", } } |
Code Example(s)
<html> <head> <script type="text/javascript" src="js/jquery-1.4.2.js" ></script> <script type="text/javascript" src="js/jquery.form.js" ></script> <script type="text/javascript" src="js/jquery.populate.js" ></script> <script type="text/javascript"> function getIdentityData(){ $.ajax({ type: "get", url: "http://localhost:8472/blackberry/identity/get", success: function(msg){ $('#myIdentityDiv').populate(JSON.parse(msg).data); } }); } </script> </head> <body> <input type="button" onclick="getIdentityData();" value="Populate - IDENTITY"/> <div id="myIdentityDiv"> PIN: <span id="PIN"></span><br/> </div> </body> </html>
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:18 GMT-0500 (EST)