Notify Aim – Setup Guide for Push Notification

Notify Aim – Setup Guide

Overview

Notify Aim helps you send Web, Android, Desktop Push Notifications, automate WhatsApp, and Chatbots, and manage real-time broadcasting for your audience.

1. Create Your Notify Aim Account

  1. Go to notifyaim.com.
  2. Click Sign Up and fill in the required details.
  3. Verify your email to activate your account.

2. Add Your Website/App to Notify Aim

  1. Login to the Notify Aim Dashboard.
  2. Go to Websites / AppsAdd New.
  3. Enter:
    • Site/App Name
    • Domain URL (e.g., https://example.com)
    • Icon/Logo (optional but recommended)
  4. Save changes

3. Install Web Push SDK

1- Add the following script before your website’s closing </body> tag:


    <script src="https://api.notifyaim.com/sdk/v1/notification/web-push-client.js">  </script>
    <script>
        window.onload = function() {
            NotifyAim.init({
                vapidKey: "YOUR_VAPID_KEY", // Found in Dashboard → Website Settings  
            });
        }
    </script>
                    

2- On your domain root /notifyaim-sw.js: example: https://example.com/notifyaim-sw.js


self.addEventListener("push", function (event) {
    const data = event.data.json();

    // Support Notify Aim structure (notification + data)
    const notif = data.notification || {};
    const extra = data.data || {};

    event.waitUntil(
        self.registration.showNotification(notif.title || "Notification", {
            body: notif.body || "",
            icon: notif.icon || "/logo.png",
            image: notif.image || null,
            tag: notif.tag || "default",
            renotify: notif.renotify || false,
            actions: notif.actions || [], // buttons if any
            sound: notif.sound || undefined, // Android only

            // Pass extra data for click handling
            data: {
                url: extra.url || "/",
                click_behavior: extra.click_behavior || "open_url",
                webhook: extra.webhook || null,
                url_buy: extra.url_buy || null,
                url_cart: extra.url_cart || null,
                priority: extra.priority || "normal",
                channelId: extra.channelId || "general",
            },
        })
    );
});

// Click event listener
self.addEventListener("notificationclick", function (event) {
    event.notification.close();
    const data = event.notification.data || {};

    switch (event.action) {
        case "buy_now":
            if (data.url_buy) clients.openWindow(data.url_buy);
            break;

        case "add_cart":
            if (data.url_cart) clients.openWindow(data.url_cart);
            break;

        case "signup":
            if (data.url_signup) clients.openWindow(data.url_signup);
            break;

        case "read_blog":
            if (data.url_blog) clients.openWindow(data.url_blog);
            break;

        default:
            // Default click (notification body)
            if (data.click_behavior === "open_url" && data.url) {
                clients.openWindow(data.url);
            } else if (data.click_behavior === "open_webhook" && data.webhook) {
                fetch(data.webhook, { method: "POST" });
            }
            break;
    }
});
                                

📌 Tip for Beginners: You don’t need coding skills if you’re using WordPress — use our Notify Aim WordPress Plugin instead.

4. Configure Permissions Prompt

Choose how you want visitors to subscribe:

  • Immediate Prompt – Ask for permission as soon as they visit.
  • Custom Trigger – Show the prompt when they click a button or after scrolling.

Example (Custom Trigger):

                        
    document.getElementById('notifyButton').addEventListener('click', () => {
        NotifyAim.subscribe();
    });
                    

5. Test Your Notifications

  1. Go to the DashboardNotifications → Create New.
  2. Enter Title, Message, and URL.
  3. Click Send Test Notification.
  4. Check your browser/device for the test alert.

You're Ready! 🚀

You can now:

  • Send targeted notifications by topic, device, or location.
  • Automate campaigns with triggers and schedules.
  • Track performance in real-time analytics.

Next Steps:

➡ Go to the API Documentation if you want to integrate Notify Aim into custom apps.

➡ Check the Integration Guide for platform-specific setup.