Skip to content

Commit 5f706f3

Browse files
authored
Update GMA SDK Version, DevApp To Use Interstitial Ads, Add Obj-C Annotations (#8)
* Updating IMA SDK and UID SDK Version Dependencies * Explicit Objective-C Support For SDK Classes * Adding StoreKit For SKAdNetwork Support * Implementing Rewarded Interstitial Example Code * Adding UID2 Test Data; Reformatting Code * License & Rename To GameViewController
1 parent 2885131 commit 5f706f3

File tree

13 files changed

+507
-338
lines changed

13 files changed

+507
-338
lines changed

Development/UID2GoogleGMADevelopmentApp/UID2GoogleGMADevelopmentApp.xcodeproj/project.pbxproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
A217470F29E79B5600EC20DF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217470E29E79B5600EC20DF /* AppDelegate.swift */; };
11-
A217471129E79B5600EC20DF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217471029E79B5600EC20DF /* SceneDelegate.swift */; };
12-
A217471329E79B5600EC20DF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217471229E79B5600EC20DF /* ViewController.swift */; };
11+
A217471329E79B5600EC20DF /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217471229E79B5600EC20DF /* GameViewController.swift */; };
1312
A217471629E79B5600EC20DF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A217471429E79B5600EC20DF /* Main.storyboard */; };
1413
A217471829E79B5600EC20DF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A217471729E79B5600EC20DF /* Assets.xcassets */; };
1514
A217471B29E79B5600EC20DF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A217471929E79B5600EC20DF /* LaunchScreen.storyboard */; };
@@ -18,13 +17,13 @@
1817
E23A114D29E84C4800FAE364 /* uid2identity.json in Resources */ = {isa = PBXBuildFile; fileRef = E23A114929E84C4700FAE364 /* uid2identity.json */; };
1918
E23A114E29E84C4800FAE364 /* String+AppExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23A114A29E84C4800FAE364 /* String+AppExtensions.swift */; };
2019
E23A114F29E84C4800FAE364 /* AppDataLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23A114B29E84C4800FAE364 /* AppDataLoader.swift */; };
20+
E269E12D2A4F518500574FEF /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E269E12C2A4F518500574FEF /* StoreKit.framework */; };
2121
/* End PBXBuildFile section */
2222

2323
/* Begin PBXFileReference section */
2424
A217470B29E79B5600EC20DF /* UID2GoogleGMADevelopmentApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UID2GoogleGMADevelopmentApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
2525
A217470E29E79B5600EC20DF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
26-
A217471029E79B5600EC20DF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
27-
A217471229E79B5600EC20DF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
26+
A217471229E79B5600EC20DF /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = "<group>"; };
2827
A217471529E79B5600EC20DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2928
A217471729E79B5600EC20DF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3029
A217471A29E79B5600EC20DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -34,6 +33,7 @@
3433
E23A114929E84C4700FAE364 /* uid2identity.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = uid2identity.json; sourceTree = "<group>"; };
3534
E23A114A29E84C4800FAE364 /* String+AppExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+AppExtensions.swift"; sourceTree = "<group>"; };
3635
E23A114B29E84C4800FAE364 /* AppDataLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDataLoader.swift; sourceTree = "<group>"; };
36+
E269E12C2A4F518500574FEF /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
3737
/* End PBXFileReference section */
3838

3939
/* Begin PBXFrameworksBuildPhase section */
@@ -42,6 +42,7 @@
4242
buildActionMask = 2147483647;
4343
files = (
4444
A2E7019029E7A5DA00B9DFA1 /* UID2GMAPlugin in Frameworks */,
45+
E269E12D2A4F518500574FEF /* StoreKit.framework in Frameworks */,
4546
);
4647
runOnlyForDeploymentPostprocessing = 0;
4748
};
@@ -71,8 +72,7 @@
7172
children = (
7273
E23A114729E84C2800FAE364 /* AppData */,
7374
A217470E29E79B5600EC20DF /* AppDelegate.swift */,
74-
A217471029E79B5600EC20DF /* SceneDelegate.swift */,
75-
A217471229E79B5600EC20DF /* ViewController.swift */,
75+
A217471229E79B5600EC20DF /* GameViewController.swift */,
7676
A217471429E79B5600EC20DF /* Main.storyboard */,
7777
A217471729E79B5600EC20DF /* Assets.xcassets */,
7878
A217471929E79B5600EC20DF /* LaunchScreen.storyboard */,
@@ -92,6 +92,7 @@
9292
A2E7018E29E7A5DA00B9DFA1 /* Frameworks */ = {
9393
isa = PBXGroup;
9494
children = (
95+
E269E12C2A4F518500574FEF /* StoreKit.framework */,
9596
);
9697
name = Frameworks;
9798
sourceTree = "<group>";
@@ -203,12 +204,11 @@
203204
isa = PBXSourcesBuildPhase;
204205
buildActionMask = 2147483647;
205206
files = (
206-
A217471329E79B5600EC20DF /* ViewController.swift in Sources */,
207+
A217471329E79B5600EC20DF /* GameViewController.swift in Sources */,
207208
E23A114E29E84C4800FAE364 /* String+AppExtensions.swift in Sources */,
208209
E23A114F29E84C4800FAE364 /* AppDataLoader.swift in Sources */,
209210
E23A114C29E84C4800FAE364 /* Date+AppExtensions.swift in Sources */,
210211
A217470F29E79B5600EC20DF /* AppDelegate.swift in Sources */,
211-
A217471129E79B5600EC20DF /* SceneDelegate.swift in Sources */,
212212
);
213213
runOnlyForDeploymentPostprocessing = 0;
214214
};
@@ -361,7 +361,7 @@
361361
GENERATE_INFOPLIST_FILE = YES;
362362
INFOPLIST_FILE = UID2GoogleGMADevelopmentApp/Info.plist;
363363
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
364-
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
364+
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
365365
INFOPLIST_KEY_UIMainStoryboardFile = Main;
366366
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
367367
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
@@ -392,7 +392,7 @@
392392
GENERATE_INFOPLIST_FILE = YES;
393393
INFOPLIST_FILE = UID2GoogleGMADevelopmentApp/Info.plist;
394394
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
395-
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
395+
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
396396
INFOPLIST_KEY_UIMainStoryboardFile = Main;
397397
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
398398
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";

Development/UID2GoogleGMADevelopmentApp/UID2GoogleGMADevelopmentApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"kind" : "remoteSourceControl",
4242
"location" : "https://github.com/googleads/swift-package-manager-google-mobile-ads.git",
4343
"state" : {
44-
"revision" : "886501bfff8bd8cc22899de2c1779e479c96f9ff",
45-
"version" : "10.3.0"
44+
"revision" : "a6e24f2167295d95371bfc3049e47381a73a9e43",
45+
"version" : "10.7.0"
4646
}
4747
},
4848
{
@@ -59,8 +59,8 @@
5959
"kind" : "remoteSourceControl",
6060
"location" : "https://github.com/IABTechLab/uid2-ios-sdk.git",
6161
"state" : {
62-
"revision" : "9706cbc8959593a81e5aea82926bc41ac9bbb9d3",
63-
"version" : "0.1.0"
62+
"revision" : "6204cbc27ef3bd48065e1fbd355958a6f03e248c",
63+
"version" : "0.2.0"
6464
}
6565
}
6666
],

Development/UID2GoogleGMADevelopmentApp/UID2GoogleGMADevelopmentApp/AppDelegate.swift

+3-15
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,15 @@ import UIKit
1111
@main
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
1313

14+
var window: UIWindow?
15+
1416
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1517
// Override point for customization after application launch.
1618

1719
// Initialize Google Mobile Ads SDK
18-
GADMobileAds.sharedInstance().start(completionHandler: nil)
20+
GADMobileAds.sharedInstance().start()
1921

2022
return true
2123
}
2224

23-
// MARK: UISceneSession Lifecycle
24-
25-
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
26-
// Called when a new scene session is being created.
27-
// Use this method to select a configuration to create the new scene with.
28-
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
29-
}
30-
31-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
32-
// Called when the user discards a scene session.
33-
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
34-
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
35-
}
36-
3725
}
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,74 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13528" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3-
<device id="retina5_9" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
63
<dependencies>
7-
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13526"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
95
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
106
</dependencies>
117
<scenes>
12-
<!--View Controller-->
8+
<!--Game View Controller-->
139
<scene sceneID="tne-QT-ifu">
1410
<objects>
15-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="BannerExample" customModuleProvider="target" sceneMemberID="viewController">
11+
<viewController id="BYZ-38-t0r" customClass="GameViewController" customModule="RewardedInterstitialExample" customModuleProvider="target" sceneMemberID="viewController">
1612
<layoutGuides>
17-
<viewControllerLayoutGuide type="top" id="TWU-f5-Eu7"/>
18-
<viewControllerLayoutGuide type="bottom" id="3Le-Kg-LNi"/>
13+
<viewControllerLayoutGuide type="top" id="utH-8i-3AW"/>
14+
<viewControllerLayoutGuide type="bottom" id="v0e-zY-aqb"/>
1915
</layoutGuides>
2016
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
21-
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
17+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
2218
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2319
<subviews>
24-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HpA-oj-RQs" customClass="GADBannerView">
25-
<rect key="frame" x="27.666666666666657" y="728" width="320" height="50"/>
26-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
27-
<constraints>
28-
<constraint firstAttribute="width" constant="320" id="TxW-US-Ckc"/>
29-
<constraint firstAttribute="height" constant="50" id="c8F-jN-qA7"/>
30-
</constraints>
31-
</view>
20+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="The Impossible Game" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6IL-to-DZf">
21+
<rect key="frame" x="12" y="50" width="390" height="36"/>
22+
<fontDescription key="fontDescription" type="system" pointSize="30"/>
23+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
24+
<nil key="highlightedColor"/>
25+
</label>
26+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NoO-Ga-hur">
27+
<rect key="frame" x="20" y="482.5" width="374" height="41"/>
28+
<fontDescription key="fontDescription" type="system" pointSize="24"/>
29+
<state key="normal" title="Play Again">
30+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
31+
</state>
32+
<connections>
33+
<action selector="playAgain:" destination="BYZ-38-t0r" eventType="touchUpInside" id="8PF-rz-hFt"/>
34+
</connections>
35+
</button>
36+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Game Started" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wpQ-a9-WRd">
37+
<rect key="frame" x="135.5" y="433.5" width="143" height="29"/>
38+
<fontDescription key="fontDescription" type="system" pointSize="24"/>
39+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
40+
<nil key="highlightedColor"/>
41+
</label>
42+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Coins: 0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AIa-H4-RwK" userLabel="Label">
43+
<rect key="frame" x="40" y="855" width="63" height="21"/>
44+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
45+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
46+
<nil key="highlightedColor"/>
47+
</label>
3248
</subviews>
3349
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3450
<constraints>
35-
<constraint firstItem="HpA-oj-RQs" firstAttribute="bottom" secondItem="3Le-Kg-LNi" secondAttribute="top" id="8jY-pF-pXR"/>
36-
<constraint firstAttribute="centerX" secondItem="HpA-oj-RQs" secondAttribute="centerX" id="WpR-yO-ukg"/>
51+
<constraint firstAttribute="trailingMargin" secondItem="NoO-Ga-hur" secondAttribute="trailing" id="0oN-7D-qbb"/>
52+
<constraint firstItem="v0e-zY-aqb" firstAttribute="top" secondItem="AIa-H4-RwK" secondAttribute="bottom" constant="20" id="LXH-0h-fnd"/>
53+
<constraint firstItem="wpQ-a9-WRd" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="Rj7-wA-EE9"/>
54+
<constraint firstItem="6IL-to-DZf" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-8" id="WGr-Js-IQC"/>
55+
<constraint firstItem="6IL-to-DZf" firstAttribute="top" secondItem="utH-8i-3AW" secondAttribute="bottom" constant="50" id="XtW-vs-4Pk"/>
56+
<constraint firstAttribute="leadingMargin" secondItem="NoO-Ga-hur" secondAttribute="leading" id="ZYv-Kl-Jml"/>
57+
<constraint firstItem="NoO-Ga-hur" firstAttribute="top" secondItem="wpQ-a9-WRd" secondAttribute="bottom" constant="20" id="c67-gY-PSX"/>
58+
<constraint firstAttribute="trailingMargin" secondItem="6IL-to-DZf" secondAttribute="trailing" constant="-8" id="hCf-OY-DWm"/>
59+
<constraint firstItem="wpQ-a9-WRd" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="t4z-bx-Lo4"/>
60+
<constraint firstItem="AIa-H4-RwK" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="20" id="tiQ-7b-xtL"/>
3761
</constraints>
3862
</view>
3963
<connections>
40-
<outlet property="bannerView" destination="HpA-oj-RQs" id="fFs-Wi-V7a"/>
64+
<outlet property="coinCountLabel" destination="AIa-H4-RwK" id="pwz-Kn-Y5S"/>
65+
<outlet property="gameText" destination="wpQ-a9-WRd" id="jgH-bl-10i"/>
66+
<outlet property="playAgainButton" destination="NoO-Ga-hur" id="NmL-nh-1EK"/>
4167
</connections>
4268
</viewController>
4369
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
4470
</objects>
45-
<point key="canvasLocation" x="128" y="406.59333333333331"/>
71+
<point key="canvasLocation" x="181.15942028985509" y="246.42857142857142"/>
4672
</scene>
4773
</scenes>
48-
</document>
74+
</document>

0 commit comments

Comments
 (0)