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

# Capacitor native setup

> Configure Firebase on Android and APNs with optional confirmed delivery on iOS.

<Tabs>
  <Tab title="Android">
    Add the Firebase `google-services.json` to the Android app module and apply the Google Services Gradle plugin. Keep `google()` and `mavenCentral()` in dependency repositories.

    The plugin resolves the native Android SDK and merges its Firebase messaging service automatically.
  </Tab>

  <Tab title="iOS">
    Enable the Push Notifications capability. Capacitor does not automatically forward APNs registration callbacks. Add both callbacks to the host application's `AppDelegate.swift`:

    ```swift theme={null}
    func application(
        _ application: UIApplication,
        didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
    ) {
        NotificationCenter.default.post(
            name: .capacitorDidRegisterForRemoteNotifications,
            object: deviceToken
        )
    }

    func application(
        _ application: UIApplication,
        didFailToRegisterForRemoteNotificationsWithError error: Error
    ) {
        NotificationCenter.default.post(
            name: .capacitorDidFailToRegisterForRemoteNotifications,
            object: error
        )
    }
    ```

    These notifications are compatible with the Capacitor Push Notifications plugin and can coexist with another provider during migration. Without them, `waitForRegistration()` rejects after 15 seconds with an actionable error.

    Match the Pushctl APNs environment to the installed build. Development-signed Xcode builds use Sandbox; TestFlight and App Store builds use Production. See the [iOS FAQ](/sdks/ios/faq).

    For background `received` and `displayed` events, add the [iOS Notification Service Extension](/sdks/ios/delivery-events) and initialize with the shared App Group:

    ```typescript theme={null}
    await Pushctl.initialize({
      applicationKey: 'push_live_your_client_token',
      appGroupIdentifier: 'group.com.example.app.pushctl',
    });
    ```
  </Tab>
</Tabs>

## Self-hosted endpoint

Set `apiUrl` only when the Pushctl API runs elsewhere:

```typescript theme={null}
await Pushctl.initialize({
  applicationKey: 'push_live_your_client_token',
  apiUrl: 'https://push.example.com/api/v1',
});
```

<Note>Run `npx cap sync` after installing or upgrading the package so native projects receive the current dependency and manifest changes.</Note>
