Skip to content

Commit

Permalink
Merge pull request #1 from lhpaul/master
Browse files Browse the repository at this point in the history
arreglado el problema en iOS
  • Loading branch information
arturokunder committed Apr 22, 2015
2 parents 1f3b69f + ab3bec9 commit f1fdabd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/ios/webview/WebViewPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ under the License.

#import <UIKit/UIKit.h>
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDVWebViewController.h>
#import <Cordova/CDVViewController.h>

@class WebViewController;

Expand All @@ -32,7 +32,7 @@ under the License.
{
@private NSString* webViewFinishedCallBack;
}
@property (nonatomic, retain) WebViewController* WebViewController;
@property (nonatomic, retain) WebViewController* webViewController;

- (void)subscribeCallback:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command;
Expand All @@ -42,7 +42,7 @@ under the License.

@end

@interface WebViewController : CDVWebViewController
@interface WebViewController : CDVViewController
{}
@property (nonatomic, assign) id delegate;
- (void)viewDidDisappear:(BOOL)animated;
Expand Down
14 changes: 7 additions & 7 deletions src/ios/webview/WebViewPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@implementation WebViewPlugin

@synthesize WebViewController;
@synthesize webViewController;

- (void)subscribeCallback:(CDVInvokedUrlCommand*)command
{
Expand All @@ -29,10 +29,10 @@ - (void)show:(CDVInvokedUrlCommand*)command{
[self.commandDelegate runInBackground:^{
@try {
dispatch_async(dispatch_get_main_queue(), ^{
WebViewController = [[WebViewController alloc] init];
WebViewController.delegate = self; // esto es para poder recibir el evento de que webView se cerro
WebViewController.startPage = url;
[self.WebViewController presentWebViewController:WebViewController animated:YES completion:nil];
webViewController = [[WebViewController alloc] init];
webViewController.delegate = self; // esto es para poder recibir el evento de que webView se cerro
webViewController.startPage = url;
[self.viewController presentViewController:webViewController animated:YES completion:nil];
});

CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
Expand All @@ -52,7 +52,7 @@ - (void)hide:(CDVInvokedUrlCommand*)command{
@try {

dispatch_async(dispatch_get_main_queue(), ^{
[self.WebViewController dismissWebViewControllerAnimated:YES completion:nil];
[self.viewController dismissViewControllerAnimated:YES completion:nil];
[self dispose];
});

Expand All @@ -69,7 +69,7 @@ - (void)hide:(CDVInvokedUrlCommand*)command{

-(void)webViewFinished{
NSLog(@"webViewFinished");
WebViewController = nil;
webViewController = nil;

CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:webViewFinishedCallBack];
Expand Down

0 comments on commit f1fdabd

Please sign in to comment.