RU | EN
push_android_aurora_center
Original ReadMe of the push plugin: README
Description
This plugin is an implementation of the push package for the Android operating system with Aurora Center services and is designed to handle push notifications.
Documentation for the Aurora Center.
Quick Start
WidgetsFlutterBinding.ensureInitialized();
/// Replaces the standard push plugin implementation that uses Firebase
/// With the one that uses Aurora Center
PushAndroidAuroraCenter.initialize();
Table of Contents
Build and Installation
1. pubspec.yaml
dependencies:
push: ^3.0.0
push_android_aurora_center:
git: https://developer.auroraos.ru/git/flutter/flutter-community-plugins/push_android_aurora_center
2. Configure applicationId
In android\app\src\main\AndroidManifest.xml you need to add applicationId from Aurora Center
If you don't specify applicationId, the application won't be able to receive push notifications from Aurora Center
<meta-data
android:name="omp.push.APP_ID"
android:value="YOUR_applicationId"
/>
3. Configure Maven repository for Aurora Center SDK:
In android/build.gradle file add Aurora Center repository:
allprojects {
repositories {
google()
mavenCentral()
// Add Aurora Center Maven repository
maven {
url "https://maven.omp.ru/repository/maven/"
}
}
}
Detailed Description
The push package originally contains an implementation for Android that uses Firebase Cloud Messaging (FCM). This plugin completely replaces the standard implementation with an alternative one that works with Aurora Center.
Implementation Features
Replacement Principle:
- When calling
PushAndroidAuroraCenter.initialize(), a new platform interface implementation is registered - All API calls to the
pushpackage are automatically redirected to the Aurora Center implementation
Handler Types and @pragma Usage:
The plugin supports two types of background handlers with different execution capabilities:
// 1. Top-level function with @pragma - executes in terminated and background states
@pragma("vm:entry-point")
void backgroundHandler(RemoteMessage message) async {
print('Received in terminated/background: ${message.title}');
}
// 2. Regular function - executes only in background state
void background(RemoteMessage message) async {
print('Received in background only: ${message.title}');
}
// Handler registration
void setupPushHandlers() {
Push.instance.addOnBackgroundMessage(backgroundHandler);
Push.instance.addOnBackgroundMessage(background);
}
Aurora Center Limitations
- Image display in notifications doesn't work
- Notification sound playback doesn't work
Compatibility
- Android: 6.0+
Terms of Use
- The project source code is provided under MIT license, which allows its use in third-party applications.
- To participate in project development, please read the contributor agreement.
- If you plan to submit your source code for inclusion in the project, you will need to accept the CLA terms.
- Contributor information is specified in the AUTHORS file.
- Code of Conduct is an active set of rules from Open Mobile Platform company that informs about expectations for interaction between community members when communicating and working on projects.