Skip to content

Commit

Permalink
Merge pull request #144 from pchasco/google-sdk-7.60.0-update
Browse files Browse the repository at this point in the history
Updated build to support google ads sdk 7.60.0.
  • Loading branch information
gumaciel authored Jun 18, 2020
2 parents 42b10a9 + 1b66816 commit 6406158
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
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.

0 comments on commit 6406158

Please sign in to comment.