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
Contributor
Posts: 30
Registered: ‎02-05-2013
My Device: Dev Alpha B
My Carrier: maxis
Accepted Solution

SimCardInfo issue

Hi everyone, this question has a similarity with the following post

http://supportforums.blackberry.com/t5/Cascades-Development/How-to-get-HardwareInfo-in-QML/m-p/21905...

 

I'd like to display/get a read on IMSI. The issue is that by using similar method I could get a read on others property such as Mobile Network Code, Mobile Country Code, Serial Number but IMSI (subscriberIdentifier)

 

Any help is much appreciated.

 

reference

http://developer.blackberry.com/cascades/reference/bb__device__simcardinfo.html

 

 

 

New Developer
Posts: 13
Registered: ‎04-13-2013
My Device: Passport / Q10 / Z10 / PlayBook / Dev Alpha B
My Carrier: Vodafone

Re: SimCardInfo issue

Did you find any way to solve this? I am at the same point - no, not exactly: I do not get the other SIM info values, too. Although I had enabled permission read_cellular_data in BAR file.
Retired
Posts: 47
Registered: ‎04-19-2013
My Device: I love them all!
My Carrier: Carriers rock!

Re: SimCardInfo issue

Is there anything in your logging from SimCardInfo?

 

You might see lines like:

SimCardInfo - failed to open private PPS object:

SimCardInfo - failed to open restricted PPS object:

SimCardInfo - failed to read private PPS data:

SimCardInfo - failed to decode private PPS data

 

Each of which would likely be followed by a string giving the reason for the problem.

 

If you're not seeing any logging, are you sure you have enabled the permission?  Did your application prompt for it when you started it after enabling the permission check?

 

 

Moving beyond that, could you share a snippet of code on how you're creating and accessing the SimCardInfo object?

 

Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: SimCardInfo issue

ApplicationUI::ApplicationUI(bb::cascades::Application *app)
: QObject(app)
{
    mSimCardInfo = new bb::device::SimCardInfo(this);

    qDebug() << "mobileCountryCode: "+mSimCardInfo->mobileCountryCode();
    qDebug() << "mobileNetworkCode: "+mSimCardInfo->mobileNetworkCode();
    qDebug() << "serialNumber: "+mSimCardInfo->serialNumber();
    qDebug() << "subscriberIdentifier: "+mSimCardInfo->subscriberIdentifier();

}

 

 

Yes, the  subscriberIdentifier's value is empty.

 

I only can get mobileCountryCode, mobileNetworkCode and serialNumber.

 

On the document has indicated:

Return: 

Returns the IMSI of the SIM card encoded as a string, or an empty string if the caller does not have sufficient permission, or if the SIM card does not offer a value for retrieval.

 

Retired
Posts: 47
Registered: ‎04-19-2013
My Device: I love them all!
My Carrier: Carriers rock!

Re: SimCardInfo issue

From the docs:

 

    /*!
     * @brief The subscriber identifier (IMSI) of the SIM card.
     *
     * @permissions The application must have the @c access_uicc_carrier_restricted 
     *              permission to access this property.
     *
     *
     * @since BlackBerry 10.0.0

 I believe this property is restricted to select carrier partners because of the usage of "access_uicc_carrier_restricted".

New Developer
Posts: 13
Registered: ‎04-13-2013
My Device: Passport / Q10 / Z10 / PlayBook / Dev Alpha B
My Carrier: Vodafone

Re: SimCardInfo issue

[ Edited ]

Hm, that is strange. Why should this be that limited? On other phones OS you can access IMSI with normal permission given by the user - or even without. Our apps normally register on an IMSI-hash, because this is unique and identifies the user and the phone.

EDIT: I mean, it identifies the user and can only be present at one phone at a time. Just to clarify.

Retired
Posts: 47
Registered: ‎04-19-2013
My Device: I love them all!
My Carrier: Carriers rock!

Re: SimCardInfo issue

This additional restriction was added at the request of our carrier partners.  Beyond that, I can't say why they chose to make it unavailable.

 

Will a PIN/BBID pair not identify the device and user suffiicently for your needs?

New Developer
Posts: 13
Registered: ‎04-13-2013
My Device: Passport / Q10 / Z10 / PlayBook / Dev Alpha B
My Carrier: Vodafone

Re: SimCardInfo issue

The problem is: We have apps spread out to the world of Windows Mobile, Windows Phone, Symbian, Brew and Android devices. We hardly can change all of them due to this restriction.
If you use our app on Symbian and change your phone to Android, you just put your SIM from one phone to the other and you are asked for your password. Or, if the administrator did know your change before, you are not at all asked for that, too.

Having another unique ID only for BlackBerry would mean to have it only for BlackBerry...
Highlighted
New Developer
Posts: 13
Registered: ‎04-13-2013
My Device: Passport / Q10 / Z10 / PlayBook / Dev Alpha B
My Carrier: Vodafone

Re: SimCardInfo issue

Another part of my question was, that I can not access even those properties, that do not fall under this restriction. I was asked for my code... well, it looks a bit other than that of noahhuang

butvery similar. There is no mistake in that, but all properties are 0.

 

When checking the permissions given, I saw that the permission settings on the device for this app list my permissions with name and description, but the one I need for this is read_cellular_data and this is shown in this list with "read_cellular_data.label [/n/r] read_cellular_data.message" and it is turned on. But this seems to tell me, that the permission name I took is wrong. I took it from here: https://developer.blackberry.com/cascades/reference/bb__device__simcardinfo.html#function-subscriber...

 

By the way: It is not available from Momentics IDE, I wrote it directly to the source of the BAR descriptor file. But there is no other permission in Momentics GUI that seems to match from name or description.

Contributor
Posts: 30
Registered: ‎02-05-2013
My Device: Dev Alpha B
My Carrier: maxis

Re: SimCardInfo issue

It seems obvious, but have you added LIBS += -lbbdevice inside .pro files?
 or you could try the first link (hardwareinfo) which employ the same method.