diff --git a/README.md b/README.md index 75e198c..42213f5 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_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 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