Skip to content

Commit

Permalink
refactor: fix the code if level
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir committed Jul 11, 2024
1 parent bea3014 commit 20e13e9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions OpenEdX/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// e-commerce URL, e-commerce URL is being used for IAP
if let storekitHandler = Container.shared.resolve(StoreKitHandlerProtocol.self),
config.ecommerceURL?.isEmpty == false {

storekitHandler.completeTransactions()

let pushManager = Container.shared.resolve(PushNotificationsManager.self)

if config.firebase.enabled {
FirebaseApp.configure()
if config.firebase.cloudMessagingEnabled {
Messaging.messaging().delegate = pushManager
UNUserNotificationCenter.current().delegate = pushManager
}
}

if pushManager?.hasProviders == true {
UIApplication.shared.registerForRemoteNotifications()
}

let pushManager = Container.shared.resolve(PushNotificationsManager.self)

if config.firebase.enabled {
FirebaseApp.configure()
if config.firebase.cloudMessagingEnabled {
Messaging.messaging().delegate = pushManager
UNUserNotificationCenter.current().delegate = pushManager
}
}

if pushManager?.hasProviders == true {
UIApplication.shared.registerForRemoteNotifications()
}
}

Theme.Fonts.registerFonts()
Expand Down

0 comments on commit 20e13e9

Please sign in to comment.