Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions messaging/MessagingExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
5F99610D1AE0CF4F0034F503 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F9961071AE0CF4F0034F503 /* LaunchScreen.xib */; };
8DC73D8C2D41AE850092B6EE /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 8DC73D8B2D41AE850092B6EE /* FirebaseMessaging */; };
978E6F2CAAC2AD673D158985 /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 82E79B6D15A982EAE7B0E31B /* GoogleService-Info.plist */; };
EA2B4E6C2ED4F571003F9A40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA2B4E662ED4F571003F9A40 /* Main.storyboard */; };
EA2B4E752ED4F571003F9A40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA2B4E662ED4F571003F9A40 /* Main.storyboard */; };
EAC902A32EC6849A000761B8 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = EAC902A22EC6849A000761B8 /* FirebaseMessaging */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -69,6 +71,7 @@
DEB13BC723AEC9DF0066A6F3 /* FIREGHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIREGHelper.m; sourceTree = "<group>"; };
DEB13BC823AEC9DF0066A6F3 /* FIREGSignInHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIREGSignInHelper.h; sourceTree = "<group>"; };
DED65CF723E9DE6400461312 /* FIREGSignInInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FIREGSignInInfo.h; sourceTree = "<group>"; };
EA2B4E652ED4F571003F9A40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
EAE93A8D2E86E558005ABAF0 /* MessagingExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MessagingExample.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -175,6 +178,7 @@
EAE93A8A2E86E465005ABAF0 /* MessagingExample */ = {
isa = PBXGroup;
children = (
EA2B4E662ED4F571003F9A40 /* Main.storyboard */,
EAE93A8D2E86E558005ABAF0 /* MessagingExample.entitlements */,
5F5A537D1ADE67D500F81DF0 /* AppDelegate.swift */,
5F5A537F1ADE67D500F81DF0 /* ViewController.swift */,
Expand Down Expand Up @@ -310,6 +314,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA2B4E6C2ED4F571003F9A40 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -319,6 +324,7 @@
files = (
5F99610D1AE0CF4F0034F503 /* LaunchScreen.xib in Resources */,
5F99610B1AE0CF4F0034F503 /* Images.xcassets in Resources */,
EA2B4E752ED4F571003F9A40 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -367,6 +373,17 @@
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
EA2B4E662ED4F571003F9A40 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
EA2B4E652ED4F571003F9A40 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
0718C8C02E8F256800AA7788 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
109 changes: 109 additions & 0 deletions messaging/MessagingExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18121" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="dvH-Ce-6yG">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18091"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--FCM Example-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S9T-hp-Ka1">
<rect key="frame" x="107.5" y="311.5" width="160" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="Grv-Ur-3qm"/>
<constraint firstAttribute="width" constant="160" id="ggk-PO-zor"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<state key="normal" title="Log Token"/>
<connections>
<action selector="handleLogTokenTouch:" destination="BYZ-38-t0r" eventType="touchUpInside" id="3NM-R6-4A4"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HgF-jF-1NC">
<rect key="frame" x="204" y="233" width="192" height="44"/>
<color key="backgroundColor" red="1" green="0.56078431370000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="192" id="4Yd-c9-aCb"/>
<constraint firstAttribute="height" constant="44" id="gyc-AL-1xz"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<state key="normal" title="Subscribe To Weather">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="handleSubscribeTouch:" destination="BYZ-38-t0r" eventType="touchUpInside" id="meX-vb-HDO"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No FCM token" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RBg-uJ-gCV">
<rect key="frame" x="67.5" y="459" width="240" height="14"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="R9g-We-nKc"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No FCM Registration token" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="5" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1wF-0v-e01">
<rect key="frame" x="67.5" y="565" width="240" height="13.5"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="FXq-Tm-sRh"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="1wF-0v-e01" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="0wR-rN-VBn"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="RBg-uJ-gCV" secondAttribute="bottom" constant="194" id="4Cj-3x-9JW"/>
<constraint firstItem="RBg-uJ-gCV" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="7XG-os-4BL"/>
<constraint firstItem="RBg-uJ-gCV" firstAttribute="top" secondItem="S9T-hp-Ka1" secondAttribute="bottom" constant="103.5" id="dJ0-an-jgk"/>
<constraint firstItem="S9T-hp-Ka1" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="eqV-Gc-7aa"/>
<constraint firstItem="S9T-hp-Ka1" firstAttribute="top" secondItem="HgF-jF-1NC" secondAttribute="bottom" constant="8" id="izK-fQ-Uu7"/>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="1wF-0v-e01" secondAttribute="bottom" constant="88.5" id="p2q-F9-Mpu"/>
<constraint firstItem="HgF-jF-1NC" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="st1-B5-WH3"/>
<constraint firstItem="S9T-hp-Ka1" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="wHX-8g-0MB"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="FCM Example" id="uI5-jL-nrY"/>
<connections>
<outlet property="fcmTokenMessage" destination="RBg-uJ-gCV" id="FUs-GZ-mfF"/>
<outlet property="remoteFCMTokenMessage" destination="1wF-0v-e01" id="nDz-D9-60k"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="311.19999999999999" y="445.72713643178412"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="BBa-0w-b0R">
<objects>
<navigationController id="dvH-Ce-6yG" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="FZU-Jb-Wzn">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.0" green="0.52156862745098043" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</navigationBar>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="Sil-bt-Y94"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cPh-2w-0HS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-381" y="451"/>
</scene>
</scenes>
</document>
42 changes: 40 additions & 2 deletions scripts/build-for-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,30 @@

set -euo pipefail

xcode_version=$(xcodebuild -version | grep Xcode)
xcode_version="${xcode_version/Xcode /}"
xcode_major="${xcode_version/.*/}"

if [[ "$xcode_major" -ge 26 ]]; then
iphone_version="17"
elif [[ "$xcode_major" -ge 16 ]]; then
iphone_version="16"
else
echo "Unsupported Xcode version $xcode_version; exiting." 1>&2
exit 1
fi

# Set default parameters
if [[ -z "${SPM:-}" ]]; then
SPM=false
echo "Defaulting to SPM=$SPM"
fi
if [[ -z "${OS:-}" ]]; then
OS=iOS
DEVICE="iPhone ${iphone_version}"
echo "Defaulting to OS=$OS"
echo "Defaulting to DEVICE=$DEVICE"
fi

# Set have_secrets to true or false.
source scripts/check_secrets.sh
Expand All @@ -45,7 +64,26 @@ fi
# Set scheme
if [[ -z "${SCHEME:-}" ]]; then
if [[ "$SPM" == true ]];then
SCHEME="${SAMPLE}Example (${OS})"
# Get the list of schemes
schemes=$(xcodebuild -list -project "${DIR}/${SAMPLE}Example.xcodeproj" |
grep -E '^\s+' |
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')

# Check for the OS-suffixed scheme name
if echo "$schemes" | grep -q "^${SAMPLE}Example (${OS})$"; then
SCHEME="${SAMPLE}Example (${OS})"
# Check for the Swift-suffixed scheme
elif echo "$schemes" | grep -q "^${SAMPLE}ExampleSwift$"; then
SCHEME="${SAMPLE}ExampleSwift"
# Check for the base scheme name
elif echo "$schemes" | grep -q "^${SAMPLE}Example$"; then
SCHEME="${SAMPLE}Example"
else
echo "Error: Could not find a suitable scheme for ${SAMPLE}Example in ${OS}."
echo "Available schemes:"
echo "$schemes"
exit 1
fi
else
SCHEME="${SAMPLE}Example${SWIFT_SUFFIX:-}"
fi
Expand Down Expand Up @@ -82,7 +120,7 @@ function xcb() {
}

# Run xcodebuild
sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
sudo xcode-select -p
xcb "${flags[@]}"
echo "$message"

Expand Down
Loading