@capacitor-community/admob 6.0.0 → 6.2.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorCommunityAdmob.podspec +1 -1
- package/README.md +261 -66
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +17 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java +10 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +84 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardInterstitialAdPluginEvents.kt +12 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardedInterstitialAdCallbackAndListeners.kt +50 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/models/SsvInfo.kt +20 -0
- package/dist/docs.json +340 -0
- package/dist/esm/definitions.d.ts +2 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/reward-interstitial/index.d.ts +4 -0
- package/dist/esm/reward-interstitial/index.js +5 -0
- package/dist/esm/reward-interstitial/index.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +25 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.d.ts +32 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js +35 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +30 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.d.ts +14 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js.map +1 -0
- package/dist/esm/web.d.ts +2 -0
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +47 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +47 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -17
- package/ios/Plugin/Banner/BannerAdPluginEvents.swift +0 -8
- package/ios/Plugin/Banner/BannerAdSizeEnum.swift +0 -10
- package/ios/Plugin/Banner/BannerExecutor.swift +0 -186
- package/ios/Plugin/Consent/ConsentExecutor.swift +0 -87
- package/ios/Plugin/Helper/AuthorizationStatusEnum.swift +0 -6
- package/ios/Plugin/Info.plist +0 -24
- package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +0 -65
- package/ios/Plugin/Interstitial/InterstitialAdPluginEvents.swift +0 -7
- package/ios/Plugin/Models/FullScreenAdEventName.swift +0 -12
- package/ios/Plugin/Plugin.h +0 -10
- package/ios/Plugin/Plugin.m +0 -23
- package/ios/Plugin/Plugin.swift +0 -275
- package/ios/Plugin/Rewarded/AdRewardExecutor.swift +0 -86
- package/ios/Plugin/Rewarded/RewardAdPluginEvents.swift +0 -8
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
|
-
import GoogleMobileAds
|
|
4
|
-
|
|
5
|
-
class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
6
|
-
public weak var plugin: AdMob?
|
|
7
|
-
var bannerView: GADBannerView!
|
|
8
|
-
|
|
9
|
-
func showBanner(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
|
|
10
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
11
|
-
|
|
12
|
-
let adSize = call.getString("adSize") ?? "ADAPTIVE_BANNER"
|
|
13
|
-
let adPosition = call.getString("position") ?? "BOTTOM_CENTER"
|
|
14
|
-
let adMargin = call.getInt("margin") ?? 0
|
|
15
|
-
|
|
16
|
-
var bannerSize: GADAdSize
|
|
17
|
-
|
|
18
|
-
switch adSize {
|
|
19
|
-
case "BANNER":
|
|
20
|
-
bannerSize = GADAdSizeBanner
|
|
21
|
-
break
|
|
22
|
-
case "LARGE_BANNER":
|
|
23
|
-
bannerSize = GADAdSizeLargeBanner
|
|
24
|
-
break
|
|
25
|
-
case "FULL_BANNER":
|
|
26
|
-
bannerSize = GADAdSizeFullBanner
|
|
27
|
-
break
|
|
28
|
-
case "LEADERBOARD":
|
|
29
|
-
bannerSize = GADAdSizeLeaderboard
|
|
30
|
-
break
|
|
31
|
-
case "MEDIUM_RECTANGLE":
|
|
32
|
-
bannerSize = GADAdSizeMediumRectangle
|
|
33
|
-
break
|
|
34
|
-
case "SMART_BANNER":
|
|
35
|
-
bannerSize = kGADAdSizeSmartBannerPortrait
|
|
36
|
-
break
|
|
37
|
-
default: // ADAPTIVE_BANNER
|
|
38
|
-
let frame = { () -> CGRect in
|
|
39
|
-
// Here safe area is taken into account, hence the view frame is used
|
|
40
|
-
// after the view has been laid out.
|
|
41
|
-
if #available(iOS 11.0, *) {
|
|
42
|
-
return rootViewController.view.frame.inset(by: rootViewController.view.safeAreaInsets)
|
|
43
|
-
} else {
|
|
44
|
-
return rootViewController.view.frame
|
|
45
|
-
}
|
|
46
|
-
}()
|
|
47
|
-
let viewWidth = frame.size.width
|
|
48
|
-
bannerSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
|
|
49
|
-
break
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
self.bannerView = GADBannerView(adSize: bannerSize)
|
|
53
|
-
self.addBannerViewToView(self.bannerView, adPosition, adMargin)
|
|
54
|
-
self.bannerView.translatesAutoresizingMaskIntoConstraints = false
|
|
55
|
-
self.bannerView.adUnitID = adUnitID
|
|
56
|
-
self.bannerView.rootViewController = plugin?.getRootVC()
|
|
57
|
-
|
|
58
|
-
self.bannerView.load(request)
|
|
59
|
-
self.bannerView.delegate = self
|
|
60
|
-
|
|
61
|
-
call.resolve([:])
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
func hideBanner(_ call: CAPPluginCall) {
|
|
66
|
-
DispatchQueue.main.async {
|
|
67
|
-
if let rootViewController = self.plugin?.getRootVC() {
|
|
68
|
-
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
69
|
-
NSLog("AdMob: find subView for hideBanner")
|
|
70
|
-
subView.isHidden = true
|
|
71
|
-
} else {
|
|
72
|
-
NSLog("AdMob: not find subView for resumeBanner for hideBanner")
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
|
|
77
|
-
"width": 0,
|
|
78
|
-
"height": 0
|
|
79
|
-
])
|
|
80
|
-
|
|
81
|
-
call.resolve([:])
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
func resumeBanner(_ call: CAPPluginCall) {
|
|
86
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
87
|
-
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
88
|
-
NSLog("AdMob: find subView for resumeBanner")
|
|
89
|
-
subView.isHidden = false
|
|
90
|
-
|
|
91
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
|
|
92
|
-
"width": subView.frame.width,
|
|
93
|
-
"height": subView.frame.height
|
|
94
|
-
])
|
|
95
|
-
|
|
96
|
-
call.resolve([:])
|
|
97
|
-
|
|
98
|
-
} else {
|
|
99
|
-
NSLog("AdMob: not find subView for resumeBanner")
|
|
100
|
-
call.reject("AdMob: not find subView for resumeBanner")
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
func removeBanner(_ call: CAPPluginCall) {
|
|
106
|
-
self.removeBannerViewToView()
|
|
107
|
-
call.resolve([:])
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
private func addBannerViewToView(_ bannerView: GADBannerView, _ adPosition: String, _ Margin: Int) {
|
|
111
|
-
removeBannerViewToView()
|
|
112
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
113
|
-
|
|
114
|
-
bannerView.translatesAutoresizingMaskIntoConstraints = false
|
|
115
|
-
bannerView.tag = 2743243288699 // rand
|
|
116
|
-
rootViewController.view.addSubview(bannerView)
|
|
117
|
-
rootViewController.view.addConstraints(
|
|
118
|
-
[NSLayoutConstraint(item: bannerView,
|
|
119
|
-
attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
|
|
120
|
-
relatedBy: .equal,
|
|
121
|
-
toItem: rootViewController.view.safeAreaLayoutGuide,
|
|
122
|
-
attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
|
|
123
|
-
multiplier: 1,
|
|
124
|
-
constant: CGFloat(Int(Margin) * -1)),
|
|
125
|
-
NSLayoutConstraint(item: bannerView,
|
|
126
|
-
attribute: .centerX,
|
|
127
|
-
relatedBy: .equal,
|
|
128
|
-
toItem: rootViewController.view,
|
|
129
|
-
attribute: .centerX,
|
|
130
|
-
multiplier: 1,
|
|
131
|
-
constant: 0)
|
|
132
|
-
])
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
private func removeBannerViewToView() {
|
|
137
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
138
|
-
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
139
|
-
bannerView.delegate = nil
|
|
140
|
-
NSLog("AdMob: find subView")
|
|
141
|
-
subView.removeFromSuperview()
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/// Tells the delegate an ad request loaded an ad.
|
|
147
|
-
public func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
|
|
148
|
-
NSLog("bannerViewDidReceiveAd")
|
|
149
|
-
|
|
150
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
|
|
151
|
-
"width": bannerView.frame.width,
|
|
152
|
-
"height": bannerView.frame.height
|
|
153
|
-
])
|
|
154
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.Loaded.rawValue, data: [:])
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/// Tells the delegate an ad request failed.
|
|
158
|
-
public func bannerView(_ bannerView: GADBannerView,
|
|
159
|
-
didFailToReceiveAdWithError error: Error) {
|
|
160
|
-
NSLog("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
|
|
161
|
-
self.removeBannerViewToView()
|
|
162
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
|
|
163
|
-
"width": 0,
|
|
164
|
-
"height": 0
|
|
165
|
-
])
|
|
166
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.FailedToLoad.rawValue, data: [
|
|
167
|
-
"code": 0,
|
|
168
|
-
"message": error.localizedDescription
|
|
169
|
-
])
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
public func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
|
|
173
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.AdImpression.rawValue, data: [:])
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/// Tells the delegate that a full-screen view will be presented in response
|
|
177
|
-
/// to the user clicking on an ad.
|
|
178
|
-
public func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
|
|
179
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.Opened.rawValue, data: [:])
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/// Tells the delegate that the full-screen view will be dismissed.
|
|
183
|
-
public func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
|
|
184
|
-
self.plugin?.notifyListeners(BannerAdPluginEvents.Closed.rawValue, data: [:])
|
|
185
|
-
}
|
|
186
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
|
-
import GoogleMobileAds
|
|
4
|
-
import UserMessagingPlatform
|
|
5
|
-
|
|
6
|
-
class ConsentExecutor: NSObject {
|
|
7
|
-
public weak var plugin: AdMob?
|
|
8
|
-
|
|
9
|
-
func requestConsentInfo(_ call: CAPPluginCall, _ debugGeography: Int, _ testDeviceIdentifiers: [String], _ tagForUnderAgeOfConsent: Bool) {
|
|
10
|
-
let parameters = UMPRequestParameters()
|
|
11
|
-
let debugSettings = UMPDebugSettings()
|
|
12
|
-
|
|
13
|
-
debugSettings.geography = UMPDebugGeography(rawValue: debugGeography) ?? UMPDebugGeography.disabled
|
|
14
|
-
debugSettings.testDeviceIdentifiers = testDeviceIdentifiers
|
|
15
|
-
|
|
16
|
-
parameters.debugSettings = debugSettings
|
|
17
|
-
parameters.tagForUnderAgeOfConsent = tagForUnderAgeOfConsent
|
|
18
|
-
|
|
19
|
-
// Request an update to the consent information.
|
|
20
|
-
UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(
|
|
21
|
-
with: parameters,
|
|
22
|
-
completionHandler: { error in
|
|
23
|
-
if error != nil {
|
|
24
|
-
call.reject("Request consent info failed")
|
|
25
|
-
} else {
|
|
26
|
-
call.resolve([
|
|
27
|
-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus),
|
|
28
|
-
"isConsentFormAvailable": UMPConsentInformation.sharedInstance.formStatus == UMPFormStatus.available
|
|
29
|
-
])
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
func showConsentForm(_ call: CAPPluginCall) {
|
|
35
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
36
|
-
let formStatus = UMPConsentInformation.sharedInstance.formStatus
|
|
37
|
-
|
|
38
|
-
if formStatus == UMPFormStatus.available {
|
|
39
|
-
UMPConsentForm.load(completionHandler: {form, loadError in
|
|
40
|
-
if loadError != nil {
|
|
41
|
-
call.reject(loadError?.localizedDescription ?? "Load consent form error")
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatus.required {
|
|
46
|
-
form?.present(from: rootViewController, completionHandler: { dismissError in
|
|
47
|
-
if dismissError != nil {
|
|
48
|
-
call.reject(dismissError?.localizedDescription ?? "Consent dismiss error")
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
call.resolve([
|
|
53
|
-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus)
|
|
54
|
-
])
|
|
55
|
-
})
|
|
56
|
-
} else {
|
|
57
|
-
call.resolve([
|
|
58
|
-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus)
|
|
59
|
-
])
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
} else {
|
|
63
|
-
call.reject("Consent Form not available")
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
call.reject("No ViewController")
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
func resetConsentInfo(_ call: CAPPluginCall) {
|
|
71
|
-
UMPConsentInformation.sharedInstance.reset()
|
|
72
|
-
call.resolve()
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
func getConsentStatusString(_ consentStatus: UMPConsentStatus) -> String {
|
|
76
|
-
switch consentStatus {
|
|
77
|
-
case UMPConsentStatus.required:
|
|
78
|
-
return "REQUIRED"
|
|
79
|
-
case UMPConsentStatus.notRequired:
|
|
80
|
-
return "NOT_REQUIRED"
|
|
81
|
-
case UMPConsentStatus.obtained:
|
|
82
|
-
return "OBTAINED"
|
|
83
|
-
default:
|
|
84
|
-
return "UNKNOWN"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
package/ios/Plugin/Info.plist
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
|
-
import GoogleMobileAds
|
|
4
|
-
|
|
5
|
-
class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
6
|
-
public weak var plugin: AdMob?
|
|
7
|
-
var interstitial: GADInterstitialAd!
|
|
8
|
-
|
|
9
|
-
func prepareInterstitial(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
|
|
10
|
-
GADInterstitialAd.load(
|
|
11
|
-
withAdUnitID: adUnitID,
|
|
12
|
-
request: request,
|
|
13
|
-
completionHandler: { (ad, error) in
|
|
14
|
-
if let error = error {
|
|
15
|
-
NSLog("Rewarded ad failed to load with error: \(error.localizedDescription)")
|
|
16
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.FailedToLoad.rawValue, data: [
|
|
17
|
-
"code": 0,
|
|
18
|
-
"message": error.localizedDescription
|
|
19
|
-
])
|
|
20
|
-
call.reject("Loading failed")
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
self.interstitial = ad
|
|
25
|
-
self.interstitial.fullScreenContentDelegate = self
|
|
26
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Loaded.rawValue, data: [
|
|
27
|
-
"adUnitId": adUnitID
|
|
28
|
-
])
|
|
29
|
-
call.resolve([
|
|
30
|
-
"adUnitId": adUnitID
|
|
31
|
-
])
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
func showInterstitial(_ call: CAPPluginCall) {
|
|
37
|
-
if let rootViewController = plugin?.getRootVC() {
|
|
38
|
-
if let ad = self.interstitial {
|
|
39
|
-
ad.present(fromRootViewController: rootViewController)
|
|
40
|
-
call.resolve([:])
|
|
41
|
-
} else {
|
|
42
|
-
NSLog("Ad wasn't ready")
|
|
43
|
-
call.reject("Ad wasn't ready")
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
|
|
49
|
-
NSLog("InterstitialFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
|
|
50
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.FailedToShow.rawValue, data: [
|
|
51
|
-
"code": 0,
|
|
52
|
-
"message": error.localizedDescription
|
|
53
|
-
])
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
57
|
-
NSLog("InterstitialFullScreenDelegate Ad did present full screen content.")
|
|
58
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Showed.rawValue, data: [:])
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
62
|
-
NSLog("InterstitialFullScreenDelegate Ad did dismiss full screen content.")
|
|
63
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Dismissed.rawValue, data: [:])
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
public enum InterstitialAdPluginEvents: String {
|
|
2
|
-
case Loaded = "interstitialAdLoaded"
|
|
3
|
-
case FailedToLoad = "interstitialAdFailedToLoad"
|
|
4
|
-
case Showed = "interstitialAdShowed"
|
|
5
|
-
case FailedToShow = "interstitialAdFailedToShow"
|
|
6
|
-
case Dismissed = "interstitialAdDismissed"
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
public enum FullScreenAdEventName: String {
|
|
2
|
-
case onAdLoaded = "onAdLoaded"
|
|
3
|
-
case onAdFailedToLoad = "onAdFailedToLoad"
|
|
4
|
-
case adDidPresentFullScreenContent = "adDidPresentFullScreenContent"
|
|
5
|
-
case didFailToPresentFullScreenContentWithError = "didFailToPresentFullScreenContentWithError"
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Follow iOS Event Name
|
|
9
|
-
* https://developers.google.com/admob/ios/api/reference/Protocols/GADFullScreenContentDelegate#-addidpresentfullscreencontent:
|
|
10
|
-
*/
|
|
11
|
-
case adDidDismissFullScreenContent = "adDidDismissFullScreenContent"
|
|
12
|
-
}
|
package/ios/Plugin/Plugin.h
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for Plugin.
|
|
4
|
-
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for Plugin.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
-
|
package/ios/Plugin/Plugin.m
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <Capacitor/Capacitor.h>
|
|
3
|
-
|
|
4
|
-
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
-
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
-
CAP_PLUGIN(AdMob, "AdMob",
|
|
7
|
-
CAP_PLUGIN_METHOD(initialize, CAPPluginReturnPromise);
|
|
8
|
-
CAP_PLUGIN_METHOD(trackingAuthorizationStatus, CAPPluginReturnPromise);
|
|
9
|
-
CAP_PLUGIN_METHOD(requestConsentInfo, CAPPluginReturnPromise);
|
|
10
|
-
CAP_PLUGIN_METHOD(requestTrackingAuthorization, CAPPluginReturnPromise);
|
|
11
|
-
CAP_PLUGIN_METHOD(showConsentForm, CAPPluginReturnPromise);
|
|
12
|
-
CAP_PLUGIN_METHOD(resetConsentInfo, CAPPluginReturnPromise);
|
|
13
|
-
CAP_PLUGIN_METHOD(setApplicationMuted, CAPPluginReturnPromise);
|
|
14
|
-
CAP_PLUGIN_METHOD(setApplicationVolume, CAPPluginReturnPromise);
|
|
15
|
-
CAP_PLUGIN_METHOD(showBanner, CAPPluginReturnPromise);
|
|
16
|
-
CAP_PLUGIN_METHOD(resumeBanner, CAPPluginReturnPromise);
|
|
17
|
-
CAP_PLUGIN_METHOD(hideBanner, CAPPluginReturnPromise);
|
|
18
|
-
CAP_PLUGIN_METHOD(removeBanner, CAPPluginReturnPromise);
|
|
19
|
-
CAP_PLUGIN_METHOD(prepareInterstitial, CAPPluginReturnPromise);
|
|
20
|
-
CAP_PLUGIN_METHOD(showInterstitial, CAPPluginReturnPromise);
|
|
21
|
-
CAP_PLUGIN_METHOD(prepareRewardVideoAd, CAPPluginReturnPromise);
|
|
22
|
-
CAP_PLUGIN_METHOD(showRewardVideoAd, CAPPluginReturnPromise);
|
|
23
|
-
)
|