poingstudios / godot-admob-ios

Godot's AdMob Plugin for iOS with support for Mediations.
https://poingstudios.github.io/godot-admob-plugin/
MIT License
89 stars 14 forks source link

[FEATURE] Use Cocoapods to use Mobile Ads SDK instead of manual downloading #11

Closed gumaciel closed 2 years ago

gumaciel commented 2 years ago

Is your feature request related to a problem? Please describe. Using Cocoapods is recommended by the Google AdMob team to use for the reason of being a dependency manager and it is much simpler to download and use in the project besides changing/maintaining/updating the version whenever we want.

Additional context

  1. Use pod init to create a Podfile.
  2. Open Podfile and add pod 'Google-Mobile-Ads-SDK'
  3. Run pod install to install the Pods
gumaciel commented 2 years ago

@naithar I'm trying to do this implementation and i have some doubts, please can you help me?

  1. It's possible to use Cocoapods with a Godot iOS Plugin?
  2. When i build for "My Mac" it gives me this error Captura de Tela 2021-10-11 às 21 08 09

But when i build for "Any iOS", the build is succeeded Captura de Tela 2021-10-11 às 21 09 43

My doubt is: It's correct? Because before the Cocoapods migration the build for "My Mac" was working.

  1. The build with Scons is giving me error which i can't fix, i changed this on SConstruct but is not working: https://github.com/Poing-Studios/godot-admob-ios/commit/209ae9225267b988585baf2627bae2e8767a28f1#diff-d78c5c377c03dd251edc72cdb0ae7d9986fa08361eb392187218f8c670c0bc4eL73-R74

Error is: plugin/admob/src/main/admob.mm:11:9:{11:9-11:44}: fatal error: 'GoogleMobileAds/GoogleMobileAds.h' file not found [1]

Do you know if theres some change to do on the SConstruct to work with Cocoapods?

Btw, the commit of the try of migration is this: https://github.com/Poing-Studios/godot-admob-ios/commit/209ae9225267b988585baf2627bae2e8767a28f1

naithar commented 2 years ago
  1. It's possible to use Cocoapods with a Godot iOS Plugin?

I haven't tried it myself, but I see no reason why not.

  1. When i build for "My Mac" it gives me this error

CocoaPods might not be providing framework for MacOS, but I have no idea.

  1. The build with Scons is giving me error which i can't fix, i changed this on SConstruct but is not working: 209ae92#diff-d78c5c377c03dd251edc72cdb0ae7d9986fa08361eb392187218f8c670c0bc4eL73-R74

Error is: plugin/admob/src/main/admob.mm:11:9:{11:9-11:44}: fatal error: 'GoogleMobileAds/GoogleMobileAds.h' file not found [1]

You might be missing / at the end of .xcframework, though I'm not sure if it's the source of the issue. Paths also might not be correct, so you have to double check.

gumaciel commented 2 years ago

@naithar

The error was because of / at the end of .xcframework, thank you!

I managed to make CocoaPods work for development, but I couldn't use CocoaPods to export the Godot Game Project to Xcode, it will only work if the user converts the Godot Game Project .xcodeproj into a CocoaPods project, because I can't make it available to the user download all the .framework to export, because some frameworks like nanopb need to be compiled by Xcode, and I can't generate a .framework for the x86_64 simulator, just for arm64.

But no problem, I will continue to provide the latest version of the Google Mobile Ads SDK for the user to download and so it will work the same as it was before, thanks!