Handling GADResponseInfo on error response with iOS SDK v8

98 views
Skip to first unread message

Yuta Amakawa

unread,
May 26, 2021, 6:10:19 AM5/26/21
to Google Mobile Ads SDK Developers
I want to debug the error response for native ads using GADResponseInfo as shown in the page below, but GADRequestError has been replaced to NSError from SDK v8 which leads to an error: Value of type 'Error' has no member 'userInfo'
I'd like to know the workaround for v8.


```
    // MARK: - GADAdLoaderDelegate
    func adLoader(_ adLoader: GADAdLoader, didFailToReceiveAdWithError error: Error) {
        // Value of type 'Error' has no member 'userInfo'
        if let responseInfo = error.userInfo[GADErrorUserInfoKeyResponseInfo] as? GADResponseInfo {
            print(responseInfo)
        }
    }
```

Mobile Ads SDK Forum Advisor Prod

unread,
May 26, 2021, 10:19:09 AM5/26/21
to mki...@gmail.com, google-adm...@googlegroups.com
Hi Yuta,

Thank you for reporting this, I brought this to my team and we will get back to you as soon as possible.

Regards,

Google Logo
Aryeh Baker
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2HxwkU:ref

Mobile Ads SDK Forum Advisor

unread,
Dec 7, 2021, 3:26:46 AM12/7/21
to mki...@gmail.com, google-adm...@googlegroups.com

Hello Yuta,

I hope you're doing well.

I just want to circle back on this. The team recommend to keep the Error param and cast the object to the specific underlying error type (i.e. NSError) when trying to access its properties. Feel free to come back to us if you still encounter any issues regarding this.

Regards,

Google Logo
Princess Pamela Pineda
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2HxwkU:ref
Reply all
Reply to author
Forward
0 new messages