ChildView Plugin Black Screen (failure to load NIB?)

72 views
Skip to first unread message

D. Rimron

unread,
Sep 14, 2010, 12:17:08 PM9/14/10
to phonegap
Hi,

After Jesse(?)s rather groovy checkin of yesterday of the PhoneGap
ChildBrowser plugin supporting callbacks on URL change (and his hints at
a FBGraph API) I thought I'd build on this ( in a pure JS manner ) to
see if I could do a nice little dropin oauth JS stack but I appear to
have fallen down before I've started... :-(

Every time I do:

PhoneGap.exec("ChildBrowserCommand.showWebPage", "http://www.google.com" );


I end up with a plain black window (full screen, 'cept the status bar at
the top) but all the output in the Compiler Log and Build Results
certainly looks like it's working. (viewDidLoad is triggering, lists the
URLs, etc)

Has anyone else come across this before / is it a know issue? I'm
suspecting NOT since reading the lists and logs it appears that this is
a pretty stable and known working plug-in, so I've likely made some sort
of schoolboy error ;-) I just wondered if anyone had bumped into this
before and could give me a pointer before I start debugging at
Ground-Zero, as I'm confidant that it's something I've probably done,
not Jesse/Nitobi :)

TIA,
-Dx

Giacomo Balli

unread,
Sep 14, 2010, 1:37:56 PM9/14/10
to phonegap
haven't tried the latest yet (don't want to mess up current projects)
but it has always worked like a charm...
What else did you edit in your "pure JS manner"? ;)

Jesse

unread,
Sep 14, 2010, 3:24:37 PM9/14/10
to D. Rimron, phonegap
There were API changes in my update.
You should include ChildBrowser.js in your HTML and use it's interface.

Also, I added images for the bottom bar, they need to be added as resources to your project.

I only minimally tested this, so enter a defect on github if you find one.

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

D. Rimron

unread,
Sep 14, 2010, 3:59:50 PM9/14/10
to phon...@googlegroups.com
On 14/09/2010 20:24, Jesse wrote:
> There were API changes in my update.
I stole my oneline of JS (the only JS I'm using on top of standard
phonegap.js at this stage) from the README.txt :)

> You should include ChildBrowser.js in your HTML and use it's interface.
I fail to see a ChildBrowser.js in
http://github.com/purplecabbage/PhoneGap-Plugins/tree/master/ChildBrowser/iPhone/
am I blind, or stupid? :)

> Also, I added images for the bottom bar, they need to be added as resources to your project.
Yeah, done that, and the XIB.... I thought that maybe the black screen
upon instantiation was me screwing up by not linking the ViewController
to the NIB, but that seems to be okay (afaict.... :) )

> I only minimally tested this, so enter a defect on github if you find one.
>
Happily; If I find one. :)

-Dx

Jesse MacFadyen

unread,
Sep 14, 2010, 5:40:17 PM9/14/10
to D. Rimron, phon...@googlegroups.com
I am blind + stupid, I didn't check it in.

It is there now ...



-Dx

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com



--
--
Jesse MacFadyen
{
  blog:'blogs.nitobi.com/jesse',
  email:'jesse.m...@nitobi.com',
  company:
  {
    name:'Nitobi Software',
    site:'www.nitobi.com',
    phone:
    {
      office:'+1 (604) 685-9287',
      tollFree:'1-866-632-2777'
     }
  }
}

D. Rimron

unread,
Sep 14, 2010, 5:57:33 PM9/14/10
to phon...@googlegroups.com
On 14/09/2010 22:40, Jesse MacFadyen wrote:
> I am blind + stupid, I didn't check it in.
My biggest sin is forgetting SVN ADD :) So, thanks :)

But, I think I'm getting how it works, JS side, a CB.Install Singleton
that establishes the prototypes and puts them into the window.plugins.
However, unless I'm failing to grok something fundamental it's
support-services/callbacks/etc in and around the core function of
ChildBrowser.showWebPage, yesno, the objective C callback side of things
needs the rest of the JS, not the actual act of opening a simple browser
to google?

If that is the case (and I think it is, please correct me if I'm barking
up the wrong lamppost) then it is my Objective C that's failing, I
suspect, and will happily debug that thine own self because, even minus
your ChildBrowser.js, one should still be able to exec a showWebPage via
phonegap.exec, and I'm getting that far, a new view is established, but
it's all black (missing the webview/new button bar/etc) making me think
that it's something daft I've done importing the plugin :)

Thanks for your time anyway, I'll keep the list posted of anything
obvious I find and bugpost to github if I find a fundamental issue...

-Dx

Jesse MacFadyen

unread,
Sep 14, 2010, 6:03:24 PM9/14/10
to D. Rimron, phon...@googlegroups.com
Only thing I can think of: Is your xib a resource in the project?



-Dx

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

D. Rimron

unread,
Sep 14, 2010, 7:23:06 PM9/14/10
to phon...@googlegroups.com
On 14/09/2010 23:03, Jesse MacFadyen wrote:
> Only thing I can think of: Is your xib a resource in the project?
Pretty sure. I mean, it (plus the PNGs and the 2x .m and 2x .h have all
been, at one point or another: in the project root, in the command
folder, in the classes folder and in the freshly created Plugins folder.
All to no avail.

Don't worry, I'll keep hacking, it's definitely my problem/fault :)

-Dx

Screen shot 2010-09-15 at 00.21.31.png

Jesse MacFadyen

unread,
Sep 14, 2010, 8:33:44 PM9/14/10
to D. Rimron, phon...@googlegroups.com
Where's the screenshot of your expanded resources folder?



-Dx

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

D. Rimron

unread,
Sep 14, 2010, 8:46:46 PM9/14/10
to Jesse MacFadyen, phon...@googlegroups.com
On 15/09/2010 01:33, Jesse MacFadyen wrote:
> Where's the screenshot of your expanded resources folder?
Attached (1.36.35) This was the Resources folder for my Lib, not my App.
My App's Resource Folder, attached (01.43.40) solved the problem.... Had
to move the XIB into that, not the Library....

But I've solved the problem (see above) . I'll explain what was going on
"Just In Case" someone else gets this/Google needs the fodder.

The resources folder for PhoneGapLib wasn't picking up the XIB, for no
reason I can work out. Putting all the resources in the
PhoneGap-ExampleApp resources folder did the job.

I suspect my PhoneGapLib project is fundamentally buggered in some
unique and interesting way and isn't linking the resources into the
library! However, I have a forward, and can continue to hack. \o/

I've had similar style issues before when I had a folder inside a
seperate project folder called Resources, I think it confused xCode
something rotten and told me Applications were already installed on the
Simulator, etc. when trying to compile..... I don't have another
"Resources" folder this time, but I wonder if it's related....

Thanks for your time - I'm going to rm -rf my phonegap lib core project
and see if that cuts the mustard :)

-Dx

Screen shot 2010-09-15 at 01.43.40.png
Screen shot 2010-09-15 at 01.36.35.png

Jesse MacFadyen

unread,
Sep 14, 2010, 8:56:15 PM9/14/10
to D. Rimron, phon...@googlegroups.com
This is the expected behavior.
Resources need to exist in your target App, not in the PhoneGapLib.  All my plugin work is meant to be plugged without having to modify PhoneGapLib.

If you want to get a 'lib' like experience with the use of the plugins repo, you can simply add a reference to your target app project instead of 'copy local'.  The js file is a little more difficult because it is in the www folder, and not tracked as a resource, so you will still need to physically copy that over.

Glad you got it workin, how's facebook connect coming?


D. Rimron

unread,
Sep 14, 2010, 9:22:29 PM9/14/10
to Jesse MacFadyen, phon...@googlegroups.com
On 15/09/2010 01:56, Jesse MacFadyen wrote:
> This is the expected behavior.
> Resources need to exist in your target App, not in the PhoneGapLib.
> All my plugin work is meant to be plugged without having to modify
> PhoneGapLib.
Yeah. Makes sense from the "Average Punter" point of view, but I was
trying to link it into my CoreLib since my Android Plug-In making
ability is non-existent, and this way leaves me a consistent playing
field for my JS :)

> If you want to get a 'lib' like experience with the use of the plugins
> repo, you can simply add a reference to your target app project
> instead of 'copy local'. The js file is a little more difficult
> because it is in the www folder, and not tracked as a resource, so you
> will still need to physically copy that over.
Virgin checkout of 0.9.1, Plugin dropped into "Commands" folder, res
into Resources -- bar the missing .js file, as you already said,
everything now works perfect. I blame a buggered .project file.... :-/

> Glad you got it workin, how's facebook connect coming?
I'm actually working on raw OAuth1.0 first (since it's more versatile) -
I've now got a set of JS that speaks the magic, does all the OAuth keys,
manages (queues, etc) multiple OAuth connections and can do the funky
token-exchange dance, etc.

Still to do:
* I need to add URL watching/callback to automagically get the
final oauth_token and oauth_token_secret back into the JS namespace,
* ideally some logic that does an attempt at "accessToken" after
"requestToken" and falls back to the ChildBrowser to authenticate if a
401 is returned at the accessToken stage
* I'll lash up some handlers for OAUTH_GET and OAUTH_POST and we're
sorted.

Stuff it won't do:
* Storage - handling your tokens and whatnot is your own luckout,
you can store and process those separately, this is just the framework
for connections, you're still responsible for looking after your own keys...

(early) alpha code attached mainly for curiosity more than anything
else. It's unoptimised, and missing some seriously big bits to make it
useful - but is the solid foundation of a multi-point OAuth Framework
and connection manager and while it does actually parse, and "should"
work within the definition above, I hold no responsibility if it goes
boom and takes out an eye ;-)

License Details:
OAuth signing code under Apache2 license from NetFlix
SHA-1 code under BSD License from Paul Johnston (and others)
OAuthManager + OAuthClient under MIT License by me (early
prerelease copy - will throw on github when done)

Feedback welcome. :)

-Dx


OAuthManager.js

Jesse

unread,
Sep 14, 2010, 10:08:48 PM9/14/10
to D. Rimron, phon...@googlegroups.com

Holy crap, 30k... Guess I'll still do my 300 line fbconnect js. Just the simple stuff...

> <OAuthManager.js>

D. Rimron

unread,
Sep 15, 2010, 3:31:57 AM9/15/10
to Jesse, phon...@googlegroups.com
Yep - a full Oauth Isn't tiny :)

-Dx

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages