I am looking to build a Javascript app and deploy it on Android and iOS using Phonegap. My goal is to integrate Facebook login into the app.
After exploring the phonegap-facebook plugin, I was able to successfully implement the Facebook login feature. However, I encountered an issue when trying to integrate the plugin's example code into my Angular project. The JS code in the index.html file looked something like this:
<script>
// Initialize the Facebook SDK
document.addEventListener('deviceready', function() {
FB.init({
appId: 'XXX',
nativeInterface: CDV.FB,
useCachedDialogs: false
});
FB.getLoginStatus(handleStatusChange);
authUser();
updateAuthElements();
});
</script>
The JavaScript function directly updates the display using document.getElementById. My goal is to establish a connection between the index.html file and the JavaScript code to dynamically display Facebook token and names in the format:
{{user.token}} and {{user.names}}
Has anyone successfully implemented a similar functionality?
Thank you!