B Bubbl Docs

Firebase Setup (React Native)

This guide provides the complete setup for Firebase Cloud Messaging (FCM), which the Bubbl SDK uses to deliver campaign signals and push notifications on both platforms.

1. Project Configuration

Ensure you have added your google-services.json (Android) and GoogleService-Info.plist (iOS) to their respective native directories.

Android Dependencies & Init

  1. Add Configuration: Place your google-services.json in the android/app directory
  2. Apply Plugin: Ensure the Google Services plugin is applied at the top of android/app/build.gradle.
  3. Implement Libraries: Add the following to your dependencies:
implementation(platform("com.google.firebase:firebase-bom:33.3.0"))
implementation("com.google.firebase:firebase-messaging-ktx:24.0.0")
  1. Initialize Firebase: If your app does not auto-initialize, ensure it initializes in your Application class:
if (FirebaseApp.getApps(this).isEmpty()) {
  FirebaseApp.initializeApp(this)
}

iOS Dependencies & Init

  1. Podfile: In your ios/Podfile, include the Firebase messaging pods with modular headers enabled:
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase/Messaging'
  1. XcodeTarget: Ensure GoogleService-Info.plist is included in the Xcode target. 3.** Configure Firebase:** In your AppDelegate.swif, configure Firebase before Bubbl startup:
if FirebaseApp.app() == nil {
  FirebaseApp.configure()
}

2. Notification Service Handling (Android)

The Bubbl Android SDK includes a pre-built Firebase Messaging service. You must register this in your AndroidManifest.xml to allow Bubbl to intercept campaign messages.

3. Token Forwarding and Delegate Setup (iOS)

On iOS, you must manually forward both the APNs device token and the FCM registration token to Bubbl in your AppDelegate.swift.

Verification Checklist

  • iOS receives APNs token and FCM token.
  • Android receives FCM token.
  • Bubbl notification payloads are emitted to bubbl_notification in React Native.
  • Test push arrives in both foreground and background launch flows.

For full platform-specific bridge examples, see the following guides: