Open arzke opened 6 years ago
@brundozer can you try this?
setTimeout(() => Facebook.init('APP_ID'), 0)
It works. I guess that we trigger the init before android context is ready and setting a timeout of 0 will delay the call to the init function so the context is there. It looks a bit hacky though. Is it normal that the context is not set when created is triggered? Even after it is mounted?
So when outputting the value of require("tns-core-modules/application").android, I see that I don't have the context set:
{
_observers: {
activityStarted: [ [Object], [length]: 1 ],
activityStopped: [ [Object], [length]: 1 ]
},
_registeredReceivers: {},
_pendingReceiverRegistrations: [ [length]: 0 ]
}
I have to figure out why we're expecting the context to be set at this step and it isn't.
Hello,
I've been trying to setup facebook login like in the example for android, but I get the following errors:
So I had to dive in the code of nativescript-facebook to see where the error happens and it is here: https://github.com/NativeScript/nativescript-facebook/blob/2437e17b9aa71396a679335408c03011ef687bfa/src/login-manager.android.ts#L27
When logging in the console the "e" variable containing the error, I get: