# Facebook Login

For information on using the console outside of GAMEPOT integration, please refer to [Meta for Developers](https://developers.facebook.com/docs/facebook-login/).

> Facebook Developer Platform: [https://developers.facebook.com](https://developers.facebook.com/)

## Registering Facebook Login Authentication Information in GAMEPOT DashboardTo register the Facebook authentication key in the GAMEPOT dashboard, follow these steps: GAMEPOT Dashboard > Project Settings > Authentication > Facebook menu. <a href="#gamepot" id="gamepot"></a>

<figure><img src="/files/fV6mpX9FqXp0mJ5kRbOI" alt=""><figcaption></figcaption></figure>

### Facebook Login SettingsTo use Facebook Login, you need to enter the following three items in the GAMEPOT Dashboard > Project Settings > Authentication > Facebook. <a href="#facebook" id="facebook"></a>

<figure><img src="/files/1dngo7v6yDol5nGCfNn8" alt=""><figcaption></figcaption></figure>

1. Facebook App ID&#x20;
2. Facebook Protocol Scheme&#x20;
3. Facebook Client Token

### How to Check Facebook App ID / Protocol Scheme / Client Token Information

### (Important) Things to be aware of when creating the app:&#x20;

1. In the Use Case section, select the required features and choose "Authenticate and request user data via Facebook Login" before creating the app.

<figure><img src="/files/IJk0vLgI6XL0dGr5CZTw" alt=""><figcaption></figcaption></figure>

2. After creating the app, select "Add Facebook Login button customization" > Permissions > Add "email".

<figure><img src="/files/PjLWHUpVsICykyKW49Ff" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/PCe4eqV1MVIAUFEdBulz" alt=""><figcaption></figcaption></figure>

## Checking Facebook Login Configuration Values <a href="#facebook-app-id-facebook-protocol-scheme-facebook-client-token" id="facebook-app-id-facebook-protocol-scheme-facebook-client-token"></a>

### 1. Facebook App ID <a href="#facebook-app-id-facebook-protocol-scheme-facebook-client-token" id="facebook-app-id-facebook-protocol-scheme-facebook-client-token"></a>

Go to App Creation > App Settings > Basic Settings > App ID.

<figure><img src="/files/diJ5eYbATHAPQG7EAALn" alt=""><figcaption></figcaption></figure>

### 2. Facebook Protocol Scheme

Prefix the 'Facebook App ID' with 'fb' and enter it in the "Facebook Protocol Scheme" field.

<figure><img src="/files/7aBtTQkL4anIzb42u66e" alt=""><figcaption></figcaption></figure>

### **3. Facebook Client Token**

In App Settings > Advanced Settings, enter the Client Token information in the "Facebook Client Token" field.

<figure><img src="/files/OPocX0qfgc8ori6ndXUN" alt=""><figcaption></figcaption></figure>

### 4. **Add Platform**

#### 1) Android&#x20;

In App Settings > Basic Settings, click "Add Platform" and choose Android.&#x20;

<div align="left"><figure><img src="/files/4U7IaOcfsdcFokxkNDvw" alt=""><figcaption></figcaption></figure></div>

Enter Android-specific information.

<figure><img src="/files/bSiJQK7xr1wubvggabFi" alt=""><figcaption></figcaption></figure>

* **Key Hash**: Enter the SHA-1 key hash value you are using.
* **Package Name**: Enter the package name.
* **Class Name**: Append ".MainActivity" to the package name and enter it.

#### 2) iOS

Go to App Settings > Basic Settings, then click "Add Platform" and select iOS.&#x20;

<div align="left"><figure><img src="/files/Fc6KTUizHoB7gxRi5QgM" alt=""><figcaption></figcaption></figure></div>

Enter the iOS information.

<figure><img src="/files/ygITXRiNYpmSloKRRk8b" alt=""><figcaption></figcaption></figure>

* **Bundle ID**: Enter the Bundle ID that matches the one in App Store Connect.

## For Unity, URL Schemes Entry (iOS) <a href="#url-schemes-ios" id="url-schemes-ios"></a>

For Unity, to integrate Facebook on iOS, you need to enter the Scheme value in the "Supported URL Schemes" as follows:

**\[Where to obtain the iOS URL Schemes for Facebook Login]**

To find the content for the Facebook URL Schemes, you can follow these steps:

* Go to Facebook Console > App Settings > Basic Settings and add "fb" before the APP ID. \
  (Example: If the APP ID is 1822222, the URL Scheme will be "fb1822222").

In Unity, go to Player Settings -> Other Settings -> Supported URL Schemes, and enter the Facebook-provided iOS URL Scheme as shown in the image.

* Entering '1' in the size field will create an Element 0 box for you to input the value.

<figure><img src="/files/8eEpqOFY73z1BittktEX" alt=""><figcaption></figcaption></figure>

## Replace the Method Code in AppDelegate.swift (iOS Native) <a href="#appdelegateswift-iosnative" id="appdelegateswift-iosnative"></a>

Replace the method code in AppDelegate.swift with the following code. This code initializes the SDK when the app starts and ensures that the SDK handles login and sharing actions via the Facebook native app.

```swift
// AppDelegate.swift
import UIKit
import FBSDKCoreKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
       
        
        ApplicationDelegate.shared.application(
            application,
            didFinishLaunchingWithOptions: launchOptions
        )
    }
    
    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        let sceneConfiguration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
        
        sceneConfiguration.delegateClass = SceneDelegate.self
        
        return sceneConfiguration
    }
}

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
    
    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        guard let url = URLContexts.first?.url else {
            return
        }
        
        ApplicationDelegate.shared.application(
            UIApplication.shared,
            open: url,
            sourceApplication: nil,
            annotation: [UIApplication.OpenURLOptionsKey.annotation]
        )
    }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gamepot.io/basics/gamepot-3.0/images-and-media/editor/login-authentication-settings/facebook-login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
