You will have to create a free Native Notify account to get your App ID and App Token in order for the native_notify package to work. Click the "Sign Up Free" button in the top right corner of this page to create a free account.
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.
These instructions show how to get Native Notify push notifications working in Android production mode. After you follow these instructions, you will be able to send push notifications to all of your Android app users.
These instructions show how to get Native Notify push notifications working in iOS production mode. After you follow these instructions, you will be able to send push notifications to all of your iOS app users.
Make sure you follow the 'Start Here' instructions BEFORE you set up iOS production push notifications. iOS production push notifications will not work without first following the 'Start Here' instructions.
These instructions show how to send customized push notifications to individual users. We call these notifications "Indie" push notifications.
Make sure you follow the 'Start Here' instructions BEFORE you set up Indie Push Notifications. Indie Push Notifications will not work without first following the 'Start Here' instructions.
This guide will show you how to update your Android push notification icon. (Your iOS push notification icon should be your default app icon.)