You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
[REQUIRED] Step 1: Describe your environment
Swift Package Manager
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 alwaysnil
.Additionally, on both configurations I've setup Keychain sharing capabilities for both apps and am calling
Auth.auth().useUserAccessGroup(...)
afterFirebaseApp.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!
The text was updated successfully, but these errors were encountered: