Skip to content

Commit a4718d0

Browse files
committed
Fixed an issue with sb identifiers
1 parent a74054b commit a4718d0

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed
Binary file not shown.

Spaced/AppDelegate.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
9393
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
9494
print("📲 Background notification tapped")
9595

96-
// let subtitle = response.notification.request.content.subtitle
9796
let userInfo = response.notification.request.content.userInfo as NSDictionary
98-
9997
if let categoryId = userInfo["categoryId"] as? String, let factId = userInfo["factId"] as? String {
10098
// Deeplink to answer page
10199

102100
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
103-
let vc = mainStoryboard.instantiateViewController(withIdentifier: "Fact") as? FactViewController
101+
let vc = mainStoryboard.instantiateViewController(withIdentifier: "AnswerFact") as? FactViewController
104102
vc?.selectedCategoryId = categoryId
105103
vc?.selectedTaskId = factId
106104

107-
let tabCtrl = UIApplication.shared.keyWindow?.rootViewController as! UITabBarController
108-
// let tabCtrl = self.window?.rootViewController as! UITabBarController
109-
tabCtrl.present(vc!, animated: true, completion: nil)
110-
105+
let tabCtrl = UIApplication.shared.keyWindow?.rootViewController as? UITabBarController
106+
if let answerVc = vc {
107+
tabCtrl?.present(answerVc, animated: true, completion: nil)
108+
}
111109
completionHandler()
112110
}
113111
}

Spaced/ViewControllers/SettingsViewController.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ class SettingsViewController: UIViewController, GADRewardBasedVideoAdDelegate {
3030
print("Checking ad")
3131
print(rewardBasedVideo?.isReady ?? "")
3232

33-
// if rewardBasedVideo?.isReady == true {
33+
if rewardBasedVideo?.isReady == true {
3434
rewardBasedVideo?.present(fromRootViewController: self)
35-
// }
35+
}
3636
}
37-
38-
39-
37+
4038
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd,
4139
didFailToLoadWithError error: Error) {
4240
print("Reward based video ad failed to load: \(error.localizedDescription)")

0 commit comments

Comments
 (0)