Bug 30287 - [Facebook iOS SDK] Login is not maintained when app is terminated and relaunched.
Summary: [Facebook iOS SDK] Login is not maintained when app is terminated and relaunc...
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: N/A
Hardware: PC Mac OS
: --- enhancement
Target Milestone: ---
Assignee: Israel Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-05-20 20:53 UTC by Jon Goldberger [MSFT]
Modified: 2015-06-11 21:33 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Project (15.25 KB, application/zip)
2015-05-20 20:53 UTC, Jon Goldberger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Jon Goldberger [MSFT] 2015-05-20 20:53:34 UTC
Created attachment 11271 [details]
Test Project

## Description

When using the Facebook iOS SDK form the Component store, https://components.xamarin.com/view/facebookios, and running the sample (attached), if you open the app, log in to a Facebook account, and then terminate the app (not just close it, but kill it by double tapping home screen and sliding the app up), when the app is relaunched, the user needs to log in again.

Running Facebooks native Obj-C sample "ShareIt", available in the SDK sample folder (https://developers.facebook.com/docs/ios) I note that log in is maintained after termination the app and relaunching.

## Steps to reproduce

1. Open the attached sample (unchanged sample from the Component) and restore packages. This should restore the latest update of the SDK, version 4.1.2.

2. Run the project in Release configuration to install the app to a device /  simulator.

3. Press "Stop" in Xamarin studio (to avoid any odd behavior while add is connected)

4. Relaunch the app by tapping on the icon on the simulator/device.

5. Log in to a Facebook account.

6. Close and kill the app by double clicking the home button and sliding the app thumbnail up to kill it.

7. Relaunch the app.

Expected result: User will still be logged in,

Actual result: User is not logged in.


Screencast: http://screencast.com/t/OKYhIMztJA

## My environment

=== Xamarin Studio ===

Version 5.9.1 (build 3)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Runtime:
	Mono 4.0.0 ((detached/d136b79)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400000143

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.Mac ===

Version: 2.0.0.262 (Business Edition)

=== Xamarin.Android ===

Version: 5.1.1.0 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: 8.10.0.267 (Business Edition)
Hash: 6481535
Branch: master
Build date: 2015-04-27 04:38:13-0400

=== Build Information ===

Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f

=== Operating System ===

Mac OS X 10.10.3
Darwin Jons-iMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Israel Soto [MSFT] 2015-05-21 15:06:32 UTC
Hi Jon!

If you want to keep logged in your app, even after you kill your app, in the FinishedLaunching method in your AppDelegate file, you need to return:

return ApplicationDelegate.SharedInstance.FinishedLaunching (app, options);

instead of:

return true;

ApplicationDelegate is a class within the Facebook.CoreKit namespace. This class handle the login of your app before the first view is loaded.
Comment 2 Jon Goldberger [MSFT] 2015-05-27 15:38:34 UTC
Hi Israel,

I am re-opening and changing this to an enhancement request.

I am under the impression that the Components team is responsible for its own documentation. If so, I think that this is something that would be good to note in the "getting started" page for this component, as it is not clear from the current documentation. 

Thanks!
Comment 3 Israel Soto [MSFT] 2015-06-11 21:22:06 UTC
Jon,

I updated the docs for Facebook iOS component, also, I added a new sample.

Greetings.
Comment 4 Jon Goldberger [MSFT] 2015-06-11 21:33:00 UTC
Awesome, thanks!