> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pnta.io/llms.txt
> Use this file to discover all available pages before exploring further.

# FlutterFlow

> Set up push notifications in your FlutterFlow project using PNTA

## Prerequisites

* FlutterFlow account and project
* PNTA account with project ID (`prj_XXXXXXXXX`)
* For Android: Firebase project
* For iOS: Apple Developer account
* Platform keys configured in [PNTA Dashboard](https://app.pnta.io) (see [Platform Keys Setup](/resources/platform-keys))

## Setup Steps

### 1. Firebase Configuration (Android Only)

In FlutterFlow, set up Firebase for Android (FlutterFlow handles all the configuration automatically):

1. Go to **Settings** → **Firebase**
2. Either create a new Firebase project or connect an existing one
3. Click **Generate Config Files**
4. FlutterFlow will handle the `google-services.json` setup automatically

<Warning>
  **Do NOT enable FlutterFlow's built-in push notifications.** This setting
  adds FlutterFlow's own implementation that only uses FCM and requires
  Firebase Auth. PNTA works fully independent of this and is compatible with
  any auth or database you decide to use.
</Warning>

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_firebase.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=6d8c01b00f0f6a47b5f2dddf1292a0b7" alt="FlutterFlow Firebase Setup" width="3520" height="2384" data-path="images/flutterflow_firebase.png" />

### 2. Add PNTA Dependency

1. Go to **Settings** → **Project Dependencies**
2. Click **Add Pub Dependency**
3. Visit [pub.dev/packages/pnta\_flutter](https://pub.dev/packages/pnta_flutter)
4. Copy the latest version and paste it into FlutterFlow

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_dependencies.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=85a31e049664e3ca9a7fda5355d0b6a2" alt="FlutterFlow Dependencies" width="3520" height="2384" data-path="images/flutterflow_dependencies.png" />

### 3. iOS Configuration

Go to **Custom Code** → **Configuration Files** and edit these files to add capabilities normally enabled in Xcode:

**Properties → `Info.plist`:**

```xml theme={null}
<key>UIBackgroundModes</key>
<array>
    <string>remote-notification</string>
</array>
```

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_plist.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=76b77b3042ab0f43d2dc778d651fb369" alt="FlutterFlow Info.plist" width="3520" height="2384" data-path="images/flutterflow_plist.png" />

**Entitlements → `Runner.entitlements`:**

```xml theme={null}
<key>aps-environment</key>
<string>production</string>
```

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_entitlements.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=3988357d22b8b36113a77b88bbb2a567" alt="FlutterFlow Entitlements" width="3520" height="2384" data-path="images/flutterflow_entitlements.png" />

### 4. Custom Actions

Create custom actions in **Custom Code** → **Actions** for PNTA integration.

Copy the required custom actions from our [FlutterFlow example project](https://marketplace.flutterflow.io/item/eD9VoY6IvHuucFq4iN9z) into your project.

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_custom_actions.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=fb4a7c5703d9e1feaf813d2a7f698069" alt="FlutterFlow Custom Actions" width="3520" height="2384" data-path="images/flutterflow_custom_actions.png" />

### 5. Wire Up Your App

Add these custom actions to your app's **Initial Actions** in FlutterFlow.

**Required:**

**`pntaInitialize`**\
Initialize PNTA with your project ID and optional settings (defaults do not need to be declared):

* `projectId` - your PNTA project ID (required)
* `registerDevice` - set false if you want to use prompt registration in a specific flow in your app (default: true)
* `autoHandleLinks` - true to automatically open URLs, requires pntaOnNotificationTap to be set up (default: false)
* `showSystemUI` - true to show iOS notification banners and Android notification tray/sounds in the **foreground** (default: false)

**Optional:**

**`pntaOnNotificationTap`**\
Handle when users tap notifications from background or closed app. Required if using automatic link handling.

**`pntaForegroundNotifications`**\
Listen for notifications when your app is active. Sends notification data to FlutterFlow app state for custom in-app messages.

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_main_dart.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=c754b6510b3c15d74c6b6df7ac4802c3" alt="FlutterFlow Main Dart Initial Actions" width="3520" height="2384" data-path="images/flutterflow_main_dart.png" />

### 6. Additional Methods

These methods can be used anywhere in your app on specific pages:

**`pntaRegisterDevice`**\
Use for delayed registration anywhere in the UI.

**`pntaDeviceToken`**\
Device token getter if you want to store it.

**`pntaUpdateMetadata`**\
Update device metadata in PNTA.

**`pntaHandleLink`**\
Opens link passed in the notification payload. You can also use FlutterFlow's default "Launch URL" action which does pretty much the same. For routing within your app using notifications, use the URL scheme provided in **Settings** → **App Details** (e.g., `myapp://myapp.com/profile`).

<img src="https://mintcdn.com/pnta/GslhXvvpXfFEY_SW/images/flutterflow_deep_linking.png?fit=max&auto=format&n=GslhXvvpXfFEY_SW&q=85&s=36bb2cf34344c0ef2b6f748076d3c3ba" alt="FlutterFlow Deep Linking" width="3520" height="2384" data-path="images/flutterflow_deep_linking.png" />

<Info>
  Check out the example project for these additional custom actions and see
  how they're implemented in FlutterFlow's action builder. Test different
  initialize settings to find what works best for your app's user experience.
</Info>

## Resources

<CardGroup cols={2}>
  <Card title="PNTA Flutter Package" icon="flutter" href="https://pub.dev/packages/pnta_flutter">
    View package details and documentation on pub.dev
  </Card>

  <Card title="FlutterFlow Example Project" icon="code" href="https://marketplace.flutterflow.io/item/eD9VoY6IvHuucFq4iN9z">
    Complete FlutterFlow project with PNTA integration
  </Card>
</CardGroup>
