Facebook Comment Box and Messenger


Facebook Comment Box and Messenger



I am trying to add Facebook Comment Box as well as Messenger Plugin in my Angular/Ionic App (PWA).


Facebook Comment Box


Messenger Plugin



The Messenger plugin when included separately works well. But with the following code, where I try to combine both, the Messenger fails to load, with no errors in console.



index.html


<!-- Load Facebook SDK for JavaScript -->







Messenger only working code @ https://change.grassrootsapp.in/
Combined broken code @ https://alpha4.uat.grassrootsapp.in/



chat.html


<ion-content id="event-chat-content" *ngIf="cEvent">


</ion-content>



chat.ts (from https://blog.f5.works/using-facebook-comment-plugin-in-angular-2/)


ionViewDidEnter() {

// https://samkirkiles.svbtle.com/angular-4-facebook-login-integration
let wind = <any>window;
if (wind.FB) {
wind.FB.XFBML.parse();
}
}



Now to combine both, I am unsure


script


sdk.js


xfbml.customerchat.js



I tried the following scenario and it fails:


index.html



index.html



Any help?





Constantly deleting the FB object and re-adding the SDK is nonsense to begin with. To do that properly first off all, go check stackoverflow.com/questions/32171692/…
– CBroe
Jul 2 at 11:44





I should have known. Updated my code with a better logic.
– saiy2k
Jul 3 at 4:21









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PHP contact form sending but not receiving emails

PHP parse/syntax errors; and how to solve them?

iOS Top Alignment constraint based on screen (superview) height