Skip to main content
Android push setup has two separate responsibilities:
  1. Configure the Android app and provider, such as Firebase Cloud Messaging.
  2. Connect the provider token and signed-in device to social.plus through the SDK.
Push delivery also requires server-side credentials in the social.plus Console. The client SDK can register a device only after the platform push provider and console configuration are complete.

SDK Surface

Parameters

1. Configure FCM

Follow the Android and Firebase setup flow for your app:
  • Add google-services.json to your app module.
  • Apply the Google Services Gradle plugin.
  • Add Firebase Messaging using the version recommended for your Firebase setup.
  • Request POST_NOTIFICATIONS at runtime on Android 13+ when your product needs visible notifications.
If your Android dependency setup installs SDK modules separately, include the FCM push adapter with the same version as your social.plus Android SDK:
Gradle
Use the same x.y.z version you use for co.amity.android:amity-sdk. If your package already bundles the FCM adapter, do not add a duplicate dependency.

2. Upload Provider Credentials

In the social.plus Console, open Settings > Push Notifications and upload the Firebase service account JSON for your app. Without this server-side credential, client registration can succeed while push delivery still fails.

3. Connect the FCM Token

Pass every current FCM token to the SDK push adapter. Do this for the initial token and every token refresh.
The Android sample app calls the same adapter from FirebaseMessagingService.onNewToken(token).

4. Register the Signed-In Device

After the SDK has a signed-in user session and the app has connected the FCM token, register the current device/user with social.plus.
Call unregister when the user signs out or disables push for this installation.
registerPushNotification() has no token parameter in the current Android SDK. The token is handled by the push adapter through AmityFcm.create().setup(fcmToken).

Optional Baidu Adapter

The Android source also contains an optional Baidu push adapter, AmityBaidu.create(context).setup(baiduApiKey), for builds that include the Baidu push module. The default Android SDK build path uses the FCM adapter, so treat Baidu setup as a China-market build decision and verify the module distribution before enabling it.

Setup Checklist

  • FCM is configured in the Android app.
  • The Firebase service account JSON is uploaded in the social.plus Console.
  • The latest FCM token is passed to AmityFcm.create().setup(fcmToken).
  • The signed-in device/user is registered with AmityCoreClient.registerPushNotification().
  • The device is unregistered on sign-out when the app should stop receiving push notifications for that user.