Native Notify Blog
Feb 17, 2022
Set up Flutter Push Notifications in under 5 minutes (Firebase NOT required) using Native Notify. This video walks you through how to set up Flutter Push Notifications using Native Notify and how to send your first push notification to yourself.
These instructions show how to add Native Notify push notifications to your Flutter app. After you follow these instructions, you will be able to send mass push notifications to all of your app users.
Paste this commands into your terminal and click return:
flutter pub add native_notify
In your "lib > main.dart" file, make sure these imports are included at the top of the screen:
import 'package:flutter/material.dart';
import 'package:native_notify/native_notify.dart';
In your "lib > main.dart" file, in the "void main()" function, paste this code BEFORE runApp():
void main() {
WidgetsFlutterBinding.ensureInitialized();
NativeNotify.initialize(your-app-id, 'your-app-token', null, null);
runApp(myApp());
}
Do NOT delete the 'null' parameters, or Native Notify push notifications will not initialize properly.
In the "android" object, change "compileSdkVersion flutter.compileSdkVersion" to:
compileSdkVersion 31
In the "android > defaultConfig" object, change "minSdkVersion flutter.minSdkVersion" to:
minSdkVersion 21
The "platform :ios" at the top of the sceen needs to be '10.0' or higher. Here is an example:
platform :ios, '10.0'
Open an Android emulator. Push notifications will NOT work in an iOS simulator.
flutter run
Send a push notification from your NativeNotify.com account.
TJ McCarty
Founder of Native Notify