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

# Native Features Requiring Setup

> Eleven Capwrapper bridges need an external account or domain file to activate — push notifications, in-app purchases, AdMob ads, passkeys, and more.

Around 11 Capwrapper bridges require you to create an account or upload a file outside your web app before they are fully functional. Capwrapper handles all of the app-side integration — you provide the credentials or configuration, and the bridge is wired up automatically during your build.

For each feature below you will find what you need to set up externally, what the feature enables, and where in the Capwrapper dashboard you enter the configuration.

***

## Universal Links / App Links

**Bridge:** `NativeAppLinks`

Universal Links (iOS) and App Links (Android) let links to your website open directly in your app instead of the browser. When a user taps `https://yourapp.com/orders/5821` in an email or message, the OS opens your Capwrapper app and passes the URL to it.

**What you need to set up:**

<Steps>
  <Step title="iOS — Apple App Site Association file">
    Host a file at `https://yourapp.com/.well-known/apple-app-site-association` containing your Team ID and bundle ID. Apple fetches this file to verify the association.
  </Step>

  <Step title="Android — assetlinks.json file">
    Host a file at `https://yourapp.com/.well-known/assetlinks.json` containing your app's SHA-256 certificate fingerprint and package name.
  </Step>

  <Step title="Enter your domain in the Capwrapper dashboard">
    Add your domain under **Build config → App Links**. Capwrapper generates the correct file content for you.
  </Step>
</Steps>

Handle incoming deep links in JavaScript:

```javascript theme={null}
NativeAppLinks.onDeepLink((url) => {
  const path = new URL(url).pathname;
  router.push(path);
});
```

***

## Push notifications

**Bridge:** `NativeNotifications`

Send notifications to users even when the app is closed. Notifications are delivered through Firebase Cloud Messaging (FCM), which is free.

**What you need to set up:**

<Steps>
  <Step title="Create a Firebase project">
    Go to [console.firebase.google.com](https://console.firebase.google.com), create a project, and add Android and iOS apps with your bundle IDs.
  </Step>

  <Step title="Download the config files">
    Download `google-services.json` (Android) and `GoogleService-Info.plist` (iOS) from the Firebase console.
  </Step>

  <Step title="Upload to the Capwrapper dashboard">
    Upload both files under **Build config → Firebase**. Capwrapper embeds them in your native build.
  </Step>
</Steps>

You can schedule local notifications without Firebase. For server-sent push notifications, use your FCM server key to call the FCM HTTP API or a provider such as OneSignal.

```javascript theme={null}
// Request permission (required on iOS)
await NativeNotifications.requestPermission();

// Schedule a local notification
NativeNotifications.schedule({
  title: 'Reminder',
  body: 'Your session starts in 15 minutes.',
  delaySeconds: 900,
});

// Get the device push token for server-sent notifications
const { token } = await NativeNotifications.getToken();
sendTokenToYourServer(token);
```

***

## In-app purchases

**Bridge:** `NativeInAppPurchase`

Sell subscriptions and one-time digital goods using the native payment flows on iOS (App Store) and Android (Google Play). Capwrapper integrates with RevenueCat, which handles cross-platform receipt validation and subscription state.

**What you need to set up:**

<Steps>
  <Step title="Create a RevenueCat account">
    Sign up at [revenuecat.com](https://www.revenuecat.com) and create a project. RevenueCat has a free tier.
  </Step>

  <Step title="Configure products in the app stores">
    Set up subscription or one-time product IDs in App Store Connect and the Google Play Console. Add the same product IDs in your RevenueCat project.
  </Step>

  <Step title="Add your RevenueCat API key to Capwrapper">
    Enter your RevenueCat public API key under **Build config → In-App Purchases**.
  </Step>
</Steps>

```javascript theme={null}
// Fetch available offerings
const { offerings } = await NativeInAppPurchase.getOfferings();

// Purchase a product
NativeInAppPurchase.purchase({
  productId: 'pro_monthly',
  onSuccess: (purchaseInfo) => unlockProFeatures(purchaseInfo),
  onError: (error) => console.error(error.message),
});

// Restore purchases (required by App Store guidelines)
await NativeInAppPurchase.restorePurchases();
```

***

## Google Sign-In SDK

**Bridge:** `NativeSocialLogin`

Provides deeper Google sign-in integration beyond the [automatic Google Sign-In fix](/native-features/automatic-features). This includes one-tap sign-in, silent token refresh, and access to additional OAuth scopes.

**What you need to set up:**

<Steps>
  <Step title="Create OAuth credentials in Google Cloud Console">
    Go to [console.cloud.google.com](https://console.cloud.google.com), create an OAuth 2.0 Client ID for iOS and another for Android.
  </Step>

  <Step title="Add the client IDs to Capwrapper">
    Enter the iOS and Android client IDs under **Build config → Social Login → Google**.
  </Step>
</Steps>

```javascript theme={null}
NativeSocialLogin.signInWithGoogle({
  onSuccess: (user) => {
    // user.idToken, user.email, user.displayName
    authenticateWithYourServer(user.idToken);
  },
  onError: (error) => console.error(error),
});
```

***

## AdMob ads

**Bridge:** `NativeAdMob`

Show banner, interstitial, and rewarded ads in your app using Google AdMob.

**What you need to set up:**

<Steps>
  <Step title="Create a Google AdMob account">
    Sign up at [admob.google.com](https://admob.google.com) and create an app for iOS and Android.
  </Step>

  <Step title="Create ad units">
    Create the ad unit IDs (banner, interstitial, rewarded) you want to use.
  </Step>

  <Step title="Add your AdMob App IDs to Capwrapper">
    Enter the AdMob App IDs for iOS and Android under **Build config → AdMob**. Capwrapper embeds them at build time — this is required even before you show any ads.
  </Step>
</Steps>

```javascript theme={null}
// Show a banner ad
NativeAdMob.showBanner({ adUnitId: 'ca-app-pub-xxx/banner_id', position: 'bottom' });

// Show a full-screen interstitial
NativeAdMob.showInterstitial({ adUnitId: 'ca-app-pub-xxx/interstitial_id' });

// Show a rewarded ad
NativeAdMob.showRewarded({
  adUnitId: 'ca-app-pub-xxx/rewarded_id',
  onReward: (reward) => grantUserCoins(reward.amount),
});
```

<Warning>
  AdMob requires you to declare ad usage in your App Store Connect and Google Play Console listings. Failure to disclose this can result in app rejection or removal.
</Warning>

***

## Firebase Analytics

**Bridge:** `NativeAnalytics`

Log named events with parameters to Firebase Analytics for user behavior analysis. If you have already set up Firebase for push notifications, the same project covers analytics — no extra configuration is needed.

**What you need to set up:**

If you have not already set up Firebase, follow the steps in [Push notifications](#push-notifications) above. Both features use the same `google-services.json` / `GoogleService-Info.plist` files.

```javascript theme={null}
NativeAnalytics.logEvent({
  name: 'checkout_started',
  params: {
    cart_value: 89.95,
    item_count: 3,
    currency: 'USD',
  },
});
```

<Note>
  Firebase Analytics events appear in the Firebase console with up to a 24-hour delay. Use DebugView in the Firebase console for real-time event inspection during development.
</Note>

***

## Social login

**Bridge:** `NativeSocialLogin`

Native Google, Facebook, and Apple sign-in using the official SDKs. Each provider requires its own external credentials.

**What you need to set up:**

| Provider | External requirement                                                                           |
| -------- | ---------------------------------------------------------------------------------------------- |
| Google   | OAuth 2.0 client IDs from Google Cloud Console (see [Google Sign-In SDK](#google-sign-in-sdk)) |
| Facebook | App ID and App Secret from [developers.facebook.com](https://developers.facebook.com)          |
| Apple    | Enable "Sign in with Apple" capability in your Apple Developer account                         |

Add all credentials under **Build config → Social Login** in the Capwrapper dashboard.

```javascript theme={null}
// Apple sign-in
NativeSocialLogin.signInWithApple({
  onSuccess: (user) => authenticateWithYourServer(user.identityToken),
  onError: (error) => console.error(error),
});

// Facebook sign-in
NativeSocialLogin.signInWithFacebook({
  onSuccess: (user) => authenticateWithYourServer(user.accessToken),
  onError: (error) => console.error(error),
});
```

<Note>
  Apple Sign-In is mandatory on iOS if your app offers any other third-party sign-in option. Omitting it can result in App Store rejection.
</Note>

***

## Health data

**Bridge:** `NativeHealth`

Read step count and basic activity data from Apple Health (iOS) or Google Fit (Android). The user must grant permission the first time your app requests health access.

**What you need to set up:**

* **iOS:** Enable the HealthKit capability in your Apple Developer account under your App ID. Capwrapper adds the required entitlements automatically when you enable **Health** in **Build config → Permissions**.
* **Android:** Enable the Google Fit API in Google Cloud Console and add the OAuth scope to your credentials.

```javascript theme={null}
// Request permission
const { granted } = await NativeHealth.requestPermission({ metrics: ['steps'] });

if (granted) {
  const { steps } = await NativeHealth.getSteps({
    startDate: '2026-04-01',
    endDate: '2026-04-11',
  });
  displayStepCount(steps);
}
```

***

## Background location

**Bridge:** `NativeBackgroundLocation`

Tracks the device's GPS location continuously, even when the app is in the background or the screen is locked. The user must explicitly grant "Always Allow" location permission — not just "While Using the App."

**What you need to set up:**

Enable **Background Location** under **Build config → Permissions** in the Capwrapper dashboard. This adds the required background mode entitlements and permission strings to the native build. No external account is needed.

```javascript theme={null}
// Request "always" permission (prompts the user)
const { status } = await NativeBackgroundLocation.requestPermission();

if (status === 'always') {
  NativeBackgroundLocation.startTracking({
    distanceFilter: 50, // meters between updates
    onLocation: (location) => {
      sendLocationToServer(location.latitude, location.longitude);
    },
  });
}

NativeBackgroundLocation.stopTracking();
```

<Warning>
  Both Apple and Google require a compelling justification for background location access. Describe the use case clearly in your app store listing and in the permission prompt text. Apps that cannot justify continuous background location are likely to be rejected.
</Warning>

***

## Passkey / WebAuthn

**Bridge:** `NativePasskey`

Passwordless authentication using the device's biometric sensor (Face ID, Touch ID, or fingerprint) or PIN. Passkeys are built on the WebAuthn standard and are synced via iCloud Keychain (iOS) or Google Password Manager (Android).

**What you need to set up:**

<Steps>
  <Step title="Configure your server for WebAuthn">
    Your backend must implement the WebAuthn Relying Party protocol. Libraries are available for Node.js, Python, Go, and most other stacks.
  </Step>

  <Step title="Host an AASA / assetlinks file">
    The passkey domain must match a verified domain. The same files used for [Universal Links / App Links](#universal-links-app-links) satisfy this requirement.
  </Step>

  <Step title="Enable Passkey in the Capwrapper dashboard">
    Turn on **Passkey / WebAuthn** under **Build config → Auth**. Capwrapper adds the associated domains entitlement automatically.
  </Step>
</Steps>

```javascript theme={null}
// Register a new passkey
NativePasskey.register({
  challenge: serverChallenge,
  userId: currentUser.id,
  username: currentUser.email,
  onSuccess: (credential) => sendCredentialToServer(credential),
  onError: (error) => console.error(error),
});

// Authenticate with an existing passkey
NativePasskey.authenticate({
  challenge: serverChallenge,
  onSuccess: (assertion) => verifyAssertionOnServer(assertion),
  onError: (error) => console.error(error),
});
```

***

## Share into app

**Bridge:** `NativeShareInto`

Registers your app as a share target so users can share URLs, text, images, and files from Safari, Photos, Messages, and other apps directly into your Capwrapper app.

**What you need to set up:**

Enable **Share Extension** under **Build config → Capabilities** in the Capwrapper dashboard. Capwrapper creates the native share extension and wires it to the `NativeShareInto` bridge automatically. No external account is required.

```javascript theme={null}
NativeShareInto.onReceive((payload) => {
  // payload.type: 'url' | 'text' | 'image' | 'file'
  // payload.value: string (URL, text) or base64 (image/file)
  switch (payload.type) {
    case 'url':
      router.push(`/bookmarks/new?url=${encodeURIComponent(payload.value)}`);
      break;
    case 'image':
      uploadSharedImage(payload.value);
      break;
  }
});
```

***

## Summary

| Feature                     | Bridge                     | External requirement                    |
| --------------------------- | -------------------------- | --------------------------------------- |
| Universal Links / App Links | `NativeAppLinks`           | Verification file on your domain        |
| Push notifications          | `NativeNotifications`      | Firebase project                        |
| In-app purchases            | `NativeInAppPurchase`      | RevenueCat account + app store products |
| Google Sign-In SDK          | `NativeSocialLogin`        | Google Cloud OAuth credentials          |
| AdMob ads                   | `NativeAdMob`              | Google AdMob account + ad unit IDs      |
| Firebase Analytics          | `NativeAnalytics`          | Firebase project (shared with Push)     |
| Social login                | `NativeSocialLogin`        | Provider credentials per sign-in method |
| Health data                 | `NativeHealth`             | HealthKit / Google Fit API enablement   |
| Background location         | `NativeBackgroundLocation` | Dashboard capability flag only          |
| Passkey / WebAuthn          | `NativePasskey`            | WebAuthn server + domain verification   |
| Share into app              | `NativeShareInto`          | Dashboard capability flag only          |

<Tip>
  If you use an AI builder (Base44, Bolt, Lovable, Cursor, or Replit), paste any snippet from this page and describe the feature. The AI can implement the complete integration for you.
</Tip>

## Related pages

<CardGroup cols={2}>
  <Card title="Code-activated features" icon="code" href="/native-features/code-activated-features">
    \~32 features you unlock with a JavaScript snippet — no external accounts required.
  </Card>

  <Card title="All 40 bridges overview" icon="grid" href="/native-features/overview">
    Full table of every native bridge and its activation tier.
  </Card>
</CardGroup>
