AndriousSolutions / ads

Other
58 stars 11 forks source link

iOS simulator? #2

Closed sjmcdowall closed 5 years ago

sjmcdowall commented 5 years ago

I'm trying to get this to work on an iOS simulator but its not clear at all what to use for the testDeivce for this pooch. I get the following in the log but using the value doesn't work:

To get test ads on this device, set: request.testDevices = @[ kGADSimulatorID ]; Is there a way to get the actual value of kGADSimulatorID from within Flutter?
Andrious commented 5 years ago

Whoa! I don't have any experience with Ads in iOS. Please, let us know what you find. I'm trying to Google what that is in the first place!

Andrious commented 5 years ago

Would this give you any leads??

To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];

sjmcdowall commented 5 years ago

No -- but I did figure it out. :)

FWIW -- Within Flutter you need to pass in the exact string 'Simulator' as a test device for iOS Simulators to work ... Which winds up being the hidden constant kGADSimulatorID that you see everywhere that we should use .. but that constant isn't available within Flutter (that I can see) ..

So I coded basically ..

const String testDevice = '7A99777F0A314417895182B0CE153EEF'; const String testIOSSimulator = 'Simulator';

Then ..

static const MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo( testDevices: testDevice != null ? [testDevice, testIOSSimulator] : null, keywords: [ 'games', 'esports', 'competition', 'social', 'fortnite', 'league of legends', 'moba', 'apex' ], contentUrl: 'https://metroesports.com', childDirected: false, );

And that did the trick ..

Andrious commented 5 years ago

And so, did you use the Ads package?

For example:

        Ads.setBannerAd(
          keywords: ['games',
          'esports',
          'competition',
          'social',
          'fortnite',
          'league of legends',
          'moba',
          'apex
          ],
          contentUrl: 'https://metroesports.com',
          childDirected: false,
          testDevices: testDevice != null ? [testDevice, testIOSSimulator] : null,
        );
sjmcdowall commented 5 years ago

That's the next step for the weekend!

Cheers

On Mar 24, 2019, at 3:55 PM, Andrious Solutions notifications@github.com wrote:

And so, did you use the Ads package?

For example:

    Ads.setBannerAd(
      keywords: ['games',
      'esports',
      'competition',
      'social',
      'fortnite',
      'league of legends',
      'moba',
      'apex
      ],
      contentUrl: 'https://metroesports.com',
      childDirected: false,
      testDevices: testDevice != null ? [testDevice, testIOSSimulator] : null,
    );

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AndriousSolutions/ads/issues/2#issuecomment-475993776, or mute the thread https://github.com/notifications/unsubscribe-auth/AB8M7RSm53fmIFsbofQ8y6RlN759k_8vks5vZ9hAgaJpZM4cFlAE.

Andrious commented 5 years ago

That's the next step for the weekend! Cheers

And so? How did it go that weekend?
Has the package worked for you?