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
Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: blackberry.identity.PIN on smartphone

Hi Keith,

 

Now you've got me somewhat scared to look Smiley Wink

 

The more you can minimize the situation with the problem, the better. If it is reproducible with the minimal codeset this is ideal.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
Posts: 25
Registered: ‎08-02-2011
My Device: Torch 9800
My Carrier: developer

Re: blackberry.identity.PIN on smartphone

Ok, I now have a very small app that demonstrates the problem with a few lines of code.  I have one simple app that works as expected and gets the blackberry.identity.PIN , and another that does not (value is 'undefined').  The only difference is that the one that does not work is using a Sencha Touch viewport instead of just the index.html page.

 

Both apps return the expected values for blackberry.network and 'blackberry.system.hasDataCoverage().  

 

I pasted the Sencha app files below, except for the sencha-touch.css and sencha-touch.js libraries, which are too large.  I can easily zip them up and send though if that would help.  The zip is only 161KB.

 

Thanks again for looking at this.  Probably it will be something simple, but a couple of us have been banging on it here for quite a while.

 

Keith

 

p.s. I've been working on it with BlackBerry WebWorks SDK 2.2.0.15

 


Config file: (same as the one for the app that works)

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0" rim:header="WebWorks Sample">

<name>uuidTest3</name>
 <feature id="blackberry.system" />
<feature id="blackberry.identity" />
<feature id="blackberry.identity.phone" />

<content src="index.html"/>

</widget>


index.html FILE

 

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="sencha-touch.css" type="text/css">
<script type='text/javascript' src='sencha-touch.js'></script>
<script type='text/javascript' src='exampleSencha.js'></script>
<script type='text/javascript' src='viewport.js'></script>
</head>
<body>
</body>
</html>


exampleSencha.js FILE

 

Ext.regApplication('Demo', {
name: 'app',
launch: function() {
this.viewport = new Demo.Viewport({application: this});
},
});

 


viewport.js FILE

 

Demo.onClick = function () {

alert('Your device pin is:' + blackberry.identity.PIN);
alert('blackberry.network: ' + blackberry.network);
alert('blackberry.system.hasDataCoverage(): ' + blackberry.system.hasDataCoverage());
}

Demo.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,

dockedItems: [
{
dock : 'top',
xtype: 'toolbar',
title: 'Standard Titlebar'
},
{
dock : 'top',
xtype: 'toolbar',
ui : 'light',
items: [
{
xtype: 'button',
text: 'Click Me',
handler: Demo.onClick
}
]
}
],
});

 

 

 

 

Visitor
Posts: 1
Registered: ‎11-25-2011
My Device: BlackBerry 9900
My Carrier: O2

Re: blackberry.identity.PIN on smartphone

I'm also unable to get the PIN via blackberry.identity.PIN has anyone found a solution to this?

Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: blackberry.identity.PIN on smartphone

Hi Keith,

 

Sorry I never got back to you, but I can confirm I cannot retrieve the PIN also. We're looking into it, but it may have to do with an issue where some APIs don't work in an iframe.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: blackberry.identity.PIN on smartphone

Hi Keith,

 

Just so you're aware you shouldn't be instantiating viewport directly - 

http://docs.sencha.com/touch/1-1/#!/api/Ext.Viewport



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
Posts: 25
Registered: ‎08-02-2011
My Device: Torch 9800
My Carrier: developer

Re: blackberry.identity.PIN on smartphone

Hi Jeff - I think we're ok with the viewport because it wasn't Ext.Viewport we instantiated but rather Demo.Viewport, which is an Ext.Panel we defined.  

 

Keith

 

 

Contributor
Posts: 25
Registered: ‎08-02-2011
My Device: Torch 9800
My Carrier: developer

Re: blackberry.identity.PIN on smartphone

Jeff - Any progress on this?

 

Thanks

 

Keith

Highlighted
New Contributor
Posts: 7
Registered: ‎03-29-2012
My Device: Dev
My Carrier: Dev

Re: blackberry.identity.PIN on smartphone

A possible workaround for Sencha Touch 1.1 is to disable Ext.History by setting { useHistory: false } in regApplication() since it apparently includes an iframe....