Flutter Push Notifications for iOS & Android

Dart, Flutter 3.22+. Built on firebase_messaging and flutter_callkit_incoming.

💙 Flutter

Dart, Flutter 3.22+. Built on firebase_messaging and flutter_callkit_incoming.

The SDK is free and open source (MIT) on GitHub. Create a free account to get your App ID.

  1. Add the package

    Set up Firebase with flutterfire configure, then run flutter pub add firebase_core tingpush (the tingpush package on pub.dev), or declare:

    pubspec.yaml
    # pubspec.yaml
    dependencies:
      firebase_core: ^4.0.0
      tingpush: ^1.1.1

    Android: upload the service account JSON of the same Firebase project to TingPush. iOS: the server sends straight to APNs, so you need a .p8 key.

  2. Initialize in main.dart

    lib/main.dart
    import 'package:firebase_core/firebase_core.dart';
    import 'package:flutter/material.dart';
    import 'package:tingpush/tingpush.dart';
    import 'firebase_options.dart';
    
    Future<void> main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
    
      await TingPush.initialize(
        appId: 'YOUR_APP_ID',
        callStyle: const TingPushCallStyle(appName: 'MyApp'), // omit if you don't use calls
      );
    
      runApp(const MyApp());
    }

    The SDK registers the background handler (to ring while the app is closed) and shows notifications while the app is open. APNs environment: debug/profile = sandbox, release = production (override with iosSandbox).

  3. Handle notification & call events

    Listen anywhere (e.g. your root screen's initState): events that happen before you listen — like a notification tap that launched the app — are kept and delivered as soon as you do.

    Dart
    // User tapped a notification (even when the app was closed)
    TingPush.onNotificationOpened.listen((n) {
      // navigate using n.data['screen']...
    });
    
    // Notification received while the app is open
    TingPush.onNotificationReceived.listen((n) { /* n.title, n.body, n.data */ });
    
    // Call events
    TingPush.onCallEvent.listen((e) {
      if (e.action == TingPushCallAction.accepted) {
        // User tapped Answer → connect the call (e.call.id, e.call.data['room'])
      }
    });
  4. Assign the user at login

    Dart
    await TingPush.login('user-123');       // after login
    await TingPush.logout();                // on logout
    await TingPush.setTags({'plan': 'vip'});
    await TingPush.endCall(callId);         // end the call
  5. iOS: enable capabilities

    Open ios/Runner.xcworkspace → Signing & Capabilities: add Push Notifications and Background Modes → Remote notifications (plus Voice over IP if you use calls). No AppDelegate changes needed.

    Requires iOS 15+. Calls on a locked Android phone: add android:showWhenLocked="true" and android:turnScreenOn="true" to <activity android:name=".MainActivity">; on Android 14+ check TingPush.canUseFullScreenIntent().

✅ After integrating, check

  1. Run the app on a real device with logging on: you should see [TingPush] Device registered ….
  2. The project's Devices tab: the device appears; iOS devices show the VoIP badge if you use calls.
  3. The Send tab: send a test to that device.
  4. Choose 📞 Call and test with the app open, closed and with the screen locked.

Ready to integrate?

Create an account to get your App ID and API Key. Dashboard samples are pre-filled with your project details.