Trouble persisting macOS login in multi-platform app #11674
Replies: 1 comment
-
Closing in favor of the duplicate issue #11675 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Setup 1:
I have a swift app with a single target that runs on both iOS and macOS -
com.teamName.appName
.I have an app group
group.com.teamName.appName
and a keychain sharing groupcom.teamName.appName
for it.When setting up the authentication, i use
I need this in order to stay signed in in my app extensions, like notifications or share extension.
Issue:
In this setup without doing anything else, the auth state on iOS persists but macOS requires re-authenticating each time because the above try statement throws
Error Domain=FIRAuthErrorDomain Code=17995 "An error occurred when accessing the keychain.
Fix attempted:
Now, looking around online i found that providing the team id inside the group name would fix the issue. So basically going from
group.com.teamName.appName
toteamId.group.com.teamName.appName
.This behaviour is already done under the hood for keychain groups. Setting the keychain group on the target as
com.teamName.AppName
will actually set it as$(AppIdentifierPrefix)com.teamName.AppName
if you look in the entitlements.Result:
MacOS compiles, runs fine and the authentication persists, but the iOS target no longer compiles with the following error:
Application Group identifiers should start with 'group.'
but only when trying to compile on a physical deviceLooking for any guidance on what i am doing wrong and or what i can improve on to have both apps compile, run and persist their authentication state.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions