Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated build to support google ads sdk 7.60.0. #144

Merged
merged 4 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ If you don't want or can't build the template by yourself, you can find a precom
- Internet
### iOS
- Drop the "admob" directory inside the "modules" directory on the Godot source;
- Download and extract the [Google Mobile Ads SDK](https://developers.google.com/admob/ios/download) **(<= 7.41.0)** inside the directory "admob/ios/lib"; (If you are unable to download the version informed above, you can alternatively download it through [Cocoapods](https://cocoapods.org/#install) or [HERE](https://srv-file6.gofile.io/download/iLaAUS/GoogleMobileAds_framework_7_41_0.zip))
- Download and extract the [Google Mobile Ads SDK](https://developers.google.com/admob/ios/download) **(>= 7.60.0)** inside the directory "admob/ios/lib"; (If you are unable to download the version informed above, you can alternatively download it through [Cocoapods](https://cocoapods.org/#install) or [HERE](https://srv-file6.gofile.io/download/iLaAUS/GoogleMobileAds_framework_7_60_0.zip))
- Follow the instructions provided by Google to [add the GADApplicationIdentifier to your Info.plist in XCode](https://developers.google.com/admob/ios/quick-start#update_your_infoplist). It is not necessary to add the frameworks to your XCode project, as they will be compiled and linked into the godot engine directly.
- [Recompile the iOS export template](http://docs.godotengine.org/en/stable/development/compiling/compiling_for_ios.html). (If you get some error, check this [issue](https://github.com/kloder-games/godot-admob/issues/87))

Configuring your game
Expand Down
42 changes: 39 additions & 3 deletions admob/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
def can_build(env, platform):
# Godot 2.1 only passes platform. Godot 3+ build passes env, platform
def can_build(*argv):
platform = argv[1] if len(argv) == 2 else argv[0]
return platform=="android" or platform=="iphone"

def configure(env):
Expand All @@ -9,6 +11,40 @@ def configure(env):
env.disable_module()

if env['platform'] == "iphone":
env.Append(FRAMEWORKPATH=['#modules/admob/ios/lib'])
xcframework_arch_directory = ''
if env['arch'] == 'x86_64':
xcframework_arch_directory = 'ios-x86_64-simulator'
else:
xcframework_arch_directory = 'ios-armv7_arm64'

env.Append(FRAMEWORKPATH=[
'#modules/admob/ios/lib',
'#modules/admob/ios/lib/GoogleUtilities.xcframework/' + xcframework_arch_directory,
'#modules/admob/ios/lib/nanopb.xcframework/' + xcframework_arch_directory,
'#modules/admob/ios/lib/PromisesObjC.xcframework/' + xcframework_arch_directory])

env.Append(CPPPATH=['#core'])
env.Append(LINKFLAGS=['-ObjC', '-framework','AdSupport', '-framework','CoreTelephony', '-framework','EventKit', '-framework','EventKitUI', '-framework','MessageUI', '-framework','StoreKit', '-framework','SafariServices', '-framework','CoreBluetooth', '-framework','AssetsLibrary', '-framework','CoreData', '-framework','CoreLocation', '-framework','CoreText', '-framework','ImageIO', '-framework', 'GLKit', '-framework','CoreVideo', '-framework', 'CFNetwork', '-framework', 'MobileCoreServices', '-framework', 'GoogleMobileAds'])
env.Append(LINKFLAGS=[
'-ObjC',
'-framework', 'AdSupport',
'-framework', 'CoreTelephony',
'-framework', 'EventKit',
'-framework', 'EventKitUI',
'-framework', 'MessageUI',
'-framework', 'StoreKit',
'-framework', 'SafariServices',
'-framework', 'CoreBluetooth',
'-framework', 'AssetsLibrary',
'-framework', 'CoreData',
'-framework', 'CoreLocation',
'-framework', 'CoreText',
'-framework', 'ImageIO',
'-framework', 'GLKit',
'-framework', 'CoreVideo',
'-framework', 'CFNetwork',
'-framework', 'MobileCoreServices',
'-framework', 'nanopb',
'-framework', 'PromisesObjC',
'-framework', 'GoogleUtilities',
'-framework', 'GoogleMobileAds',
'-framework', 'GoogleAppMeasurement'])
Empty file.
Empty file.
Empty file.
Empty file.