Hi,
I am also trying to get this to work inside our application. I can get our DFP native test ad successfully by modifying AdUnitId in the sample app. I am using a singleton and by adding to sample app and making a call I successfully get our test ad. But using this code in my app fails to work for both simulator and device. I have copied bundleIds etc. but cannot find what is causing the problem. In addition, I cannot get any testAds in our application. I get either "no ads to show" or the following error;
### didFailToReceiveAdWithError Error Domain=com.google.ads Code=13 "Request Error: Received invalid response." UserInfo={NSLocalizedDescription=Request Error: Received invalid response., NSLocalizedFailureReason=Request Error: Received invalid response.}
Here is my code;
GADMultipleAdsAdLoaderOptions * multipleAdOptions = [GADMultipleAdsAdLoaderOptions new];
multipleAdOptions.numberOfAds = count < 5 ? count : 5;
self.adLoader = [[GADAdLoader alloc]
initWithAdUnitID:AdUnitID
rootViewController:nil
adTypes:@[kGADAdLoaderAdTypeNativeContent]
options:@[multipleAdOptions]];
self.adLoader.delegate = self;
self.nativeAds = [NSMutableArray array];
DFPRequest * request = [DFPRequest request];
//request.testDevices = @[kDFPSimulatorID];
[self.adLoader loadRequest:request];
Is there anything else to check? I have scoured the plists and looked for additional files. I even reset the AdvertisingIds and ensure there was not ad limiting. Initially we thought there might be a need to register the bundleId in DFP but we tested this with the sample apps and there seems to be no effect with unknown bundleIds.
Xcode 9.2 running on macOS 10.13.2
Tested using iPhone 7 simulator 10.3 and 11.2 and iPhone X 11.2
Here is an except from my pods lock file;
PODS:
- Bolts (1.8.4):
- Bolts/AppLinks (= 1.8.4)
- Bolts/Tasks (= 1.8.4)
- Bolts/AppLinks (1.8.4):
- Bolts/Tasks
- Bolts/Tasks (1.8.4)
- CocoaLumberjack (3.3.0):
- CocoaLumberjack/Default (= 3.3.0)
- CocoaLumberjack/Extensions (= 3.3.0)
- CocoaLumberjack/Default (3.3.0)
- CocoaLumberjack/Extensions (3.3.0):
- CocoaLumberjack/Default
- ColorUtils (1.1.2)
- Crashlytics (3.9.3):
- Fabric (~> 1.7.2)
- Fabric (1.7.2)
- FBSDKCoreKit (4.29.0):
- Bolts (~> 1.7)
- FBSDKLoginKit (4.29.0):
- FBSDKCoreKit
- Google-Mobile-Ads-SDK (7.26.0)
- GoogleAnalytics (3.17.0)
- GTMNSStringHTMLAdditions (0.1.0)
- JSQSystemSoundPlayer (4.4.0)
- MBProgressHUD (0.9.2)
- Realm (3.0.2):
- Realm/Headers (= 3.0.2)
- Realm/Headers (3.0.2)
- RealReachability (1.1.9):
- RealReachability/Connection (= 1.1.9)
- RealReachability/Ping (= 1.1.9)
- RealReachability/Connection (1.1.9)
- RealReachability/Ping (1.1.9)
- SDWebImage (4.2.2):
- SDWebImage/Core (= 4.2.2)
- SDWebImage/Core (4.2.2)
- TOCropViewController (2.0.12)
- TTTAttributedLabel (2.0.0)
Any help would be appreciated.
Regards
Micheal