Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow other cordova engines to use this plugin #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</js-module>

<engines>
<engine name="cordova-ios" version="3.8.0" />
<engine name="cordova-android" version="4.0.2" />
<engine name="cordova-ios" version=">=3.8.0" />
<engine name="cordova-android" version=">=4.0.2" />
</engines>

<!-- android -->
Expand Down
9 changes: 6 additions & 3 deletions src/ios/CDVOfflinePage.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ - (void)pluginInitialize
self.failedURL = nil;

// set the webview delegate to notify navigation events
UIWebView *webView = self.webView;

notificationDelegate = [[CVDWebViewNotificationDelegate alloc] init];
notificationDelegate.wrappedDelegate = self.webView.delegate;
[self.webView setDelegate:notificationDelegate];
notificationDelegate.wrappedDelegate = [webView delegate];
[webView setDelegate:notificationDelegate];
}

// enables offline page support
Expand Down Expand Up @@ -149,7 +151,8 @@ - (void)updateConnectivityStatus:(NSNotification*)notification
}
else {
if (self.failedURL) {
[self.webView loadRequest: [NSURLRequest requestWithURL: self.failedURL]];
UIWebView *webView = self.webView;
[webView loadRequest: [NSURLRequest requestWithURL: self.failedURL]];
}
else {
[self.offlineView setHidden:YES];
Expand Down