-
Notifications
You must be signed in to change notification settings - Fork 52
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
App ID gets stuck for 2 buttons with different App IDs #92
Comments
Hi. Saw this with a bit of delay. It will quicken things if you can provide a repro. |
Hey, so i made a small project to reproduce the issue: https://github.com/avbelyaev/random/tree/master/vue-facebook-buttons I added the simplest use case (similar to what is posted above) when both buttons are present on the same page. And it seems that they share some state, since the app ID gets stuck between them However there is another case that I mentioned both here and there - when buttons are present on separate pages, they still share something (which gets flushed on browser refresh). But I hope the single-page example will help to get this sorted. Thanks |
Great, I'll have a look asap. |
Hey, in the meantime I reproduced the other case I mentioned - when these buttons are on separate pages - here it is https://github.com/avbelyaev/random/tree/master/vue-microfrontends/producer If you run that app, and click "Login with Instagram" on the home page, you'll get app=3495 ✅ Now if you navigate with "go login" to FB login page, you'll still get app=3495 🟥 Now if you refresh this page in browser, you'll get app=9662 ✅ But now if you'll get back to the home page (via "go home" or browser's back button), you'll get app=9662 🟥 If there is no simple fix in the lib, maybe you can suggest smth I can do on my app's side (which has a similar setup with 1 button per view)? |
Hi Is there anything you can suggest maybe on our side to separate these buttons between separate pages? |
I need to use 2 Facebook login buttons, so the user can login via Facebook and via Instagram. So I have 2 separate facebook apps, with different IDs - 1797... and 3495... They are given to me and I can't change that.
So both of them are present on the page, but they don't share anything. Pretty much everything is defined for 2 separate flows
When it's rendered I have 2 buttons on the page. But when I click on either of those buttons, in the popup window it shows app ID of the first app:

app_id=1797...
If e.g. in the code above i move 3495 so it's the first that gets rendered, both buttons will open the popup with
app_id=3495...
Another thing I noticed, is that even if these 2 buttons are present on completely separate views:
then if I navigate to page-1 and click on button-1 first, in the popup I will get
app_id=1797...
which is what I expectBut when I move to page-2 (assuming page-1 and button-1 are already unmounted/destroyed by that time) and click on button-2, I will still get
app_id=1797...
. Looks like it gets stored somewhere and not completely abandoned.But if I refresh page-2, then I will get
app_id=3495...
(which is what I expect). But now button-1 is "stuck" and opens popups withapp_id=3495...
Maybe that's due to
Sdk.unsubscribe()
not working properly (it's not exported though, so I can't access it). Or somehow related to #88 - but here I have app IDs known at compile time, so I'm not sureSo, is there a solution for having 2 separate buttons with 2 separate app IDs?
Thanks!
The text was updated successfully, but these errors were encountered: