Facebook like button on Apache Cordova/Phonegap app

╄→гoц情女王★ 提交于 2019-12-06 11:35:38

问题


I have inserted a facebook like button with this methods like a simple web: https://developers.facebook.com/docs/plugins/like-button

But the first time that a button is pressed a login window opens. This window opens in the current window, not in a new window. After the user logs in the window try to close itself but it can't. A white window is showed. Next times the like button works correctly because the user is logged in.

I also try to implement with the cordova plugin "phonegap-facebook-plugin" but it doesn't have support for like button. https://github.com/phonegap/phonegap-facebook-plugin


回答1:


I think you need to listen to when they've finished logging in and redirect back to you're application some like this.

Only with window.location set to something like file:///android_asset/www/index.html or whatever page you want to return the user to.

<fb:login-button onlogin="document.location.href='file:///android_asset/www/index.html';"> </fb:login-button>

Something like this but for the like button ?



来源:https://stackoverflow.com/questions/23871644/facebook-like-button-on-apache-cordova-phonegap-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!