Skip to content

Commit

Permalink
fix(ios): Use proper native events for cordova events (#4720)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jun 14, 2021
1 parent ca4e3b6 commit 99c21dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/Capacitor/Capacitor/CapacitorBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ internal class CapacitorBridge: NSObject, CAPBridgeProtocol {
exportCordovaJS()
registerCordovaPlugins()
} else {
observers.append(NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (_) in
observers.append(NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: OperationQueue.main) { [weak self] (_) in
self?.triggerDocumentJSEvent(eventName: "resume")
})
observers.append(NotificationCenter.default.addObserver(forName: UIApplication.willResignActiveNotification, object: nil, queue: OperationQueue.main) { [weak self] (_) in
observers.append(NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: OperationQueue.main) { [weak self] (_) in
self?.triggerDocumentJSEvent(eventName: "pause")
})
}
Expand Down

0 comments on commit 99c21dc

Please sign in to comment.