Facebook like button on Apache Cordova/Phonegap app - facebook

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

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 ?

Related

Bottom native button

I'm sorry because I don't speak English very well. I would like to know if it is possible to control the bottom 3 native buttons of Android phone? Example When I am in the application, if I click on the home button or another can I write something in the console or another action before my application closes or even program that I am redirected to the page HomePage before my application closes?
For example, regarding the back button, you can control it with WillPopScope : https://api.flutter.dev/flutter/widgets/WillPopScope-class.html

Flutter Show a page every time the user opens the app, until they click a button, then it should show a different page when they open the app

The problem I’m asking is how to have a kind of page (call it SetupPage) that is only shown until the user presses a button on the screen. Then when the screen should show the next page(call it HomePage) and every time the app is opened after the button press, the normal page will be HomePage.
I’ve seen this general idea in many apps (sign-in and home page, enter phone number or school and main page, etc) and I would like to have it in my app! I’m thinking of using Navigator routes and having the stack be this at first:
(HomePage, SetupPage)
and then once the button is pressed I can pop SetupPage. But I’m not sure how to implement this.
I already have the SetupPage and HomePage classes made. I’m not doing a sign-in the SetupPage or anything like that. I’m not using FireBase in this app either.
You can use the Flutter package shared_preferences to save a Boolean that tell you at the start of the program is the button pressed or not.

how can I disable bootstrap modal on desktop and enable only for mobile/tablets?

enter image description here
We have two user interface, one for desktop and one for mobile, when user gonna login via desktop, then the username input and username password fields will show, and when it turns into mobile view, then both fields will be hidden and the screen shows look like below;
enter image description here
the issue is this, when I try to log in and click on login button, the login will appear ok, but when I click on login via desktop, the modal will appear too, I want to move or display hidden login popup on desktop screen. please answer.
You can handle click event on the button and check whether are input fields visible or not. If not, then show modal programmatically by calling $("#modal").modal('show')
So as default, use your login form as regular form (dont use bootstrap modal) and in JS:
$("#submitbutton").click(function() { //catch button click
if ( !$("#username").is(":visible") ) { //is mobile version?
event.preventDefault(); //dont send form
$("#modal").modal('show'); //but instead, show modal
}
});

like button revert after click on mobile web?

I make a mobile web with a like button to simulate a like gate-way.
When user click on it, it triggered edge_create event, the like button turn grey, but then it revert immediately and go to the fan page.
But if the user press on the like button long enough, the like action is triggered correctly.
I cannot figure out what is the reason and how to fix it...any one has the same issue?

Facebook like button status update

i have a like button and a log in button on the same page. the page is outside of a Facebook iframe. if i am not logged in and log in through the log in button the like button status doesn't get updated. but if i'm not logged in and log in via the like button the log in button gets updated. from what i can tell the like button doesn't seem to be able to receive the updates when window.fbAsyncInit is fired off.
is there a way to update the like button when i log in through a different Facebook button on the page?
Here's a work-around.
Subscribing to the auth.statusChange (http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) and check to see if it is a sucessful login. If so, re-render the like button code into your DOM and then have the Javascript SDK re-parse it using FB.XFBL.parse() (http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/)