Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visionOS support to IdentityCore iOS target #1365

Closed
wants to merge 30 commits into from

Conversation

mipetriu
Copy link
Contributor

Proposed changes

This PR adds visionOS support to the IdentityCore iOS target, so that IdentityCore iOS compiles on iOS, iPadOS, and visionOS. It also adds code changes needed to compile on visionOS. The biggest change is that visionOS no longer supports SafariViewController, so we need to ensure that all references to it are behind OS macros in order for the target to build.

Type of change

  • Feature work
  • Bug fix
  • Documentation
  • Engineering change
  • Test
  • Logging/Telemetry

Risk

  • High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high level infrastructure changes)
  • Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
  • Small – No issues are expected. (Example: Very small bug fixes, string changes, or configuration settings changes)

Additional information

Mihai and others added 23 commits January 26, 2024 14:43
…/visionOS_support

merge iOS17 test changes from another branch
…port

merge xcode 15.2 branch to confirm pipelines
…upport

merge pipelinefix branch to main visionOS branch
@mipetriu mipetriu requested a review from a team as a code owner April 30, 2024 01:46
@@ -8820,6 +8820,7 @@
ENABLE_BITCODE = NO;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not update changelog.txt.

Please consider if this change would be noticeable to a partner or user and either update changelog.txt or resolve this conversation.

@@ -237,10 +243,11 @@ - (void)dismiss
return safariController;
}
#else
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, nil, @"Couldn't create session on macOS. Safari allowed flag %d", safariAllowed);
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, nil, @"Couldn't create session on macOS or visionOS. Safari allowed flag %d", safariAllowed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if target OS is Vision, we are returning nil at line 230, so is this log change correct ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, I added the visionOS logic above later. I'll add a log line up there too

@@ -92,7 +92,9 @@ + (BOOL)completeCertAuthChallenge:(NSURL *)endUrl

+ (void)resetHandler
{
#if TARGET_OS_IPHONE && !MSID_EXCLUDE_SYSTEMWV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we added this extra check for system webview here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a suggested change from Teams based on testing with the system webview disabled. I can see that all other instances of s_certAuthInProgress being updated are wrapped in this macro

return [self systemWebviewFromConfiguration:configuration
useAuthenticationSession:useSession
allowSafariViewController:allowSafariViewController
context:context];
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we returning nil only if it is system webview for all targets ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, any partner regardless of platform may choose to avoid system webview entirely. These !MSID_EXCLUDE_SYSTEMWV changes are added in a few places where setting it was not working. Other changes that add #if defined TARGET_OS_VISION && TARGET_OS_VISION are meant to specifically remove SafariViewController because it is completely removed on visionOS

In this specific case the [systemWebviewFromConfiguration] method itself is wrapped in #if !MSID_EXCLUDE_SYSTEMWV, but the call to it here was not. It's safer to wrap the call itself as well so we don't call a non-existent method

Copy link
Contributor

@Veena11 Veena11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some questions for my learning

@mipetriu mipetriu changed the base branch from dev to hotfix/1.7.40 August 19, 2024 20:24
@mipetriu mipetriu changed the base branch from hotfix/1.7.40 to dev August 19, 2024 21:01
@mipetriu mipetriu closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants