This is a migrated thread and some comments may be shown as answers.

Facebook Sample - Logged in & Logout

3 Answers 71 Views
Sample Applications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HSLaw
Top achievements
Rank 1
HSLaw asked on 15 Sep 2014, 08:22 AM
Hi,

I'm trying the sample on http://docs.telerik.com/platform/appbuilder/sample-apps/sample-facebook-api

My questions:

1. Logged in:
- How do we detect a user is already logged in?  So that we can hide the login button and show the logout button.

2. Logout:
Tried the codes to revoke permission & wipe the token (below). But it does not clear the logged in user fully.  When I click Login again, I no need to key in username & password and can just click OK to continue.  How can I logout so that I need to key in the username and password again?

01.$.oajax({
02.          type: "DELETE",
03.          url: "https://graph.facebook.com/me/permissions",
04.          jso_provider: "facebook",
05.          jso_allowia: true,
06.          dataType: 'json',
07.          success: function(data) {
08.              outputlog("Delete response (facebook):");
09.              outputlog(data);
10.          },
11.          error: function(e) {
12.              outputlog(e);
13.          }
14.      });
15. 
16.      outputlog("wipe tokens");
17.     jso_wipe();


Thanks.


3 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 17 Sep 2014, 03:53 PM
Hi,

1. You can detect when the user is logged in your app in the success handler of the login method.

2. I assume that the user is logged in the native FB app on the device which persists the token on the device. This is probably the main reason why the user logged in your app cannot log out it.

In addition, there is a forum thread about the issues in the pure JavaScript (as in the sample app) implementation of the plugin which you can consult here.

Let me know if further questions arise.

Regards,
Anton Dobrev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Anton Dobrev
Telerik team
answered on 25 Sep 2014, 09:41 AM
Hi,

Just a quick follow-up. I updated the forum thread here with a Telerik AppBuilder-compatible version of the Facebook Connect plugin and a sample app that uses it.

Let me know if this is helpful for you.

Best regards,
Anton Dobrev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
HSLaw
Top achievements
Rank 1
answered on 26 Sep 2014, 05:51 AM
Thanks Anton,

I will follow up in the other thread.
Tags
Sample Applications
Asked by
HSLaw
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
HSLaw
Top achievements
Rank 1
Share this question
or