Skip to content

Commit

Permalink
refactor(ios): change type of default value
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Oct 9, 2020
1 parent 2a84ca1 commit e2a3ca5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Plugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class AdMob: CAPPlugin, GADBannerViewDelegate, GADInterstitialDelegate, G
self.bannerView.adUnitID = adId
self.bannerView.rootViewController = UIApplication.shared.keyWindow?.rootViewController

self.bannerView.load(self.GADRequestWithOption(call.getBool("npa", false)!))
self.bannerView.load(self.GADRequestWithOption(call.getBool("npa") ?? false))
self.bannerView.delegate = self

call.success([
Expand Down Expand Up @@ -276,7 +276,7 @@ public class AdMob: CAPPlugin, GADBannerViewDelegate, GADInterstitialDelegate, G
*/
@objc func prepareInterstitial(_ call: CAPPluginCall) {
DispatchQueue.main.async {
let testingID = "ca-app-pub-3940256099942544/1033173712"
let testingID = "ca-app-pub-3940256099942544/1033173712"
var adUnitID = call.getString("adId") ?? testingID
let isTest = call.getBool("isTesting") ?? false
if isTest {
Expand All @@ -285,7 +285,7 @@ public class AdMob: CAPPlugin, GADBannerViewDelegate, GADInterstitialDelegate, G

self.interstitial = GADInterstitial(adUnitID: adUnitID)
self.interstitial.delegate = self
self.interstitial.load(self.GADRequestWithOption(call.getBool("npa", false)!))
self.interstitial.load(self.GADRequestWithOption(call.getBool("npa") ?? false))

call.success(["value": true])
}
Expand Down Expand Up @@ -356,7 +356,7 @@ public class AdMob: CAPPlugin, GADBannerViewDelegate, GADInterstitialDelegate, G
}

self.rewardedAd = GADRewardedAd(adUnitID: adUnitID)
self.rewardedAd?.load(self.GADRequestWithOption(call.getBool("npa", false)!)) { error in
self.rewardedAd?.load(self.GADRequestWithOption(call.getBool("npa") ?? false)) { error in
if let error = error {
NSLog("AdMob Reward: Loading failed: \(error)")
call.error("Loading failed")
Expand Down

0 comments on commit e2a3ca5

Please sign in to comment.