|
60 | 60 | // change.
|
61 | 61 | NSIntegerconstkMaxRetryCountForDefaultToken = 5;
|
62 | 62 |
|
63 |
| -#if TARGET_OS_IOS || TARGET_OS_TV |
| 63 | +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH |
64 | 64 | staticNSString *constkEntitlementsAPSEnvironmentKey = @"Entitlements.aps-environment";
|
65 | 65 | #else
|
66 |
| -staticNSString *constkEntitlementsAPSEnvironmentKey = @"com.apple.developer.aps-environment"; |
| 66 | +staticNSString *constkEntitlementsAPSEnvironmentKey = |
| 67 | +@"Entitlements.com.apple.developer.aps-environment"; |
67 | 68 | #endif
|
68 |
| -staticNSString *constkEntitlementsKeyForMac = @"Entitlements"; |
69 | 69 | staticNSString *constkAPSEnvironmentDevelopmentValue = @"development";
|
70 | 70 | /// FIRMessaging selector that returns the current FIRMessaging auto init
|
71 | 71 | /// enabled flag.
|
@@ -617,10 +617,14 @@ - (void)configureInstanceIDWithOptions:(FIROptions *)options {
|
617 | 617 | [selfupdateFirebaseInstallationID];
|
618 | 618 |
|
619 | 619 | // FCM generates a FCM token during app start for sending push notification to device.
|
620 |
| -// This is not needed for app extension. |
| 620 | +// This is not needed for app extension except for watch. |
| 621 | +#if TARGET_OS_WATCH |
| 622 | + [selfdidCompleteConfigure]; |
| 623 | +#else |
621 | 624 | if (![GULAppEnvironmentUtil isAppExtension]) {
|
622 | 625 | [selfdidCompleteConfigure];
|
623 | 626 | }
|
| 627 | +#endif |
624 | 628 | }
|
625 | 629 |
|
626 | 630 | // This is used to start any operations when we receive FirebaseSDK setup notification
|
@@ -978,7 +982,7 @@ - (BOOL)isProductionApp {
|
978 | 982 | // Apps distributed via AppStore or TestFlight use the Production APNS certificates.
|
979 | 983 | return defaultAppTypeProd;
|
980 | 984 | }
|
981 |
| -#if TARGET_OS_IOS || TARGET_OS_TV |
| 985 | +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH |
982 | 986 | NSString *path = [[[NSBundlemainBundle] bundlePath]
|
983 | 987 | stringByAppendingPathComponent:@"embedded.mobileprovision"];
|
984 | 988 | #elif TARGET_OS_OSX
|
@@ -1061,13 +1065,7 @@ - (BOOL)isProductionApp {
|
1061 | 1065 | @"most likely a Dev profile.");
|
1062 | 1066 | }
|
1063 | 1067 |
|
1064 |
| -#if TARGET_OS_IOS || TARGET_OS_TV |
1065 | 1068 | NSString *apsEnvironment = [plistMap valueForKeyPath:kEntitlementsAPSEnvironmentKey];
|
1066 |
| -#elif TARGET_OS_OSX |
1067 |
| -NSDictionary *entitlements = [plistMap valueForKey:kEntitlementsKeyForMac]; |
1068 |
| -NSString *apsEnvironment = [entitlements valueForKey:kEntitlementsAPSEnvironmentKey]; |
1069 |
| -#endif |
1070 |
| - |
1071 | 1069 | NSString *debugString __unused =
|
1072 | 1070 | [NSStringstringWithFormat:@"APNS Environment in profile: %@", apsEnvironment];
|
1073 | 1071 | FIRInstanceIDLoggerDebug(kFIRInstanceIDMessageCodeInstanceID013, @"%@", debugString);
|
|
0 commit comments