08-07-2012 12:42 PM - edited 08-07-2012 12:55 PM
Hello,
I went through every forums on this subject and tried everything but I still can't read my Playbook's pin.
I'm developing an app (HTML+JS) with Webworks and testing it on my Playbook;
Here's my config.xml file:
(I put in comment the different version of the declarations of my features)
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="2.6.1.0">
<name>Webwork App</name>
<author>Kadabra</author>
<description>
WebWorks, playBook App
</description>
<rim: permissions>
<rim: permit>read_device_identifying_information</rim: permit>
<rim: permit>access_shared</rim: permit>
</rim: permissions>
<rim: orientation mode="auto"/>
<!-- Feature Version 4-->
<feature id="blackberry.invoke" required="true" version="2.6.1.0" />
<feature id="blackberry.system" required="true" version="2.6.1.0" />
<feature id="blackberry.identity" required="true" version="2.6.1.0" />
<feature id="blackberry.identity.phone" required="true" version="2.6.1.0" />
<feature id="blackberry.app.event" required="true" version="2.6.1.0" />
<feature id="blackberry.ui.dialog" required="true" version="2.6.1.0" />
<feature id="blackberry.app" required="true" version="2.6.1.0" />
<feature id="blackberry.system.event" required="true" version="2.6.1.0" />
<feature id="blackberry.utils" required="true" version="2.6.1.0" />
<!-- Feature Version 3-->
<!--feature id="blackberry.app" required="true" version="1.0.0.0"/>
<feature id="blackberry.app.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.system" required="true" version="1.0.0.0"/>
<feature id="blackberry.system.event" required="true" version="1.0.0.0"/>
<feature id="blackberry.ui.dialog" required="true" version="1.0.0.0"/>
<feature id="blackberry.utils" required="true" version="1.0.0.0"/-->
<!-- Feature Version 2-->
<!--feature id="blackberry.invoke" required="true" />
<feature id="blackberry.system" required="true" />
<feature id="blackberry.identity" required="true" />
<feature id="blackberry.identity.phone" required="true" />
<feature id="blackberry.app.event" required="true" />
<feature id="blackberry.ui.dialog" required="true" />
<feature id="blackberry.app" required="true" />
<feature id="blackberry.system.event" required="true" />
<feature id="blackberry.utils" required="true"/-->
<!-- Feature Version 1-->
<!--feature id="blackberry.invoke" />
<feature id="blackberry.system" />
<feature id="blackberry.identity" />
<feature id="blackberry.identity.phone" />
<feature id="blackberry.app.event" />
<feature id="blackberry.ui.dialog" />
<feature id="blackberry.app" />
<feature id="blackberry.system.event" />
<feature id="blackberry.utils"/-->
<icon src="images/icon.png"/>
<content src="index.html"/>
<access uri="*" subdomains="true" />
</widget>
Here's how I tried to access the PIN in my js file:
function getIdentityData(){
$.ajax({
type: "get",
url: "http://localhost:8472/blackberry/identity/get",
success: function(msg){
alert("In success"+msg);
$('#myIdentityDiv').populate(JSON.parse(msg).data)
},
complete: function(){
alert("Complete");
}
});
}
I only have "Complete" alerting, it doesn't enter the success.
function setImei(){
if(blackberry.identity.PIN){
alert("blackberry.identity.PIN="+blackberry.identi
}else
alert("Does not work");
}
Here only "Does not work" is alerting.
I would really appreciate some help.
Thank you
Kadabra
Solved! Go to Solution.
08-07-2012 12:56 PM
check with these
https://developer.blackberry.com/html5/api/blackbe
08-08-2012 06:17 AM - edited 08-08-2012 06:17 AM
I already tried these.
Here is my systems configuration:
Webworks SDK 2.0 ( I'm downloading the 2.1 and Blackberry 10 Webworks do you think it might be a solution?)
Playbook OS 2.1.0.560 (as I'm writing this I realize I should have tried the 2.1 at first)
There's no iframe in my pages.
What about the config.xml file is it correct? Does the version attribute in the feature tag have to match the version of my app I'm trying?
My js is imported locally.
What else can I do? What other information do you need?
Thank you
08-08-2012 09:25 AM
Try removing this feature from the config.xml document?
<feature id="blackberry.identity.phone" />
The Webworks SDK for Tablet OS does not support this feature and it may be conflicting with blackberry.identity.
Otherwise, take a look at this sample page to see how the PIN is being retrieved:
http://blackberry.github.com/WebWorks-Samples/kitc
08-08-2012 09:49 AM
Thank you for your answer.
Just tried and still doesn't work.
Also the second link you provide doesn't propose any solution.
What does it mean: "likely cause is WebWorks APIs are not supported by this user agent"
Which user agent are we talking about?
Thank you
08-08-2012 10:39 AM - edited 08-08-2012 10:41 AM
Ok. I just succeed!!!
Solution: BEWARE WebWorks SDK for Tablet 2.0 doesn't support blacberry.identity.pin!!!
I built with the 2.1 and it finally worked!
On the other hand the "http://localhost:8472/blackberry/identity/get" service still doesn't work
08-08-2012 10:42 AM
Apologies if I provided a page that was confusing. That is the gh-pages sample of a page in the kitchenSink sample app for WebWorks. You can download the full sample here :
https://github.com/blackberry/WebWorks-Samples/
A user agent is any application that displays some web content. This can be a browser, or an app with an embedded web view (e.g. WebWorks apps). The message you found is likely because you opened that URL in a browser. This is because it does not support the blackberry.identity feature.
The source of that page, as well as the config.xml file from the kichenSink sample, may help in explaining why you are unable to access the PIN value.
Last question - are you testing your page in a desktop browser, in Ripple, or on a PlayBook simulator / device?
08-08-2012 10:48 AM
That's what I was thinking for the user agent but couldn't understand as I'm testing on a Playbook and therefore with the native default web browser. So it can't be a non compatible blackberry.identity feature user agent.
I'm testing on 2 PlayBook devices with these OS:
- 2.0.1.358
- 2.1.0.560
08-08-2012 11:33 AM
Ah - you are testing in the native browser on the device? That is why you are getting no results.
the browser application does not recognize WebWorks feature APIs, such as blackberry.identity . These can ONLY be used within a WebWorks application.
08-08-2012 11:36 AM
No I am testing with a Webworks application and was assuming that it used the native browser.
I confirm I'm testing a Webworks app on a Playbook device.
The 2.0 version of the tablet SDK doesn't support blackberry.identity feature as I tested the exact same code with the 2.1 SDK and it worked