Skip to content

Commit 74d87b2

Browse files
authored
Merge pull request #3833 from bbirman/scene-notification
Add default scene for notifications
2 parents f77e36a + 82417ab commit 74d87b2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Common/SalesforceSDKManager.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#import "SFSDKMacDetectUtil.h"
4242
#import "SFSDKSalesforceSDKUpgradeManager.h"
4343
#import <SalesforceSDKCommon/NSUserDefaults+SFAdditions.h>
44+
#import "SFSDKWindowManager+Internal.h"
4445

4546
static NSString * const kSFAppFeatureSwiftApp = @"SW";
4647
static NSString * const kSFAppFeatureMultiUser = @"MU";
@@ -665,12 +666,14 @@ - (void)handleSceneDidDisconnect:(NSNotification *)notification {
665666
[self.snapshotViewControllers removeObject:scene.session.persistentIdentifier];
666667
}
667668

668-
- (nullable UIScene *)sceneFromNotification:(NSNotification *)notification {
669+
- (UIScene *)sceneFromNotification:(NSNotification *)notification {
669670
id object = notification.object;
670671
if ([object isKindOfClass:[UIScene class]]) {
671672
return object;
673+
} else {
674+
[SFSDKCoreLogger w:[self class] message:@"Unable to derive scene from notification, using default"];
675+
return [[SFSDKWindowManager sharedManager] defaultScene];
672676
}
673-
return nil;
674677
}
675678

676679
- (void)handleAuthCompleted:(NSNotification *)notification { }

0 commit comments

Comments
 (0)