Skip to content

Commit

Permalink
fix(cordova/ios): post CDVPluginHandleOpenURLNotification (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Nov 21, 2019
1 parent c1a7e20 commit 2972661
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/CAPBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ enum BridgeError: Error {
"url": url,
"options": options
])
NotificationCenter.default.post(name: NSNotification.Name.CDVPluginHandleOpenURL, object: url)
CAPBridge.lastUrl = url
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,16 @@ - (instancetype)initWithWebViewEngine:(WKWebView *)theWebViewEngine
{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil];

self.webViewEngine = theWebViewEngine;
}
return self;
}

- (void)pluginInitialize
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil];
// You can listen to more app notifications, see:
// http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4

Expand Down

0 comments on commit 2972661

Please sign in to comment.