If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002hytYFQAY&entry.80707362=001637022. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
|
||||||
Hello,
Michael here and I work along with Teejay.
Confirming that we have received the files you sent to us. However, upon testing the shared sample implementation, I was unable to test the behavior as I was constantly receiving an error on app build process. I have attached the screenshot of the error for your reference. With that, would you be able to share the steps to exactly replicate the reported behavior from building the app up to running it?
Can you also confirm if the issue is exclusively reproducible in iPhoneXR (simulator or real device) and/or iOS version:16.1.1?
Regards,
|
||||||
Hi,
Thank you for your response.
As mentioned by my colleague, we already received your sample app project as well as the video replication, however, we're unable to build your project to proceed for replication like the one on the video replication you've provided. Upon building your app, we're encountering an error "Command: PhaseScriptExecution failed with non zero exit code". Can you confirm if you're able to encounter this error in your end while building your app in the simulator? In addition to that, can you provide us privately a Charles log (see instruction here) capturing the ads?
You can provide the following details via reply privately to author option or directly provide it to the link below.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
Regards,
|
||||||
|
||||||
Hi,
Thank you for patiently waiting.
With regard to your concern for audio that wasn't working after the rewarded ad, can you confirm if you're using AudioVideoManager to manage your audio states?
//
// ViewController.swift
// mv_to_ios
//
// Created by mac-user on 2020/06/21.
// Copyright © 2020 developer. All rights reserved.
//
import UIKit
import WebKit
import GoogleMobileAds
import AppTrackingTransparency
import AdSupport
class ViewController: UIViewController {
private var webView: WKWebView!
private var scriptHandler: ScriptHandler!
private var bannerView: GADBannerView!
private var isLoadedBanner = false
private var isLoadedWebView = false
weak var delegate: (GADAudioVideoManagerDelegate)?
override func viewDidLoad() {
super.viewDidLoad()
print("viewDidLoad")
// Do any additional setup after loading the view.
}
override func viewDidAppear(_ animated: Bool) {
print("viewDidAppear")
if (isLoadedWebView) {
return
}
createBannerView()
createWebview()
let url = URL(string: "rpgmv:///index.html")!
webView.load(URLRequest(url:url))
isLoadedWebView = true
checkTrackingAuthorization()
Advertisement.shared.loadRewardedAd(onLoaded: nil, onFailed: nil)
Advertisement.shared.loadInterstitialAd()
if !Constants.handleAdBannerDisplay {
loadBanner()
}
}
//MARK: - WebView
func getWebviewFrame() -> CGRect {
let screenWidth:CGFloat = view.frame.size.width
var screenHeight:CGFloat = view.frame.size.height
var window = UIWindow()
for win in UIApplication.shared.windows {
if win.isKeyWindow {
window = win
}
}
let topPadding = window.safeAreaInsets.top
let bottomPadding = window.safeAreaInsets.bottom
screenHeight = screenHeight - topPadding - bottomPadding
var y:CGFloat = topPadding
let bannerViewSize = getAdSize()
if bannerView != nil {
screenHeight -= bannerViewSize.size.height
if Constants.adBannerPosition == "top" {
y += bannerViewSize.size.height
}
}
let rect = CGRect(x: 0, y: y, width: screenWidth, height: screenHeight)
return rect
}
func createWebview() {
if webView != nil {
webView.removeFromSuperview()
}
let config = WKWebViewConfiguration()
config.setURLSchemeHandler(MVCustomSchemeHandler(), forURLScheme: "rpgmv")
// scriptHandler
scriptHandler = ScriptHandler()
config.userContentController = scriptHandler.setUserContentController()
self.webView = WKWebView(frame: getWebviewFrame(), configuration: config)
self.view.addSubview(self.webView)
self.webView.translatesAutoresizingMaskIntoConstraints = true
self.webView.scrollView.bounces = false
scriptHandler.setWebView(_webView: self.webView)
scriptHandler.setViewController(_viewController: self)
}
//MARK: - BannerView
func getAdSize() -> GADAdSize {
let frame = { () -> CGRect in
if #available(iOS 11.0, *) {
return view.frame.inset(by: view.safeAreaInsets)
} else {
return view.frame
}
}()
let viewWidth = frame.size.width
let adSize:GADAdSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
return adSize
}
func createBannerView() {
if bannerView != nil {
bannerView.removeFromSuperview()
}
if Constants.adBannerUnitId.isEmpty {
bannerView = nil
return
}
bannerView = GADBannerView(adSize: GADAdSizeBanner)
bannerView.adUnitID = Constants.adBannerUnitId
bannerView.rootViewController = self
bannerView.adSize = getAdSize()
bannerView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(bannerView)
let attribute = (Constants.adBannerPosition == "top") ? NSLayoutConstraint.Attribute.top : NSLayoutConstraint.Attribute.bottom
view.addConstraints([
NSLayoutConstraint(item: bannerView!,
attribute: attribute,
relatedBy: .equal,
toItem: view.safeAreaLayoutGuide,
attribute: attribute,
multiplier: 1,
constant: 0),
NSLayoutConstraint(item: bannerView!,
attribute: .centerX,
relatedBy: .equal,
toItem: view,
attribute: .centerX,
multiplier: 1,
constant: 0),
])
}
func loadBanner() {
if bannerView == nil || isLoadedBanner {
return
}
bannerView.load(GADRequest())
isLoadedBanner = true
}
func checkTrackingAuthorization() {
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization( completionHandler: { status in
switch status {
case .authorized:
GADMobileAds.sharedInstance().start(completionHandler: nil)
print("requestTrackingAuthorization = authorized")
case .notDetermined:
print("requestTrackingAuthorization = notDetermined")
case .restricted:
print("requestTrackingAuthorization = restricted")
case .denied:
print("requestTrackingAuthorization = denied")
@unknown default:
fatalError()
}
})
} else {
GADMobileAds.sharedInstance().start(completionHandler: nil)
}
}
func setUp() {
GADMobileAds.sharedInstance().audioVideoManager.delegate = self
GADMobileAds.sharedInstance().audioVideoManager.audioSessionIsApplicationManaged = false
}
func myAppWillStartPlayingMusic() {
// Mutes all Google video ads.
GADMobileAds.sharedInstance().audioVideoManager.audioSessionIsApplicationManaged = true
GADMobileAds.sharedInstance().applicationMuted = true
}
func myAppDidStopPlayingMusic() {
// Un-mutes all of our video ads.
GADMobileAds.sharedInstance().audioVideoManager.audioSessionIsApplicationManaged = false
GADMobileAds.sharedInstance().applicationMuted = false
}
// MARK: - GADAudioVideoManagerDelegate
func audioVideoManagerWillPlayAudio(_ audioVideoManager: GADAudioVideoManager) {
// The mobile ads SDK is notifying your app that it will play audio. You
// could optionally pause music depending on your apps design.
MyAppObject.sharedInstance().pauseAllMusic()
}
func audioVideoManagerDidStopPlayingAudio(_ audioVideoManager: GADAudioVideoManager) {
// The mobile ads SDK is notifying your app that it has stopped playing
// audio. Depending on your design, you could resume music here.
MyAppObject.sharedInstance().resumeAllMusic()
}
}
![]() |
Mobile Ads SDK Team |