Skip to content

Commit 5ef8265

Browse files
authored
[Messaging] Fix APS Environment entitlement key on visionOS (#13176)
1 parent 04f0491 commit 5ef8265

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

FirebaseMessaging/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- [fixed] Fixed the APS Environment key on visionOS. (#13173)
3+
14
# 10.29.0
25
- [fixed] Renamed "initWithFileName" internal method that was causing submission issues for some
36
users. (#13134).

FirebaseMessaging/Sources/FIRMessagingUtilities.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@
2828

2929
static NSString *const kFIRMessagingWatchKitExtensionPoint = @"com.apple.watchkit";
3030

31-
#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
32-
static NSString *const kEntitlementsAPSEnvironmentKey = @"Entitlements.aps-environment";
33-
#else
31+
#if TARGET_OS_OSX
32+
// macOS uses a different entitlement key than the rest of Apple's platforms:
33+
// https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_aps-environment
3434
static NSString *const kEntitlementsAPSEnvironmentKey =
3535
@"Entitlements.com.apple.developer.aps-environment";
36-
#endif
36+
#else
37+
// Entitlement key for all non-macOS platforms:
38+
// https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment
39+
static NSString *const kEntitlementsAPSEnvironmentKey = @"Entitlements.aps-environment";
40+
#endif // TARGET_OS_OSX
3741
static NSString *const kAPSEnvironmentDevelopmentValue = @"development";
3842

3943
#pragma mark - URL Helpers

0 commit comments

Comments
 (0)