Deal with @import owrking on ObjC

Hi!

I’m trying to make Doubleclick SDK working on Fuse. I plan to post it on GitHub as soon as i get it working.

Now i’m on the iOS implementation. So far, it was painful (mainly be cause i hate ObjC :smiley: ), but things seems to be on the right direction now.

According with the instructions https://developers.google.com/mobile-ads-sdk/docs/dfp/ios/quick-start#cocoapods

On one part it states:

  • To resolve a compilation error, also include @import GoogleMobileAds in ViewController.h or import GoogleMobileAds in ViewController.swift so the compiler knows that DFPBannerView is a valid class.

That’s exactly the error i’m getting :smiley:

But after reading the Foreign Code manual (https://www.fusetools.com/docs/native-interop/foreign-code) it’s not clear, at least for me, how can i perform an equivalent for the @import GoogleMobileAds

Can you help me?

Thanks in advance!

John

Hi John,

I would expect it to be something similar to what can be observed in Fuse.Firebase implementation, somewhere around this place.

Hope this helps!

Hi Uldis!

Thanks for the help! Now it compiles. If i try to preview from Fuse interface, it shows an error on Xcode regarding the missing GoogleMobileAds pod.

But when i use this command line

fuse build -t=iOS -DCOCOAPODS -r

It keeps waiting for a device connected, but i don;t have one here until next week. Any idea how to preview on the iOS Simulator or at least to automatically install the pods on Xcode to run from there?

Thanks

John

Hi John,

you have constructed the build command almost right. The -r flag means “run on a connected device”. So you should remove it and add -d instead, which should open XCode, from where you can launch the iOS Simulator.

Edit: the command is fuse build -t=iOS -DCOCOAPODS -d

Related: there’s a known issue on Fuse 1.0.0 that it wouldn’t pick up -D flags when running fuse preview. To solve that, you can upgrade to Fuse 1.0.1 which is available on the QA downloads channel.

Thanks!

Now it seems to work. I’ll made some tests on real iOS devices next week. But for now it seems to work but not on simulator. I had this problem once with AdMob, so think it will be fixed soon.

If someone is interested on hosting Ads on Double Click and display on your app, here’s the code

Enjoy

John