Platforms
Product Lines
Platforms Safecrete Safewall Mine Operating System (Coming Soon)
On this page

Mobile Features

Push notifications enable real-time delivery of alarms, notifications, and updates to mobile devices, ensuring users stay informed about critical events even when the app is closed or running in the background.

Overview

The IndustryOS Mobile Application uses Firebase Cloud Messaging (FCM) to deliver push notifications to both Android and iOS devices. Push notifications can be triggered by:

  • Alarm Creation: Immediate notification when alarms are created
  • Alarm Status Changes: Updates when alarms are acknowledged, cleared, or escalated
  • System Notifications: Important system events and announcements
  • Custom Events: Notifications triggered by Pipelines or custom workflows

How Push Notifications Work

The push notification flow consists of the following steps:

1
2
IndustryOS Platform  →  Firebase Cloud Messaging  →  Mobile Device
     (Trigger)              (Delivery Service)          (Display)
  1. Event Occurrence: An event occurs in IndustryOS (e.g., alarm created)
  2. Notification Generation: IndustryOS generates notification payload
  3. FCM Delivery: Notification sent to Firebase Cloud Messaging
  4. Device Receipt: FCM delivers notification to mobile device
  5. Display: Device displays notification to user
  6. User Action: User taps notification to open relevant screen in app

Prerequisites

Before configuring push notifications, ensure you have:

  • Firebase Project: Created via Firebase Console
  • System Administrator Access: Required to configure Mobile Centre
  • Mobile App: IndustryOS mobile app version 1.5.0 or later
  • Platform-Specific Setup:
    • Android: google-services.json configuration file
    • iOS: APNs authentication key uploaded to Firebase

Firebase Configuration

Step 1: Create Firebase Project

  1. Visit Firebase Console
  2. Click Add project or select an existing project
  3. Enter your project name (e.g., “IndustryOS Mobile”)
  4. Optional: Enable Google Analytics for the project
  5. Click Create project and wait for setup to complete

Step 2: Register Android App (Optional)

If you’re building an Android app:

  1. In Firebase Console, click Add appAndroid
  2. Enter your Android package name (e.g., com.yourcompany.industryos)
  3. Optional: Enter app nickname and SHA-1 certificate fingerprint
  4. Click Register app
  5. Download google-services.json file
  6. Place google-services.json in your Flutter project’s android/app/ directory

Step 3: Register iOS App (Optional)

If you’re building an iOS app:

  1. In Firebase Console, click Add appiOS
  2. Enter your iOS Bundle ID (e.g., com.yourcompany.industryos)
  3. Optional: Enter app nickname and App Store ID
  4. Click Register app
  5. Download GoogleService-Info.plist file
  6. Add GoogleService-Info.plist to your Xcode project’s ios/Runner/ directory
  7. Enable Push Notifications capability in Xcode

Step 4: Configure APNs (iOS Only)

For iOS push notifications, you must upload your Apple Push Notification service (APNs) authentication key:

  1. Visit Apple Developer Account
  2. Navigate to Certificates, Identifiers & ProfilesKeys
  3. Click + to create a new key
  4. Enable Apple Push Notifications service (APNs)
  5. Download the .p8 key file and note the Key ID
  6. In Firebase Console, go to Project SettingsCloud MessagingApple app configuration
  7. Upload the .p8 file and enter your Key ID and Team ID

Step 5: Obtain FCM Server Key

  1. In Firebase Console, go to Project Settings (gear icon)
  2. Navigate to Cloud Messaging tab
  3. Locate Server Key under Project credentials
  4. Copy the server key (you’ll need this for Mobile Centre configuration)

Note: If you don’t see the server key, you may need to enable Cloud Messaging API (Legacy) in Google Cloud Console.

IndustryOS Platform Configuration

Configure Mobile Centre

  1. Log in to IndustryOS as a System Administrator
  2. Navigate to Mobile CentreApplications
  3. Select your mobile application or create a new one
  4. Click Edit (pencil icon)
  5. Scroll to Push Notifications section
  6. Configure the following settings:

    • Enable Push Notifications: Toggle to Enabled
    • Firebase Cloud Messaging Server Key: Paste your FCM server key
    • Firebase Sender ID: Enter your Firebase project number (found in Firebase Console → Project Settings)
  7. Click Save to apply changes

Verify Configuration

To verify that push notifications are properly configured:

  1. Build and install the mobile app on a test device
  2. Log in to the mobile app
  3. Ensure the app has notification permissions enabled
  4. Create a test alarm in IndustryOS that should trigger a notification
  5. Verify that the notification appears on the mobile device

Mobile App Configuration

Android Setup

Add Firebase Dependencies

Ensure the following dependencies are in your android/app/build.gradle:

1
2
3
4
dependencies {
    implementation platform('com.google.firebase:firebase-bom:32.0.0')
    implementation 'com.google.firebase:firebase-messaging'
}

And in android/build.gradle:

1
2
3
4
5
buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.3.15'
    }
}

Apply the Google Services plugin in android/app/build.gradle:

1
apply plugin: 'com.google.gms.google-services'

Configure AndroidManifest.xml

Ensure your android/app/src/main/AndroidManifest.xml includes:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<manifest>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.VIBRATE" />
    
    <application>
        <!-- Firebase Messaging Service -->
        <service
            android:name=".MyFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>
</manifest>

iOS Setup

Enable Push Notifications Capability

  1. Open ios/Runner.xcworkspace in Xcode
  2. Select the Runner project in the navigator
  3. Go to Signing & Capabilities tab
  4. Click + Capability and add Push Notifications
  5. Also add Background Modes capability
  6. Enable Remote notifications under Background Modes

Configure Info.plist

Ensure your ios/Runner/Info.plist includes Firebase configuration:

1
2
3
4
5
<key>UIBackgroundModes</key>
<array>
    <string>fetch</string>
    <string>remote-notification</string>
</array>

Update AppDelegate

Ensure Firebase is initialised in your ios/Runner/AppDelegate.swift:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        FirebaseApp.configure()
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}

Testing Push Notifications

Test via Firebase Console

You can send test notifications directly from Firebase Console:

  1. In Firebase Console, navigate to EngageMessaging
  2. Click Send your first message or New campaign
  3. Enter notification title and text
  4. Click Send test message
  5. Enter your device’s FCM registration token
  6. Click Test to send the notification

Test via IndustryOS

To test end-to-end push notification flow:

  1. Ensure the mobile app is installed and logged in
  2. Create a test device in IndustryOS
  3. Configure an alarm rule for the device
  4. Trigger the alarm condition (e.g., send telemetry exceeding threshold)
  5. Verify the notification appears on the mobile device
  6. Tap the notification and verify it opens the relevant alarm details

Verify Device Registration

To check if a device is properly registered for push notifications:

  1. Open the mobile app
  2. Log in with your credentials
  3. The app automatically registers with FCM and sends the token to IndustryOS
  4. In IndustryOS, navigate to Mobile CentreDevices
  5. Verify your device appears in the list with a valid FCM token

Notification Types

Alarm Notifications

Alarm notifications are triggered when alarms are created or their status changes:

  • Title: Alarm type and severity
  • Body: Alarm message and originator name
  • Action: Tap to open alarm details dashboard
  • Icon: Severity-specific icon (critical, major, minor, warning)

Example:

1
2
3
Title: High Temperature (CRITICAL)
Body: Temperature exceeded threshold on Device A
Action: Open alarm details

System Notifications

System notifications inform users about important platform events:

  • User Account Changes: Password resets, account locked, etc.
  • System Maintenance: Scheduled maintenance windows
  • Security Alerts: Suspicious login attempts, unauthorised access

Custom Notifications

You can send custom notifications using Pipelines:

  1. Create a Pipeline with a trigger condition
  2. Add Mobile Notification node
  3. Configure notification title, body, and target users
  4. Save and activate the Pipeline

Notification Behaviour

Foreground Notifications

When the app is open and in the foreground:

  • Notifications appear as in-app banners
  • Alarms list automatically refreshes
  • No sound or vibration (user is already using the app)

Background Notifications

When the app is running in the background:

  • Notifications appear in the system notification tray
  • Default notification sound plays
  • Device vibrates (if enabled)
  • Badge count updates on app icon (iOS)

Notification Actions

Users can interact with notifications:

  • Tap: Opens the app to the relevant screen (alarm details, dashboard, etc.)
  • Dismiss: Removes the notification without opening the app
  • Quick Actions (Future): Acknowledge alarm, clear alarm, etc., directly from notification

Troubleshooting

Notifications Not Received

Check FCM Server Key:

  • Verify the server key in Mobile Centre matches Firebase Console
  • Ensure Cloud Messaging API is enabled in Google Cloud Console

Check Device Registration:

  • Verify the device appears in Mobile Centre → Devices
  • Check that the FCM token is not empty or expired

Check Network Connectivity:

  • Ensure the device has internet connectivity
  • Check firewall rules allow FCM traffic (ports 5228, 5229, 5230)

Check App Permissions:

  • Verify the app has notification permissions enabled in device settings
  • On Android, check battery optimisation settings

Notifications Delayed

Android Battery Optimisation:

  • Disable battery optimisation for the app in device settings
  • Some manufacturers (Xiaomi, Huawei) have aggressive battery management

iOS Background App Refresh:

  • Enable Background App Refresh in iOS Settings → General
  • Ensure Low Power Mode is disabled

FCM Delivery:

  • FCM does not guarantee instant delivery
  • Delivery time can vary based on device state and network conditions

Notifications Not Opening Correct Screen

Check Notification Payload:

  • Verify the notification payload includes correct routing data
  • Check app logs for navigation errors

Update App:

  • Ensure you’re using the latest version of the mobile app
  • Older versions may not support all notification types

iOS Notifications Not Working

Check APNs Configuration:

  • Verify APNs authentication key is uploaded to Firebase Console
  • Ensure Key ID and Team ID are correct

Check Capabilities:

  • Verify Push Notifications capability is enabled in Xcode
  • Ensure Background Modes → Remote notifications is enabled

Check Provisioning Profile:

  • Ensure the provisioning profile includes Push Notifications entitlement
  • Regenerate provisioning profile if necessary

Best Practices

Notification Frequency

  • Rate Limiting: Avoid sending too many notifications in a short period
  • Grouping: Group related notifications to reduce noise
  • Priority: Send notifications only for important events

Notification Content

  • Clear Titles: Use concise, descriptive titles
  • Actionable Body: Provide context and actionable information
  • Relevant Icons: Use severity-appropriate icons for alarms

User Preferences

  • Notification Settings: Allow users to customise notification preferences
  • Do Not Disturb: Respect user’s do not disturb settings
  • Notification Channels: Use Android notification channels for granular control

Security

  • Sensitive Data: Avoid including sensitive data in notification body
  • Encrypted Payload: Ensure notification payload is transmitted securely
  • Token Management: Regularly refresh FCM tokens and remove expired tokens

Advanced Configuration

Custom Notification Sounds

To use custom notification sounds:

Android:

  1. Place sound file in android/app/src/main/res/raw/
  2. Specify sound in notification payload

iOS:

  1. Place sound file in ios/Runner/Resources/
  2. Add to Xcode project with “Copy Bundle Resources”
  3. Specify sound in notification payload

Notification Channels (Android 8.0+)

Create custom notification channels for better user control:

1
2
3
4
5
6
7
final AndroidNotificationChannel channel = AndroidNotificationChannel(
  'alarms_critical', // ID
  'Critical Alarms', // Name
  description: 'Notifications for critical alarms',
  importance: Importance.max,
  sound: RawResourceAndroidNotificationSound('alarm_critical'),
);

Silent Notifications

Silent notifications can be used to sync data without disturbing the user:

  • No sound or vibration
  • No notification banner
  • Triggers background data sync
  • Useful for keeping app data up-to-date