ابرووا
شروع رایگان
☰ فهرست مستندات · پل FCM اندروید
به‌زودی. Abrova Push به‌زودی فعال می‌شود. این صفحه توضیح می‌دهد چطور کار خواهد کرد؛ هنوز قابل استفاده نیست.
این صفحه هنوز ترجمه نشده — نسخه‌ی انگلیسی نمایش داده می‌شود. English

Android FCM Bridge

Optional Firebase path for Android — wakes devices that closed the Abrova connection to save battery, while devices where Google services are blocked or missing keep using Abrova. Setup for Android, Flutter and React Native.

abrova-push-fcm 0.1.0Android 5.0+Needs Google Play servicesبه‌روزرسانی: ۵ آبان ۱۴۰۵

Abrova Push delivers to Android over its own persistent connection (TLS, port 443), so the default delivery path needs no Google Play services, no Google account and no Firebase project. Android, though, closes background connections to save battery: Doze, standby buckets and the battery managers on Xiaomi, Huawei, Samsung and others all do it, and a phone on low battery does it sooner.

The FCM bridge adds a second delivery path through Firebase, which rides the connection Google Play services already keeps alive. It is optional and off until you upload a Firebase key, and it only works on devices that have Google Play services.

Nothing is replaced.

Both paths carry every push and the SDK shows whichever arrives first, so a device never sees two notifications. Where Google services are blocked or missing — Iran, China, many Huawei phones — the Firebase copy simply never arrives and Abrova delivers as before.

Upload your Firebase key#

  1. In the Firebase console, open (or create) the project your app is built with.
  2. Project settings → Service accounts → Generate new private key. A JSON file downloads.
  3. In Abrova Console: Push → Settings → Android: Firebase Cloud Messaging, then upload or paste that file.

Abrova checks the key with Google before saving it and tells you if the Cloud Messaging API is disabled or the account lacks permission. The key is stored encrypted and never shown again. You can turn the bridge off without deleting it.

Use a key that can only send messages.

An Admin SDK key can also read your database and manage users. Create a service account with just the Firebase Cloud Messaging API Sender role and upload that one.

Add the add-on to your app#

The core SDK stays free of Firebase; the bridge ships as a separate package from Abrova Center. Your app needs google-services.json and the Google services Gradle plugin, which Firebase's own setup adds.

Android

  1. Make sure the Abrova Center repository is listed (see Android SDK):
kotlin
maven { url = uri("https://center.abrova.ir/api/packages/abrova/maven") }
  1. Add the add-on next to the Push SDK:
gradle
dependencies {
    implementation("ir.abrova:abrova-push-fcm:0.1.0")
}

Flutter

Same line in android/app/build.gradle. No Dart changes.

React Native

Same line in android/app/build.gradle. No JavaScript changes.

No other code is needed: the add-on registers itself, sends the device's Firebase token with the normal device registration, and hands incoming messages to the SDK you already use. Notifications, taps, delivery confirmation and in-app suppression behave exactly as before.

Apps that already handle Firebase messages#

Android delivers Firebase messages to one service only. If your app has its own FirebaseMessagingService, pass Abrova's messages through it:

kotlin
override fun onMessageReceived(message: RemoteMessage) {
    if (AbrovaPushFcm.handleMessage(message)) return   // an Abrova push
    // your own handling
}

override fun onNewToken(token: String) {
    AbrovaPushFcm.onNewToken(token)
}

Then remove the add-on's own service in your manifest:

xml
<service android:name="ir.abrova.push.fcm.AbrovaFcmMessagingService"
         tools:node="remove" />

Check it is working#

Send a test push from Console, then open Delivery. Receipts show which path carried each notification:

OptionTypeRequiredDescription
Transport--Which path accepted the push: `fcm` or `pn` (the Abrova connection)
Delivered via--Which copy the device actually received first

On a healthy connection the Abrova path usually wins; the Firebase copy matters when Android has closed that connection, which is exactly the case the bridge exists for.

What to expect#

Optional everywhere

Apps without the add-on, and projects without a Firebase key, work exactly as before

No duplicate notifications

Both copies carry the same message id and the SDK shows the first one only

Blocked regions keep working

No Firebase token is issued, so those devices simply use the Abrova connection

Privacy

With the bridge on, push content passes through Google servers, as it does for any Firebase app

این صفحه مفید بود؟
گزارش مشکل