# Custom Dynamic Link

## Mobile App

## 📖 Deep Linking & App Scheme Setup

This project supports **deep linking** on both **Android** and **iOS**.\
Developers can update the **app scheme** and **host** to match their own brand/domain.

***

### 🔧 Current Configuration

* **Scheme:** `glover://`
* **Host:** `glover.edentech.online`

If you are customizing this project, replace `glover` and `glover.edentech.online` with your own values.

### 1. Android Setup

File: `android/app/src/main/AndroidManifest.xml`

Two intent filters are used:

```
<!-- Handle custom scheme -->
<intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>

    <data
        android:scheme="glover"/>
</intent-filter>

<!-- Handle HTTPS host -->
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>

    <data
        android:scheme="https"
        android:host="glover.edentech.online"/>
</intent-filter>
```

#### 🔄 To update:

* Replace `glover` with your **scheme name**.
* Replace `glover.edentech.online` with your **domain host**.

### 2. iOS Setup

File: `ios/Runner/Info.plist`

Add **URL Schemes**:

```
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLName</key>
    <string>glover</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>glover</string>
    </array>
  </dict>
</array>
```

Add **Associated Domains** (for universal links):

```
<key>com.apple.developer.associated-domains</key>
<array>
  <string>applinks:glover.edentech.online</string>
</array>
```

#### 🔄 To update:

* Replace all `glover` entries with your **scheme name**.
* Replace `glover.edentech.online` with your **domain host**.\
  \\

## ⚙️ Dynamic Link Settings (Backend)

The backend provides a configuration page for **Dynamic & Deep Linking**. This ensures mobile apps (Android & iOS) can open links using the correct **scheme** and **host/domain**.

***

### 1. Navigation

* Go to **Settings → Dynamic Link Settings** from the admin sidebar.

***

### 2. Fields Description

| Field                                   | Description                                                                                                               | Example                 |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
| **Dynamic Link Prefix**                 | The Firebase/Custom Dynamic Link prefix used for universal links.                                                         | `glover.page.link`      |
| **Dynamic Link Scheme**                 | The app’s custom URL scheme. Must match the values configured in the mobile app (`AndroidManifest.xml` and `Info.plist`). | `glover`                |
| **Customer App - Android Package Name** | The unique Android app package name.                                                                                      | `online.edentech.fuodz` |
| **Customer App - SHA256 Debug Key**     | The SHA-256 fingerprint of the Android debug keystore. Required for Firebase/Play Store verification.                     | `AA:BB:CC:DD:EE:FF:...` |
| **Customer App - SHA256 Release Key**   | The SHA-256 fingerprint of the release keystore used in production builds.                                                | `AA:BB:CC:DD:EE:FF:...` |
| **Customer App - iOS Bundle ID**        | The iOS bundle identifier from Xcode.                                                                                     | `online.edentech.fuodz` |
| **Customer App - iOS APP ID**           | The numeric App ID from your Apple Developer account.                                                                     | `2322232`               |

### 3. Updating Steps

1. Enter your **dynamic link prefix** (e.g. Firebase project prefix).
2. Set your **scheme** (e.g. `myapp`).
3. Fill in Android package name + SHA keys.
   * Debug key: from debug builds.
   * Release key: from production signing key.
4. Fill in iOS bundle ID + App ID.
5. Click **Save Changes**.

***

### 4. Notes

* Ensure the scheme and host values here **match what you configured in your mobile app**.
* Changing these settings requires updating both **AndroidManifest.xml** and **Info.plist** in the app.
* SHA256 keys can be generated with:

```
keytool -list -v -keystore my-release-key.jks -alias my-key-alias -storepass ***** -keypass *****
```
