In the case when the facebook user authed webapp first launches its own application, you will not know who it is. Therefore, they need to request the "Sign in with facebook" button. When they click this button, facebook-ios-sdk will find out who is logging in, and then check if this user has granted access to your application. If the web application and the native application point to the same facebook application, then facebook-ios-sdk will simply save the access token with the outreach, and you will have access to everything that your web application does in its native application.
The key point here is that your web application and your own application must point to the same facebook application (that is, the same application identifier in developers.facebook.com). If this is not the case, then the user of their own application will be re-requested to provide permissions when they click the "Sign in with facebook" button. In addition, it is important that the user logs in to the same facebook account in the web application (based on cookies in the browser) and on the phone itself. Facebook-ios-sdk uses several different ways to find the active facebook account on your phone. He tries to use the iOS 5+ account on facebook, calls between applications to his own facebook application, browser cookies for the web view instance running in your application, or bounce you on safari and use browser cookie on safari. Anyone ever returning first says that they have an active facebook account should find the same facebook account as in the web application. In most cases, they will be the same, since most users have only one facebook account and register everywhere with the same account, but they can be different. In order to avoid that the facebook user in the web application is not the same as the active facebook user as facebook-ios-sdk is detected, then the login with facebook button will simply prompt the user of the active facebook user to log in and grant permissions.
After the access token has been provided to the native application, you can send it back to the server, find the corresponding facebook user ID, and now the user of the web application and the user of their own application can be connected by the same person working in both applications. In addition, any api chart calls that you want to make on the server can be made on behalf of the user using the updated access token that you just received from your own application. Any sharing / publishing / api calls made directly in the native application via facebook-ios-sdk will be executed as this user and will be processed by sdk (that is, you will not need to worry about it ... it should just work without failures and integrate all messages into your timeline the same way you can use the apis graph of web applications).
In case you have a facebook user authed logging into a web application, you will also not know (at the first request) who this user is. You can submit them by logging into facebook js sdk and, again, when the same facebook user logs in, you can associate this current user of the web application with someone who was previously in the native application.
In particular, referring to your question, you really cannot find out who the migrating user is in the web application or in the native application, when they first come to the application. What comes "facebook login". Assuming that the user is logged into the same account in the browser, as well as on his phone (as defined by facebook-ios-sdk), then the process of entering your application is seamless. They will not be asked to grant permissions a second time (unless your permissions are set between the web application and the native application), and you will immediately be given the user's access token. The role of the server is to coordinate the two users using the provided access token. Using an access token, the server can make a simple call to the api chart and get the facebook user id. Using this facebook user ID, you can match the “true” user IDs in your applications (that is, you now know that the user of the web application and the user of their own application are the same). Once you know who the user is, you can provide a personal experience for that user based on his identity, regardless of whether he uses your web application or his own application.
Hope this helps. We will be happy to answer other questions that may arise.