mailchimp / Firebase

IO-4458: product partnerships team
Apache License 2.0
19 stars 18 forks source link

User not getting pushed to Mailchimp when using Apple sign in provider #62

Open ben-wright opened 1 year ago

ben-wright commented 1 year ago

Hi,

The extension is working great when users signup using email and password provider. However, when user using Apple Sign In provider, they are not pushed out to mailchimp.

I have checked logs for ext-mailchimp-firebase-sync-addUserToList function and it seems it is not getting trigger when a user signs up using Apple.

Any help would be greatly appreciated, thanks!

barticus commented 1 year ago

Hi @ben-wright , sorry for the slow response on this one. This sounds like odd behaviour.

  1. Are you able to confirm that you are seeing new users in Firebase Auth who have logged in with Apple?
  2. Can you confirm you're following roughly the process outlined here, particularly that you are using Auth.auth().signIn(with: credential) to sign the user in? This is mostly to check you're not potentially using a custom token which would not trigger the handler

Otherwise, I'll start trying to repro this, but it requires a few steps to get set up!

ben-wright commented 1 year ago

Hi @barticus thank you for your response.

  1. Correct, I can see the users in FIrebase dashboard including users with hidden address ie @privaterelay.appleid.com
  2. Correct, users are being signed in directly from frontend library, no custom token is being used.
ben-wright commented 1 year ago

Hi @barticus , on further inspection, I believe I am getting logs from mailchimp extension:

User does not have an email

When user is signing in with apple. But I'm not sure why the email is blank on signup?

I am using React Native and requesting email scope when user logs in:

const appleAuthRequestResponse = await appleAuth.performRequest({ requestedOperation: appleAuth.Operation.LOGIN, requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL], });

And also the email is also visible on Firebase dashboard in authentication section.

Any ideas why email would be blank on functions.handler.auth.user.onCreate trigger?

barticus commented 1 year ago

Sorry for not getting back to you @ben-wright.

It sounds very strange! Can't find anyone else reporting this kind of issue. There are some issues around the full name not always being returned - might be worth a read to see if it impacts you, but I doubt its this same issue.

We've prioritised looking into this but it still might be a few weeks until we do. We will need to set up a basic app of some form to repro. If you need it faster than that, I've put details in the readme on how to set up a local firebase project with this extension enabled, you could pull the code and add some extra log statements to track down what is going on. I understand that is not ideal, but could get this done faster.

ben-wright commented 1 year ago

Thanks for reply :) Good idea, I will setup locally to further test what is happening and try to replicate locally.

barticus commented 11 months ago

Hi @ben-wright , did you get any further with this?

On our end, the person who was going to look at this was pulled on to another project, so it hasn't been assessed internally yet.