Skip to content

Cannot getStoredUser from keychain in watchOS #9525

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

Closed
ivopintodasilva opened this issue Mar 28, 2022 · 2 comments
Closed

Cannot getStoredUser from keychain in watchOS #9525

ivopintodasilva opened this issue Mar 28, 2022 · 2 comments

Comments

@ivopintodasilva
Copy link

ivopintodasilva commented Mar 28, 2022

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 13.2.1
  • Firebase SDK version: 8.15.0 (commit b4dd98d)
  • Installation method: Swift Package Manager
  • Firebase Component: Auth
  • Target platform(s): iOS | watchOS

[REQUIRED] Step 2: Describe the problem

I'm having trouble sharing an authenticated user between an iOS and a watchOS app.

By creating a watchOS app for an iOS app, I expect to be able to share authentication between both - so, to sign a user in through the iOS app and be able to use it in the watchOS app.

I've tried two approaches:

1. Using the same GoogleService-Info.plist for both iOS and watchOS. This causes a warning because the bundle ID of the watch app doesn't match the one of the iOS app.
In this example, the bundle ID for my watch app was *app-bundle-id*.watchkitapp and *app-bundle-id*.watchkitapp.watchkitextension for the watch extension.
I thought this approach would work, since it's the same one I've successfully used previously with widgets, but no luck...

2. Using a separate GoogleService-Info.plist for the watchOS app. The bundle ID warning now disappears and the setup is successful.
However, when trying to call getStoredUser in the watch app (after logging in on the iOS app), the user returned is always nil.

Additionally, on both configurations I've setup Keychain sharing capabilities for both apps and am calling Auth.auth().useUserAccessGroup(...) after FirebaseApp.configure().

Here's a link to a sample project configured as described in approach #2.

Am I doing something wrong in terms of configuration?

Cheers!

@paulb777
Copy link
Member

This may be related to #7854

@charlotteliang
Copy link
Contributor

This is a duplicate of #7854.

App group doesn't support data sharing between watch and phone right now. It would be great for @ivopintodasilva to file a feature request or upvote one already exists which helps us prioritize.

@firebase firebase locked and limited conversation to collaborators Dec 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants