Skip to content

Commit

Permalink
Included UMP integration to FullScreenNativeExample. Updated UI/UX to…
Browse files Browse the repository at this point in the history
… FullScreenNativeExample

PiperOrigin-RevId: 657829318
  • Loading branch information
Justin Malandruccolo authored and maddevrelgithubbot committed Jul 31, 2024
1 parent 55566b6 commit a075093
Show file tree
Hide file tree
Showing 9 changed files with 457 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,30 @@
objects = {

/* Begin PBXBuildFile section */
A864A1E42C5199560030C5CA /* GoogleMobileAdsConsentManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A864A1E22C5199560030C5CA /* GoogleMobileAdsConsentManager.m */; };
A8C4B65D2C52B1E4005E047B /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A8C4B65C2C52B1E4005E047B /* MainViewController.m */; };
EF5BBBF228F4816400DBC4FA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5BBBE728F4816400DBC4FA /* AppDelegate.m */; };
EF5BBBF328F4816400DBC4FA /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = EF5BBBE828F4816400DBC4FA /* LaunchScreen.xib */; };
EF5BBBF428F4816400DBC4FA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EF5BBBEA28F4816400DBC4FA /* Main.storyboard */; };
EF5BBBF528F4816400DBC4FA /* NativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = EF5BBBEC28F4816400DBC4FA /* NativeAdView.xib */; };
EF5BBBF728F4816400DBC4FA /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5BBBF028F4816400DBC4FA /* ViewController.m */; };
EF5BBBF728F4816400DBC4FA /* NativeAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5BBBF028F4816400DBC4FA /* NativeAdViewController.m */; };
EF5BBBF828F4816400DBC4FA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EF5BBBF128F4816400DBC4FA /* main.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
A864A1E22C5199560030C5CA /* GoogleMobileAdsConsentManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoogleMobileAdsConsentManager.m; sourceTree = "<group>"; };
A864A1E32C5199560030C5CA /* GoogleMobileAdsConsentManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoogleMobileAdsConsentManager.h; sourceTree = "<group>"; };
A8C4B65B2C52B1E4005E047B /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
A8C4B65C2C52B1E4005E047B /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
CF9335B71B26706400DEF1B4 /* FullScreenNativeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FullScreenNativeExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
EF5BBBE628F4816400DBC4FA /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
EF5BBBE728F4816400DBC4FA /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
EF5BBBE928F4816400DBC4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
EF5BBBEB28F4816400DBC4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
EF5BBBED28F4816400DBC4FA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/NativeAdView.xib; sourceTree = "<group>"; };
EF5BBBEE28F4816400DBC4FA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
EF5BBBEF28F4816400DBC4FA /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
EF5BBBF028F4816400DBC4FA /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
EF5BBBEF28F4816400DBC4FA /* NativeAdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeAdViewController.h; sourceTree = "<group>"; };
EF5BBBF028F4816400DBC4FA /* NativeAdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeAdViewController.m; sourceTree = "<group>"; };
EF5BBBF128F4816400DBC4FA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -68,12 +74,16 @@
children = (
EF5BBBE628F4816400DBC4FA /* AppDelegate.h */,
EF5BBBE728F4816400DBC4FA /* AppDelegate.m */,
A864A1E32C5199560030C5CA /* GoogleMobileAdsConsentManager.h */,
A864A1E22C5199560030C5CA /* GoogleMobileAdsConsentManager.m */,
EF5BBBE828F4816400DBC4FA /* LaunchScreen.xib */,
EF5BBBEA28F4816400DBC4FA /* Main.storyboard */,
EF5BBBEC28F4816400DBC4FA /* NativeAdView.xib */,
EF5BBBEE28F4816400DBC4FA /* Info.plist */,
EF5BBBEF28F4816400DBC4FA /* ViewController.h */,
EF5BBBF028F4816400DBC4FA /* ViewController.m */,
A8C4B65B2C52B1E4005E047B /* MainViewController.h */,
A8C4B65C2C52B1E4005E047B /* MainViewController.m */,
EF5BBBEF28F4816400DBC4FA /* NativeAdViewController.h */,
EF5BBBF028F4816400DBC4FA /* NativeAdViewController.m */,
EF5BBBF128F4816400DBC4FA /* main.m */,
);
path = FullScreenNativeExample;
Expand Down Expand Up @@ -150,9 +160,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A864A1E42C5199560030C5CA /* GoogleMobileAdsConsentManager.m in Sources */,
EF5BBBF228F4816400DBC4FA /* AppDelegate.m in Sources */,
EF5BBBF828F4816400DBC4FA /* main.m in Sources */,
EF5BBBF728F4816400DBC4FA /* ViewController.m in Sources */,
A8C4B65D2C52B1E4005E047B /* MainViewController.m in Sources */,
EF5BBBF728F4816400DBC4FA /* NativeAdViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#import "AppDelegate.h"

#import <GoogleMobileAds/GoogleMobileAds.h>

@interface AppDelegate ()

@end
Expand All @@ -26,8 +24,6 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize the Google Mobile Ads SDK.
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil];

return YES;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="Ij1-YH-UFk">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="fch-hz-Qcf">
<device id="retina5_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--Main View Controller-->
<scene sceneID="tZt-u9-22D">
<objects>
<viewController id="Ij1-YH-UFk" customClass="ViewController" sceneMemberID="viewController">
<viewController id="Ij1-YH-UFk" customClass="MainViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Bvz-UX-ydP"/>
<viewControllerLayoutGuide type="bottom" id="gh4-S6-BwK"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="haS-q5-jEu" userLabel="Main View">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ufn-YX-pph" userLabel="Outer Content View">
<rect key="frame" x="0.0" y="44" width="375" height="734"/>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="pxA-xu-xm4">
<rect key="frame" x="107.66666666666667" y="351" width="198.66666666666663" height="34.333333333333314"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="b8z-h7-dB1" userLabel="Placeholder View">
<rect key="frame" x="0.0" y="0.0" width="375" height="734"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2bL-Cx-hSz">
<rect key="frame" x="112.66666666666669" y="0.0" width="150" height="25"/>
<constraints>
<constraint firstAttribute="height" constant="25" id="MXx-NF-d3v"/>
<constraint firstAttribute="width" constant="150" id="haJ-z3-RX2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Refresh Ad"/>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nxc-m1-LUf">
<rect key="frame" x="0.0" y="0.0" width="89.333333333333329" height="34.333333333333336"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Load ad"/>
<connections>
<action selector="refreshAd:" destination="Ij1-YH-UFk" eventType="touchUpInside" id="4QQ-L1-0TJ"/>
<action selector="loadAdButtonPressed:" destination="Ij1-YH-UFk" eventType="touchUpInside" id="zIR-e6-M8U"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sxV-nP-fvx">
<rect key="frame" x="109.33333333333334" y="0.0" width="89.333333333333343" height="34.333333333333336"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Show ad"/>
<connections>
<action selector="showAdButtonPressed:" destination="Ij1-YH-UFk" eventType="touchUpInside" id="ekt-sh-iHE"/>
<segue destination="QwL-LM-PuM" kind="modal" identifier="showFullScreenNativeAd" id="MHs-FX-HS6"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="b8z-h7-dB1" firstAttribute="leading" secondItem="Ufn-YX-pph" secondAttribute="leading" id="6TQ-Ch-krr"/>
<constraint firstItem="2bL-Cx-hSz" firstAttribute="centerX" secondItem="Ufn-YX-pph" secondAttribute="centerX" id="JFY-E7-fvI"/>
<constraint firstAttribute="trailing" secondItem="b8z-h7-dB1" secondAttribute="trailing" id="TJR-Qc-uzC"/>
<constraint firstAttribute="bottom" secondItem="b8z-h7-dB1" secondAttribute="bottom" id="a4X-to-Vem"/>
<constraint firstItem="2bL-Cx-hSz" firstAttribute="top" secondItem="Ufn-YX-pph" secondAttribute="top" id="hi9-4x-brZ"/>
<constraint firstItem="b8z-h7-dB1" firstAttribute="top" secondItem="Ufn-YX-pph" secondAttribute="top" id="kAJ-YT-R2Y"/>
</constraints>
</view>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="gh4-S6-BwK" firstAttribute="top" secondItem="Ufn-YX-pph" secondAttribute="bottom" id="1cq-tp-xOs"/>
<constraint firstAttribute="trailing" secondItem="Ufn-YX-pph" secondAttribute="trailing" id="7Ba-ht-HJb"/>
<constraint firstItem="Ufn-YX-pph" firstAttribute="top" secondItem="Bvz-UX-ydP" secondAttribute="bottom" id="MtW-Uo-IiM"/>
<constraint firstItem="Ufn-YX-pph" firstAttribute="leading" secondItem="haS-q5-jEu" secondAttribute="leading" id="lZs-Zv-4CX"/>
<constraint firstItem="pxA-xu-xm4" firstAttribute="centerY" secondItem="haS-q5-jEu" secondAttribute="centerY" id="YI0-RL-Lx4"/>
<constraint firstItem="pxA-xu-xm4" firstAttribute="centerX" secondItem="haS-q5-jEu" secondAttribute="centerX" id="tKp-WL-ODC"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="C7o-9z-57E">
<barButtonItem key="rightBarButtonItem" enabled="NO" title="Privacy Settings" id="ACN-7S-azc">
<connections>
<action selector="privacySettingsButtonPressed:" destination="Ij1-YH-UFk" id="XhC-nA-nTc"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="nativeAdPlaceholder" destination="b8z-h7-dB1" id="pmf-HK-aoz"/>
<outlet property="refreshButton" destination="2bL-Cx-hSz" id="yez-FS-gIq"/>
<outlet property="loadAdButton" destination="Nxc-m1-LUf" id="zCf-Ij-Chu"/>
<outlet property="privacySettingsButton" destination="ACN-7S-azc" id="emh-Gz-nvH"/>
<outlet property="showAdButton" destination="sxV-nP-fvx" id="ifs-pQ-7FP"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="V1k-ph-RoF" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="454.34782608695656" y="159.04017857142856"/>
</scene>
<!--Native Ad View Controller-->
<scene sceneID="mZU-qO-HYm">
<objects>
<viewController id="QwL-LM-PuM" customClass="NativeAdViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="9th-rm-Aqb"/>
<viewControllerLayoutGuide type="bottom" id="sHy-Cq-2Hw"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="ny7-UE-25u">
<rect key="frame" x="0.0" y="0.0" width="414" height="716"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M7x-ac-tOb" userLabel="Native Ad Placeholder">
<rect key="frame" x="0.0" y="20" width="414" height="696"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="M7x-ac-tOb" firstAttribute="leading" secondItem="ny7-UE-25u" secondAttribute="leading" id="BHt-g2-gJN"/>
<constraint firstAttribute="trailing" secondItem="M7x-ac-tOb" secondAttribute="trailing" id="TlT-uT-4T4"/>
<constraint firstItem="M7x-ac-tOb" firstAttribute="top" secondItem="9th-rm-Aqb" secondAttribute="bottom" constant="20" id="Ves-U5-j6X"/>
<constraint firstItem="sHy-Cq-2Hw" firstAttribute="top" secondItem="M7x-ac-tOb" secondAttribute="bottom" id="XiC-na-HUf"/>
</constraints>
</view>
<connections>
<outlet property="nativeAdPlaceholder" destination="M7x-ac-tOb" id="mfp-ue-yKq"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dvt-Qd-ArB" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1171.0144927536232" y="158.96739130434784"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="iYO-SD-QpG">
<objects>
<navigationController id="fch-hz-Qcf" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Jxx-F7-5xy">
<rect key="frame" x="0.0" y="20" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="Ij1-YH-UFk" kind="relationship" relationship="rootViewController" id="X9P-HD-2y6"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="j4k-N4-PK7" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-316" y="159"/>
</scene>
</scenes>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
Loading

0 comments on commit a075093

Please sign in to comment.