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
Contributor
thinkkevin
Posts: 10
Registered: ‎07-31-2012
My Device: PlayBook
My Carrier: CMCC
Accepted Solution

BB10 html app can't load image

I have a html5 site running on http://touch.srwd21.com (Internal domain address)

 

And I have below setting within widget element in config.xml

 

<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.0" id="srwd21">
  <name>srwd21</name>
  <description>Description for srwd21</description>
  <rim:permissions>
    <rim:permit>read_geolocation</rim:permit>
  </rim:permissions>
  <feature id="blackberry.invoke"/>
  <feature id="blackberry.connection" />
  <feature id="blackberry.app" />
  <icon src="icon.png"/>
  <content src="http://touch.srwd21.com"/>
</widget>

 

 

I deployed the app to BB10 Alpha simulator, and when launched, see my snapshots:

https://www.evernote.com/shard/s140/sh/f522c819-a3cb-4016-9f69-129d4aaec0c8/7f14e2fab85ca8da3086fc59...

The css is well loaded, and search bar is there at expected place, but just the image file are not allowed to access. Please help what's wrong, and what need to be set.

 

thanks!

 

 

Please use plain text.
Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: BB10 html app can't load image


add access element
<access uri="path" subdomains="true" />
<access uri="*" subdomains="true" />

where path something like "http://www.google.co.in/"
Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 html app can't load image

SumiGosh is write try adding both tags he mentioned one should be <access uri="http://srwd21.com" subdomains="true" />

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
thinkkevin
Posts: 10
Registered: ‎07-31-2012
My Device: PlayBook
My Carrier: CMCC

Re: BB10 html app can't load image

Thanks for your reply. 

I have once tried that, it did not work.

 

I also tried to use uri="*", not work either.

 

Actually, I don't have such issue when wrapping the site to BB tablet app.

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 html app can't load image

Really, well this is definetely not passing our whitelising so something is awry. That pop-up you see is what you get when your content is not whitelisted. So we need to find a way around that. Can you post your config?

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
thinkkevin
Posts: 10
Registered: ‎07-31-2012
My Device: PlayBook
My Carrier: CMCC

Re: BB10 html app can't load image

An interesting part I found, the image file that can't access is specified in CSS file as background image. Another animated GIF file specified in HTML file could be accessed as expected.

Please use plain text.
Contributor
thinkkevin
Posts: 10
Registered: ‎07-31-2012
My Device: PlayBook
My Carrier: CMCC

Re: BB10 html app can't load image

<?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" id="srwd21">

  <author href="http://www.srwd21.com/" 
          rim:copyright="Copyright 1998-2012 SRWD21 Inc.">Srwd21 Inc.</author>

  <name>srwd21</name>

  <description>
    Fun at srwd21!
  </description>

  <rim:permissions>
    <rim:permit>read_geolocation</rim:permit>
  </rim:permissions>
  <rim:loadingScreen backgroundImage="background.png"
             foregroundImage="background.png"
             onLocalPageLoad="true" onFirstLaunch="true">
  </rim:loadingScreen>
  <feature id="blackberry.invoke"/>
  <feature id="blackberry.connection" />
  <feature id="blackberry.app" />

  <icon src="icon.png"/>
  <content src="http://touch.srwd21.com"/>
  
  <access uri="http://srwd21.com" subdomains="true"/>
  <access uri="*" subdomains="true"/>
  <license href="http://www.srwd21.com/"/>

</widget>

 

As above attached. Quite simple, just reference the HTML5 site URL.

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 html app can't load image

It seems to work just fine for me. I just bundled your config.xml into an app. I did find that the website does not deliver content for the RIM BB10 User Agent, so the site will need to be changed. Are you in charge of this site? Or just wrapping it? I had to change the userAgent to Iphone to get a good version.

 

In summary. There is not reason for you to get that dialog from what I can see.

 

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 html app can't load image

Ahh I did find that this site access external data and tries to pull it in. You will get errors if you don't whitelist the xsite requests to espn.com etc etc.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
thinkkevin
Posts: 10
Registered: ‎07-31-2012
My Device: PlayBook
My Carrier: CMCC

Re: BB10 html app can't load image

Thanks!

Please use plain text.