Issue in implementing phonegap childbrowser plugin for iphone
Issue in implementing phonegap childbrowser plugin for iphone
- Subject: Issue in implementing phonegap childbrowser plugin for iphone
- From: Prabhjot Kaur <email@hidden>
- Date: Thu, 22 Mar 2012 13:35:06 +0530
Hi All
I am trying to implement phonegap childbrowser plugin for iphone and
I am having trouble with childBrowser.showWebPage
When I use window.plugins.childBrowser.showWebPage("http://www.google.com"),
the childbrowser pops up, but it is just a blank screen i.e opening
url about:blank.
The phonegap version I am using is Phonegap 1.2.0 and ios sdk is
5.0. I have done following for the same:
1. Added ChildBrowser.js
to "www" folder.
2. Added ChildBrowserCommand.h, ChildBrowserCommand.m,
ChildBrowserViewController.h, ChildBrowserViewController.m
files in "Plugin" folder.
3. Added ChildBrowser.bundle
and ChildBrowserViewController.xib
in "Resources" folder
4. In Supporting Files > PhoneGap.plist,
add under Plugins :
Key: ChildbrowserCommand Value: ChildbrowserCommand
Key: ChildBrowser Value: ChildBrowser.js
5. In AppDelegate.m file,
i) add under the existing “#import” declarations :
#import “ChildBrowserCommand.h”
#import “ChildBrowserViewController.h”
ii) Replaced following code snippet
- (BOOL)webView:(UIWebView *)theWebView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:
(UIWebViewNavigationType)navigationType
{
return [ super webView:theWebView
shouldStartLoadWithRequest:request navigationType:navigationType ];
}
with
- (BOOL)webView:(UIWebView *)theWebView
shouldStartLoadWithRequest:
(NSURLRequest *)request navigationType:
(UIWebViewNavigationType)navigationType
{
NSURL *url = "" URL];
if ([[url scheme] isEqualToString:@”gap”] || [url
isFileURL]) {
return [ super webView:theWebView
shouldStartLoadWithRequest:request navigationType:navigationType ];
}
else {
ChildBrowserViewController* childBrowser =
[ [ ChildBrowserViewController alloc ]
initWithScale:FALSE ];
[super.viewController
presentModalViewController:childBrowser
animated:YES ];
[childBrowser loadURL:[url description]];
[childBrowser release];
return NO;
}
}
Suggestions....
Thanks
Prabhjot Kaur
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden