Skip to content

Commit 1f0fbe3

Browse files
committed
Merge branch 'main' into varconst/error-message-on-invalid
2 parents 4a7b301 + e945953 commit 1f0fbe3

File tree

14 files changed

+446
-46
lines changed

14 files changed

+446
-46
lines changed

.github/workflows/integration_tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ jobs:
812812
run: |
813813
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )"
814814
- name: Run Android integration tests on Emulator locally
815+
timeout-minutes: 60
815816
if: steps.get-device-type.outputs.device_type == 'virtual'
816817
run: |
817818
python scripts/gha/test_simulator.py --testapp_dir testapps \
@@ -896,6 +897,7 @@ jobs:
896897
run: |
897898
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )"
898899
- name: Run iOS integration tests on Simulator locally
900+
timeout-minutes: 60
899901
if: steps.get-device-type.outputs.device_type == 'virtual'
900902
run: |
901903
python scripts/gha/test_simulator.py --testapp_dir testapps \
@@ -977,6 +979,7 @@ jobs:
977979
- name: Install python deps
978980
run: pip install -r scripts/gha/requirements.txt
979981
- name: Run tvOS integration tests on Simulator locally
982+
timeout-minutes: 60
980983
run: |
981984
python scripts/gha/test_simulator.py --testapp_dir testapps \
982985
--tvos_device "${{ matrix.tvos_device }}" \

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,17 @@ if(FIREBASE_INCLUDE_FIRESTORE AND DESKTOP)
197197
endif()
198198

199199
if(FIREBASE_CPP_USE_PRIOR_GRADLE_BUILD)
200+
# Quote meta characters in ${CMAKE_CURRENT_LIST_DIR} so we can
201+
# match it in a regex.
202+
# For example, '/path/with/+meta/char.acters' will become
203+
# '/path/with/\+meta/char\.acters'.
204+
string(REGEX REPLACE
205+
"([][+.*()^])" "\\\\\\1" # Yes, this many \'s is correct.
206+
current_list_dir_regex
207+
"${CMAKE_CURRENT_LIST_DIR}")
200208
# Figure out where app's binary_dir was.
201209
string(REGEX REPLACE
202-
"${CMAKE_CURRENT_LIST_DIR}/[^/]+/(.*)"
210+
"${current_list_dir_regex}/[^/]+/(.*)"
203211
"${CMAKE_CURRENT_LIST_DIR}/app/\\1"
204212
APP_BINARY_DIR "${FIREBASE_BINARY_DIR}")
205213

external/vcpkg

Submodule vcpkg updated 5537 files

firestore/integration_test_internal/src/util/integration_test_util.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
#include "firebase/app.h"
1010
#include "firebase/firestore.h"
1111
#include "firestore/src/common/hard_assert_common.h"
12+
13+
#if !defined(__ANDROID__)
1214
#include "firestore/src/main/firestore_main.h"
15+
#else
16+
#include "firestore/src/android/firestore_android.h"
17+
#endif // !defined(__ANDROID__)
1318

1419
namespace firebase {
1520
namespace firestore {

messaging/integration_test/Podfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11

22
source 'https://github.com/CocoaPods/Specs.git'
3-
platform :ios, '10.0'
43
# Firebase Cloud Messaging test application.
54

65
target 'integration_test' do
6+
platform :ios, '10.0'
7+
pod 'Firebase/Messaging', '8.3.0'
8+
end
9+
10+
target 'integration_test_tvos' do
11+
platform :tvos, '10.0'
712
pod 'Firebase/Messaging', '8.3.0'
813
end
914

messaging/integration_test/integration_test.xcodeproj/project.pbxproj

Lines changed: 300 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="13122.16" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="tne-QT-ifu">
11+
<objects>
12+
<viewController id="BYZ-38-t0r" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
14+
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
17+
<viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
21+
</objects>
22+
</scene>
23+
</scenes>
24+
</document>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="13122.16" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="tne-QT-ifu">
11+
<objects>
12+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
13+
<layoutGuides>
14+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
15+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
16+
</layoutGuides>
17+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
18+
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
19+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20+
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
21+
<viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
22+
</view>
23+
</viewController>
24+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
25+
</objects>
26+
</scene>
27+
</scenes>
28+
</document>

messaging/src/ios/messaging.mm

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,26 +196,42 @@ void NotifyListenerSet(Listener* listener) {
196196
LogInfo("FCM: Using FCM senderID %s", senderID.UTF8String);
197197
id appDelegate = [UIApplication sharedApplication];
198198

199-
#if FIREBASE_PLATFORM_IOS
200-
// Register for remote notifications. Both codepaths result in
201-
// application:didRegisterForRemoteNotificationsWithDeviceToken: being called when they
202-
// complete, or application:didFailToRegisterForRemoteNotificationsWithError: if there was an
203-
// error. We complete the future there.
204-
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) {
205-
// iOS 7.1 or earlier
206-
UIRemoteNotificationType allNotificationTypes =
207-
(UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert |
208-
UIRemoteNotificationTypeBadge);
209-
[appDelegate registerForRemoteNotificationTypes:allNotificationTypes];
210-
} else {
211-
// iOS 8 or later
212-
UIUserNotificationType allNotificationTypes =
213-
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
214-
UIUserNotificationSettings *settings =
215-
[UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
216-
[appDelegate registerUserNotificationSettings:settings];
199+
#if FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
200+
if ([UNUserNotificationCenter class] != nil) {
201+
// iOS 10 or later, and tvOS
202+
// For iOS 10 display notification (sent via APNS)
203+
[UNUserNotificationCenter currentNotificationCenter].delegate = appDelegate;
204+
UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |
205+
UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
206+
[[UNUserNotificationCenter currentNotificationCenter]
207+
requestAuthorizationWithOptions:authOptions
208+
completionHandler:^(BOOL granted, NSError * _Nullable error) {
209+
}];
217210
[appDelegate registerForRemoteNotifications];
218211
}
212+
#endif //FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS
213+
214+
#if FIREBASE_PLATFORM_IOS
215+
// Register for remote notifications. Both codepaths result in
216+
// application:didRegisterForRemoteNotificationsWithDeviceToken: being called when they
217+
// complete, or application:didFailToRegisterForRemoteNotificationsWithError: if there was an
218+
// error. We complete the future there.
219+
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_1) {
220+
// iOS 7.1 or earlier
221+
UIRemoteNotificationType allNotificationTypes =
222+
(UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert |
223+
UIRemoteNotificationTypeBadge);
224+
[appDelegate registerForRemoteNotificationTypes:allNotificationTypes];
225+
} else if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_4) {
226+
// 8.0 <= iOS version <= 9.4
227+
// >= 10.0 is handled by the first if block above.
228+
UIUserNotificationType allNotificationTypes =
229+
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
230+
UIUserNotificationSettings *settings =
231+
[UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
232+
[appDelegate registerUserNotificationSettings:settings];
233+
[appDelegate registerForRemoteNotifications];
234+
}
219235
#endif // FIREBASE_PLATFORM_IOS
220236

221237
// Only request the token automatically if permitted
@@ -524,11 +540,13 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
524540
[user_notification_center setDelegate:(id<UNUserNotificationCenterDelegate>)application];
525541
}
526542

543+
g_message_notification_opened = false;
527544
#if FIREBASE_PLATFORM_IOS
528545
// If the app was launched with a notification, cache it until we're connected.
529546
g_launch_notification =
530547
[launch_options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
531548
g_message_notification_opened = g_launch_notification != nil;
549+
#endif // FIREBASE_PLATFORM_IOS
532550

533551
IMP app_delegate_application_did_finish_launching_with_options =
534552
SwizzledMethodCache().GetMethodForObject(
@@ -551,7 +569,6 @@ static BOOL AppDelegateApplicationDidFinishLaunchingWithOptions(id self, SEL sel
551569
[invocation getReturnValue:&ret];
552570
return ret;
553571
}
554-
#endif // FIREBASE_PLATFORM_IOS
555572
return NO;
556573
}
557574

scripts/gha/build_ios_tvos.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@
6565
},
6666

6767
'tvos': {
68-
'supported_targets' : ('firebase_analytics', 'firebase_auth',
69-
'firebase_database', 'firebase_firestore',
70-
'firebase_functions', 'firebase_installations',
71-
'firebase_messaging', 'firebase_remote_config',
72-
'firebase_storage'),
68+
'supported_targets' : ('firebase_auth', 'firebase_database',
69+
'firebase_firestore', 'firebase_functions',
70+
'firebase_installations', 'firebase_messaging',
71+
'firebase_remote_config', 'firebase_storage'),
7372
'device': {
7473
'architectures' : ('arm64',),
7574
'toolchain' : 'cmake/toolchains/apple.toolchain.cmake',

0 commit comments

Comments
 (0)