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
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free
Accepted Solution

Impossible to get PlayBook's pin tried everything!!!

[ Edited ]

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.identity.PIN);
}else
alert("Does not work");

}

 

Here only "Does not work" is alerting.

 

I would really appreciate some help.

Thank you

Kadabra

 

Please use plain text.
Developer
kamal_nigam
Posts: 434
Registered: ‎07-23-2012
My Device: Blackberry 10
My Carrier: Orange

Re: Impossible to get PlayBook's pin tried everything!!!

check with these

https://developer.blackberry.com/html5/api/blackberry.identity.html

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Accessing-PlayBook-PIN-UDID/td-p...

 

Thanks
-------------------------------------------------------------------------------------
Press the Accept as solution Button when u got the Solution
Press Kudo to say thank to developer.
-------------------------------------------------------------------------------------.
Please use plain text.
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free

Re: Impossible to get PlayBook's pin tried everything!!!

[ Edited ]

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

Please use plain text.
BlackBerry Development Advisor (Retired)
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Impossible to get PlayBook's pin tried everything!!!

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/kitchenSink/html/apis/identity.html

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free

Re: Impossible to get PlayBook's pin tried everything!!!

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

 

Please use plain text.
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free

Re: Impossible to get PlayBook's pin tried everything!!!

[ Edited ]

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

Please use plain text.
BlackBerry Development Advisor (Retired)
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Impossible to get PlayBook's pin tried everything!!!

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?

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free

Re: Impossible to get PlayBook's pin tried everything!!!

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

Please use plain text.
BlackBerry Development Advisor (Retired)
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Impossible to get PlayBook's pin tried everything!!!

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.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
New Contributor
Kadabra
Posts: 8
Registered: ‎08-01-2012
My Device: PlayBook
My Carrier: Free

Re: Impossible to get PlayBook's pin tried everything!!!

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

Please use plain text.