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
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
-Dx
-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
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
-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
Don't worry, I'll keep hacking, it's definitely my problem/fault :)
-Dx
-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
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
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>
-Dx
Sent from my iPhone