Skip to content

Commit

Permalink
chore: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rnr committed Feb 9, 2024
1 parent 2b3f9a5 commit 3b93284
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
28 changes: 18 additions & 10 deletions OpenEdX/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

if config.facebook.enabled {
ApplicationDelegate.shared.application(
if ApplicationDelegate.shared.application(
app,
open: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: options[UIApplication.OpenURLOptionsKey.annotation]
)
) {
return true
}
}

if config.google.enabled {
return GIDSignIn.sharedInstance.handle(url)
if GIDSignIn.sharedInstance.handle(url) {
return true
}
}

if config.microsoft.enabled {
return MSALPublicClientApplication.handleMSALResponse(
if MSALPublicClientApplication.handleMSALResponse(
url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
)
) {
return true
}
}

return false
Expand Down Expand Up @@ -151,16 +157,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
) {
if let pushManager = Container.shared.resolve(PushNotificationsManager.self) {
pushManager.didReceiveRemoteNotification(userInfo: userInfo)
guard let pushManager = Container.shared.resolve(PushNotificationsManager.self)
else {
completionHandler(.newData)
return
}
pushManager.didReceiveRemoteNotification(userInfo: userInfo)
completionHandler(.newData)
}

// Deep link
func configureDeepLinkServices(launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
if let deepLinkManager = Container.shared.resolve(DeepLinkManager.self) {
deepLinkManager.configureDeepLinkService(launchOptions: launchOptions)
}
guard let deepLinkManager = Container.shared.resolve(DeepLinkManager.self) else { return }
deepLinkManager.configureDeepLinkService(launchOptions: launchOptions)
}
}
4 changes: 1 addition & 3 deletions OpenEdX/Managers/DeepLinkManager/DeepLinkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ class DeepLinkManager {

// This method do redirect with link from push notification
func processLinkFromNotification(_ link: PushLink) {
if anyServiceEnabled {
// redirect if possible
}
// redirect if possible
}

// This method process the deep link with response parameters
Expand Down

0 comments on commit 3b93284

Please sign in to comment.