plugins icon indicating copy to clipboard operation
plugins copied to clipboard

Facebook invalid access token in production build

Open GergelyNemes opened this issue 10 months ago • 4 comments

Hi.

I have a problem with facebook login on IOS when i build to production. The login is working fine when i'm building the app with "ns debug ios" to test it on my phone but when the app is built to production i get an access token from facebook witch is invalid. When i put the token into facebook Access token debugger it's says "Invalid OAuth access token - Cannot parse access token". Does anybody run into the same issue?

Image

GergelyNemes avatar Mar 20 '25 16:03 GergelyNemes

Same happens to me, it seems that that the tokenString property is returning a nonvalid, the plugin should return something like "EEAGtoken" but its seems it's different and invalid for graph.facebook to work Tested in iOS at v3.0.0

Edited: April 10, 2025: I went back to the v2.2.0 and its working now, so the problem is in the current version

PsHye avatar Apr 09 '25 16:04 PsHye

I find a solution. You have to enable tracking for your application before you try to use facebook login.

GergelyNemes avatar Apr 14 '25 11:04 GergelyNemes

@GergelyNemes but if you show the ATT dialog and the user refuses tracking, the access token is still invalid :(

felixkrautschuk avatar May 14 '25 16:05 felixkrautschuk

I made a PR, where the authenticationToken is added to the LoginResult. https://github.com/NativeScript/plugins/pull/624 In case the user opts out of ATT, the authenticationToken must be sent to backend instead of the invalid access token, but it is missing in the current plugin version 3.0.0.

https://developers.facebook.com/docs/facebook-login/limited-login/ios

felixkrautschuk avatar May 15 '25 13:05 felixkrautschuk