Skip to content
Merged
7 changes: 5 additions & 2 deletions .github/workflows/messaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,17 @@ jobs:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
runs-on: macOS-latest
strategy:
matrix:
target: [iOS, watchOS]
steps:
- uses: actions/checkout@v2
- name: Xcode 12
run: sudo xcode-select -s /Applications/Xcode_12.app/Contents/Developer
- name: Initialize xcodebuild
run: xcodebuild -list
- name: iOS Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit iOS spm
- name: Unit Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm

spm-cron:
# Don't run on private repo.
Expand Down
3 changes: 3 additions & 0 deletions FirebaseMessaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# unreleased
- [fixed] Fixed an issue that when checking storage size before writing to the disk, the client was checking the document folder that is no longer used. (#7480)

# 2021-02 -- v7.6.0
- [fixed] Fixed build warnings introduced with Xcode 12.5. (#7433)

Expand Down
3 changes: 0 additions & 3 deletions FirebaseMessaging/Sources/FIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ - (void)start {
[self setupNotificationListeners];
[self setupTopics];

#if !TARGET_OS_WATCH
// Print the library version for logging.
NSString *currentLibraryVersion = FIRFirebaseVersion();
FIRMessagingLoggerInfo(kFIRMessagingMessageCodeMessagingPrintLibraryVersion,
Expand All @@ -245,8 +244,6 @@ - (void)start {
// setup FIRMessaging objects
[self setupRmqManager];
[self setupSyncMessageManager];

#endif
}

- (void)setupFileManagerSubDirectory {
Expand Down
3 changes: 2 additions & 1 deletion FirebaseMessaging/Sources/FIRMessagingUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ int64_t FIRMessagingCurrentTimestampInMilliseconds(void) {

uint64_t FIRMessagingGetFreeDiskSpaceInMB(void) {
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSArray *paths =
NSSearchPathForDirectoriesInDomains(FIRMessagingSupportedDirectory(), NSUserDomainMask, YES);

NSDictionary *attributesMap =
[[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
API_AVAILABLE(macos(10.14), ios(10.0))
typedef void (^FIRMessagingContentHandler)(UNNotificationContent *content);

#if TARGET_OS_IOS || TARGET_OS_OSX
#if TARGET_OS_IOS || TARGET_OS_OSX || TARGET_OS_WATCH
static NSString *const kFCMPayloadOptionsName = @"fcm_options";
static NSString *const kFCMPayloadOptionsImageURLName = @"image";
static NSString *const kValidImageURL =
Expand Down
2 changes: 0 additions & 2 deletions FirebaseMessaging/Tests/UnitTests/FIRMessagingHandlingTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ - (void)testAPNSContentAvailableContextualNotification {
OCMReject([_testUtil.mockMessaging handleIncomingLinkIfNeededFromMessage:notificationPayload]);
OCMReject([_mockMessagingAnalytics logMessage:notificationPayload toAnalytics:[OCMArg any]]);

#if !(SWIFT_PACKAGE && TARGET_OS_TV) // Not enough space.
XCTAssertEqualObjects(@(FIRMessagingMessageStatusNew),
@([_testUtil.messaging appDidReceiveMessage:notificationPayload].status));
#endif
OCMVerifyAll(_testUtil.mockMessaging);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ - (void)tearDown {
}

#pragma mark - Method Swizzling Tests

#if !TARGET_OS_WATCH // TODO(chliangGoogle) Figure out why WKExtension is not recognized here.
- (void)testSwizzlingNonAppDelegate {
RandomObject *invalidAppDelegate = [[RandomObject alloc] init];
[[GULAppDelegateSwizzler sharedApplication]
Expand All @@ -194,6 +194,7 @@ - (void)testSwizzlingNonAppDelegate {
[invalidAppDelegate application:[GULAppDelegateSwizzler sharedApplication]
didReceiveRemoteNotification:@{}];
}
#endif

#if !SWIFT_PACKAGE
// The next 3 tests depend on a sharedApplication which is not available in the Swift PM test env.
Expand Down