Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/infobip/mobile-messaging-flutter-plugin
Mobile Messaging SDK plugin for Flutter projects
https://github.com/infobip/mobile-messaging-flutter-plugin
android flutter flutter-plugin ios push push-notifications
Last synced: 4 days ago
JSON representation
Mobile Messaging SDK plugin for Flutter projects
- Host: GitHub
- URL: https://github.com/infobip/mobile-messaging-flutter-plugin
- Owner: infobip
- License: other
- Created: 2021-07-01T10:27:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:39:43.000Z (16 days ago)
- Last Synced: 2024-10-29T17:32:38.835Z (16 days ago)
- Topics: android, flutter, flutter-plugin, ios, push, push-notifications
- Language: Java
- Homepage:
- Size: 726 KB
- Stars: 9
- Watchers: 15
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Mobile Messaging SDK plugin for Flutter
Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of [Infobip IP Messaging Platform](https://www.infobip.com/en/products/mobile-app-messaging).
The document describes plugin integration steps for your Flutter project.* [Requirements](#requirements)
* [Quick start guide](#quick-start-guide)## Requirements
- Flutter 3.3.0+For iOS project:
- Xcode 13.4.1
- Minimum deployment target 12.0For Android project:
- Android Studio
- Supported API Levels: 21 (Android 5.0 - Lollipop) - 34 (Android 14)## Quick start guide
This guide is designed to get you up and running with Mobile Messaging SDK plugin for Flutter
1. Make sure to [setup application at the Infobip portal](https://www.infobip.com/docs/mobile-app-messaging/getting-started#create-and-enable-a-mobile-application-profile), if you haven't already.
2. Add MobileMessaging plugin to dependencies at `pubspec.yaml`:
```yaml
dependencies:
infobip_mobilemessaging: '^6.1.0'```
3. Run `flutter pub get` to install plugin
4. Configure platforms
- **iOS**
1. Update the `ios/Podfile` with iOS deployment target platform 12.0 - `platform :ios, '12.0'` if needed, and perform in Terminal `cd ios && pod update `
2. Import MobileMessaging `@import MobileMessaging;` and add `[MobileMessagingPluginApplicationDelegate install];` into `/ios/Runner/AppDelegate.m` (this is required for OS callbacks such as `didRegisterForRemoteNotifications` to be intercepted by native MobileMessaging SDK) :
```objc
...
@import MobileMessaging;@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[MobileMessagingPluginApplicationDelegate install];
...
}
...
```expand to see Swift code
```swift
import MobileMessaging
...
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
...
MobileMessagingPluginApplicationDelegate.install()
...
}
}
...
```
3. Configure your project to support Push Notification as described in item 2 of [iOS integration quick start guide](https://github.com/infobip/mobile-messaging-sdk-ios#quick-start-guide)
4. [Integrate Notification Service Extension](https://github.com/infobip/mobile-messaging-flutter-plugin/wiki/Delivery-improvements-and-rich-content-notifications) into your app in order to obtain:
- more accurate processing of messages and delivery stats
- support of rich notifications on the lock screen
- **Android**
1. Add 'com.google.gms:google-services' to `android/build.gradle` file
```groovy
buildscript {
...
dependencies {
...
//Google Services gradle plugin
classpath 'com.google.gms:google-services:4.3.10'
}
}
```
2. Add `apply plugin: 'com.google.gms.google-services'` at the end of your `android/app/build.gradle` in order to apply [Google Services Gradle Plugin](https://developers.google.com/android/guides/google-services-plugin)
3. Setup Firebase for your project and add a Firebase configuration file (google-services.json) to the app as described in `Firebase documentation`. Usually it needs to be added into `android/app` folder.
> ### Notice
> If you want to provide the Firebase configuration differently, check [Applying Firebase configuration](https://github.com/infobip/mobile-messaging-flutter-plugin/wiki/Applying-Firebase-configuration-in-MobileMessaging-Flutter-plugin)> ### Notice
> Starting from Android 13, Google requires to ask user for notification permission. Follow this guide to make a permission request.4. Use plugin in your Dart code:
```dart
import 'package:infobip_mobilemessaging/infobip_mobilemessaging.dart';
import 'package:infobip_mobilemessaging/models/configuration.dart';
import 'package:infobip_mobilemessaging/models/library_event.dart';...
await InfobipMobilemessagingFlutterPlugin.init(Configuration(
applicationCode: "",
iosSettings: IOSSettings(
notificationTypes: ["alert", "badge", "sound"],
logging: true
)
));InfobipMobilemessaging.on(LibraryEvent.MESSAGE_RECEIVED, (Message event) => {
print("Callback. MESSAGE_RECEIVED event, message text: ${event.body}")
});...
```
#### More details on SDK features and FAQ you can find on [Wiki](https://github.com/infobip/mobile-messaging-flutter-plugin/wiki)
NEXT STEPS: Users and installations