From b396a9d2e57c4181daf0f300a8404b7e5f48f6ae Mon Sep 17 00:00:00 2001 From: Patrick Chasco Date: Wed, 27 May 2020 12:17:50 -0500 Subject: [PATCH 1/4] Updated build to support google ads sdk 7.60.0. Be sure to follow Google's official guide to add GADApplicationIdentifier to Info.plist in xcode --- admob/config.py | 42 +++++++++++++++++-- .../put_GoogleAppMeasurement.framework_here | 0 .../lib/put_GoogleUtilities.xcframework_here | 0 .../ios/lib/put_PromisesObjC.xcframework_here | 0 admob/ios/lib/put_nanopb.xcframework_here | 0 5 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 admob/ios/lib/put_GoogleAppMeasurement.framework_here create mode 100644 admob/ios/lib/put_GoogleUtilities.xcframework_here create mode 100644 admob/ios/lib/put_PromisesObjC.xcframework_here create mode 100644 admob/ios/lib/put_nanopb.xcframework_here diff --git a/admob/config.py b/admob/config.py index de4f33f..97edd96 100644 --- a/admob/config.py +++ b/admob/config.py @@ -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): @@ -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']) diff --git a/admob/ios/lib/put_GoogleAppMeasurement.framework_here b/admob/ios/lib/put_GoogleAppMeasurement.framework_here new file mode 100644 index 0000000..e69de29 diff --git a/admob/ios/lib/put_GoogleUtilities.xcframework_here b/admob/ios/lib/put_GoogleUtilities.xcframework_here new file mode 100644 index 0000000..e69de29 diff --git a/admob/ios/lib/put_PromisesObjC.xcframework_here b/admob/ios/lib/put_PromisesObjC.xcframework_here new file mode 100644 index 0000000..e69de29 diff --git a/admob/ios/lib/put_nanopb.xcframework_here b/admob/ios/lib/put_nanopb.xcframework_here new file mode 100644 index 0000000..e69de29 From 40158f8c5b3408f341210ec152a98302d2b08605 Mon Sep 17 00:00:00 2001 From: Patrick Chasco Date: Wed, 27 May 2020 12:23:46 -0500 Subject: [PATCH 2/4] Updated readme.md with instructions --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 75e198c..f709052 100644 --- a/README.md +++ b/README.md @@ -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_41_0.zip)) +- Follow the [instructions provided by Google](https://developers.google.com/admob/ios/quick-start#update_your_infoplist) to add the GADApplicationIdentifier to your Info.plist in XCode. 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 From 9f1f1b62d9736807c80f8b56367a1687c908250d Mon Sep 17 00:00:00 2001 From: Patrick Chasco Date: Wed, 27 May 2020 12:25:51 -0500 Subject: [PATCH 3/4] Updated link to google ads sdk 7.60.0 in readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f709052..47322c8 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ 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.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_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](https://developers.google.com/admob/ios/quick-start#update_your_infoplist) to add the GADApplicationIdentifier to your Info.plist in XCode. 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)) From 1b668162a62a9f676f1a652f33e13ba9da5f7cce Mon Sep 17 00:00:00 2001 From: Patrick Chasco Date: Wed, 27 May 2020 12:27:01 -0500 Subject: [PATCH 4/4] Formatting of readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47322c8..42213f5 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ If you don't want or can't build the template by yourself, you can find a precom ### 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.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](https://developers.google.com/admob/ios/quick-start#update_your_infoplist) to add the GADApplicationIdentifier to your Info.plist in XCode. It is not necessary to add the frameworks to your XCode project, as they will be compiled and linked into the godot engine directly. +- 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