How to Add Push Notifications to Your App for Free

When building a mobile app, keeping users engaged after they install it is a huge challenge. One of the most effective ways to bring users back is through push notifications.

Push notifications allow you to send real-time messages to users—even when they’re not actively using your app. Whether it’s a reminder, a special offer, or a simple “We miss you!” message, push notifications keep your app alive in your users’ minds.

The good news? You don’t need expensive services or complex setups. You can integrate push notifications for free using tools like Firebase Cloud Messaging (FCM), OneSignal, or Expo Notifications (for React Native).

In this guide, I’ll show you:

  • Why push notifications matter

  • Free tools to implement them

  • Step-by-step setup with Firebase and OneSignal

  • Code examples (Android, iOS, Flutter, React Native)

  • Best practices for sending notifications that actually work

By the end, you’ll have everything you need to add push notifications to your app without spending a dime.




Why Push Notifications Are Important

Before we dive into the technical part, let’s understand why push notifications are worth your time.

  • Increase engagement – Notifications remind users about your app.

  • Boost retention – Users are more likely to return after reminders.

  • Drive conversions – Great for promotions, offers, or updates.

  • Real-time communication – Perfect for chat apps, news apps, or task reminders.

But push notifications are a double-edged sword. Done wrong, they feel spammy and drive users away. Done right, they add real value.


Free Tools for Push Notifications

There are several platforms you can use for free push notifications:

  1. Firebase Cloud Messaging (FCM) – Free, reliable, works on Android, iOS, and web.

  2. OneSignal – Offers a generous free tier, easy to set up, supports analytics.

  3. Expo Notifications – Great for React Native apps.

  4. Pusher Beams (Free Tier) – Focused on real-time event notifications.

For most developers, Firebase Cloud Messaging (FCM) or OneSignal are the easiest and most popular options.


Method 1: Adding Push Notifications with Firebase Cloud Messaging (FCM)

Step 1: Create a Firebase Project

  1. Go to Firebase Console.

  2. Click Add Project.

  3. Enter your project name and configure Google Analytics (optional).

  4. Once created, you’ll get access to Firebase tools.

Step 2: Add Firebase to Your App

For Android:

  • Add the Firebase SDK in build.gradle.

  • Download the google-services.json file and place it inside your project’s app/ folder.

For iOS:

Step 3: Enable Cloud Messaging

In the Firebase Console → Cloud Messaging, enable the API.

Step 4: Write the Notification Code

For Android:

import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; public class MyFirebaseMessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); // Show notification String title = remoteMessage.getNotification().getTitle(); String message = remoteMessage.getNotification().getBody(); // Display logic here } }

For Flutter:

import 'package:firebase_messaging/firebase_messaging.dart'; FirebaseMessaging messaging = FirebaseMessaging.instance; void main() async { String? token = await messaging.getToken(); print("Device Token: $token"); FirebaseMessaging.onMessage.listen((RemoteMessage message) { print("Notification: ${message.notification?.title}"); }); }

Now you can send test notifications from the Firebase Console.


Method 2: Adding Push Notifications with OneSignal

If you want an easier setup with a dashboard and analytics, OneSignal is great.

Step 1: Sign Up

Go to OneSignal and create a free account.

Step 2: Add Your App

  • Choose Android, iOS, or Web.

  • Follow setup instructions.

Step 3: Install SDK

For Flutter:

dependencies: onesignal_flutter: ^3.0.0

Then initialize:

import 'package:onesignal_flutter/onesignal_flutter.dart'; void main() { OneSignal.shared.setAppId("YOUR-ONESIGNAL-APP-ID"); OneSignal.shared.setNotificationOpenedHandler((openedResult) { print("Notification opened: ${openedResult.notification}"); }); }

Step 4: Send Notifications

From your OneSignal dashboard, you can send notifications to specific users or all devices.


Method 3: Expo Notifications (For React Native Apps)

If you’re building with React Native + Expo:

  1. Install Expo Notifications:

expo install expo-notifications
  1. Configure in App.js:

import * as Notifications from 'expo-notifications'; async function registerForPushNotificationsAsync() { const { status } = await Notifications.getPermissionsAsync(); if (status !== 'granted') { const { status } = await Notifications.requestPermissionsAsync(); } const token = (await Notifications.getExpoPushTokenAsync()).data; console.log(token); } registerForPushNotificationsAsync();
  1. Use Expo’s push notification tool to send messages.


Best Practices for Push Notifications

  • Don’t spam users – Send meaningful, relevant updates.

  • Personalize messages – Use names, preferences, or user behavior.

  • Time it right – Don’t send at 3 AM unless it’s critical.

  • Allow opt-out – Always give users control over notifications.

  • Keep it short – Clear, concise messages perform best.


FAQs

Q1: Are push notifications really free?
Yes. Firebase Cloud Messaging and OneSignal both offer free plans.

Q2: Do push notifications work offline?
Yes. The message is delivered when the user comes online.

Q3: Can I send notifications to specific users?
Yes. Both FCM and OneSignal allow targeting by user ID, device, or topic.

Q4: Do I need coding skills?
Basic coding knowledge is needed, but OneSignal makes it very beginner-friendly.


Conclusion

Adding push notifications doesn’t have to be complicated or expensive. With free tools like Firebase Cloud Messaging and OneSignal, you can integrate powerful notification systems into your apps quickly.

If you’re building a Flutter, Android, iOS, or React Native app, push notifications will help you:

  • Improve retention

  • Keep users engaged

  • Increase app revenue and growth

So pick a method (Firebase for flexibility, OneSignal for simplicity), and start adding push notifications to your app today—without spending a penny.

Post a Comment

0 Comments