Skip to main content

Step 10: Testing Push Notifications

This guide helps you test and verify that push notifications are working correctly in your whitelabel mobile app for both iOS and Android platforms.

Prerequisites

Before testing, ensure:

  • ✅ OneSignal configured for both iOS and Android
  • ✅ App built and installed on test devices
  • ✅ App has been opened at least once (to register for notifications)
  • ✅ Notification permissions granted by user

Understanding Push Notifications

How Push Notifications Work

  1. User opens app → Device registers with OneSignal
  2. OneSignal assigns Player ID → Unique identifier for the device
  3. Server sends notification → Via OneSignal API or dashboard
  4. OneSignal delivers → To Apple (APNs) or Google (FCM)
  5. Device receives → Notification appears on device

Notification Types

iOS:

  • Banner notifications (top of screen)
  • Lock screen notifications
  • Notification Center
  • Badge counts on app icon

Android:

  • Status bar notifications
  • Lock screen notifications
  • Notification drawer
  • Badge counts (on supported launchers)

Step 1: Verify Device Registration

Check OneSignal Dashboard

  1. Log in to OneSignal Dashboard
  2. Select your app
  3. Go to AudienceAll Users
  4. You should see registered devices listed

Device Information

Each registered device shows:

  • Player ID: Unique identifier
  • Device Type: iOS or Android
  • App Version: Version number
  • Last Active: Last time app was opened
  • Subscribed: Whether notifications are enabled
  • Tags: Any custom tags assigned
No Devices Showing?

If no devices appear:

  • Ensure app has been opened at least once
  • Check notification permissions are granted
  • Verify OneSignal App ID is correct in app
  • Check device has internet connection

Step 2: Send Test Notification

Using OneSignal Dashboard

  1. Go to MessagesNew Push
  2. Click "New Push"

Compose Message

Title: (Optional, recommended)

Test Notification

Message:

This is a test push notification from WhautoChat!

Image: (Optional)

  • Add image URL for rich notifications
  • Recommended size: 1440 x 720 px

Launch URL: (Optional)

  • Deep link to specific screen in app
  • Example: whauto://chat/conversation/123

Select Audience

Choose who receives the notification:

Option 1: Test Users

  1. Click "Send to Test Users"
  2. Enter Player IDs of test devices
  3. Find Player IDs in AudienceAll Users

Option 2: Specific Segment

  1. Select "Send to Particular Segment(s)"
  2. Choose segment (e.g., "Subscribed Users")
  3. Add filters if needed

Option 3: All Users

  1. Select "Send to Subscribed Users"
  2. Use cautiously - sends to everyone!

Platform Selection

Choose platforms:

  • ✅ iOS
  • ✅ Android
  • Or select specific platform for testing

Schedule

Choose when to send:

  • Immediately: Send right away
  • Schedule for later: Set specific date/time
  • Intelligent Delivery: Optimize send time per user

Send Notification

  1. Review your notification
  2. Click "Confirm"
  3. Click "Send Message"

Verify Delivery

Check the notification appears on your test device:

iOS:

  • Banner at top of screen (if app is open)
  • Lock screen notification (if device is locked)
  • Notification Center (swipe down)
  • Badge count on app icon (if configured)

Android:

  • Status bar icon
  • Lock screen notification
  • Notification drawer (swipe down)
  • Badge count (on supported launchers)

Step 3: Test Different Notification Types

Basic Text Notification

Title: New Message
Message: You have a new message from John

Notification with Image

Title: Special Offer
Message: 50% off all plans this week!
Image: https://yourdomain.com/images/promo.jpg

Notification with Action Buttons (iOS)

Title: New Message
Message: Reply to John's message
Buttons:
- Reply
- View
- Dismiss
Title: New Conversation
Message: Customer inquiry received
Launch URL: whauto://chat/conversation/456

Step 4: Test Notification Scenarios

Test Cases

1. App Closed

  • Close app completely
  • Send notification
  • Expected: Notification appears
  • Tap notification → App opens

2. App in Background

  • Open app, then go to home screen
  • Send notification
  • Expected: Notification appears
  • Tap notification → App opens to foreground

3. App in Foreground

  • Keep app open and active
  • Send notification
  • Expected:
    • iOS: Banner or in-app alert
    • Android: Status bar notification

4. Notification Permissions Denied

  • Disable notifications in device settings
  • Send notification
  • Expected: No notification appears
  • Device shows as "Unsubscribed" in OneSignal

5. Multiple Notifications

  • Send 3-5 notifications quickly
  • Expected: All notifications appear
  • Notifications stack properly

6. Rich Media

  • Send notification with image
  • Expected: Image displays in notification
  • Image loads correctly

7. Deep Linking

  • Send notification with launch URL
  • Tap notification
  • Expected: App opens to specific screen

Step 5: Test Platform-Specific Features

iOS-Specific Tests

Silent Notifications

  • Send notification with content_available: true
  • App receives data in background
  • No visible notification to user

Critical Alerts (if enabled)

  • Send critical alert
  • Bypasses Do Not Disturb
  • Plays sound even if device is silenced

Notification Grouping

  • Send multiple notifications
  • Check they group by app
  • Expand to see all notifications

Badge Count

  • Send notification with badge count
  • Check app icon shows correct number
  • Clear notifications → Badge clears

Android-Specific Tests

Notification Channels

  • Check notification settings in app
  • Verify channels are created
  • Test channel-specific settings

Notification Priority

  • Send high priority notification
  • Check it appears as heads-up notification
  • Send low priority → Check it's silent

Large Icon and Big Picture

  • Send notification with large image
  • Expand notification
  • Check image displays correctly

Action Buttons

  • Send notification with action buttons
  • Tap each button
  • Verify correct action triggers

Step 6: Test OneSignal API

Send Notification via API

Use OneSignal REST API for automated testing:

curl --location 'https://onesignal.com/api/v1/notifications' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YOUR_REST_API_KEY' \
--data '{
"app_id": "YOUR_ONESIGNAL_APP_ID",
"include_player_ids": ["PLAYER_ID_1", "PLAYER_ID_2"],
"headings": {"en": "Test Notification"},
"contents": {"en": "This is a test from the API"},
"data": {"custom_key": "custom_value"}
}'

API Response

Successful response:

{
"id": "notification-id",
"recipients": 2,
"external_id": null
}

Track Notification Status

Check notification delivery:

curl --location 'https://onesignal.com/api/v1/notifications/NOTIFICATION_ID?app_id=YOUR_APP_ID' \
--header 'Authorization: Basic YOUR_REST_API_KEY'

Step 7: Monitor Notification Performance

OneSignal Dashboard Metrics

Go to DeliverySent Messages to view:

  • Sent: Total notifications sent
  • Delivered: Successfully delivered
  • Opened: Users who tapped notification
  • Converted: Users who completed target action
  • Click-through rate (CTR): Percentage who opened

Notification Report

For each notification, view:

  • Platform breakdown (iOS vs Android)
  • Delivery status
  • Open rate
  • Time to open
  • Device types
  • OS versions

Common Issues and Solutions

iOS Issues

"Notifications not appearing on iOS"

Possible causes:

  • Notification permissions denied
  • APNs certificate invalid or expired
  • Incorrect Bundle ID in OneSignal
  • Device in Do Not Disturb mode

Solutions:

  1. Check notification permissions in Settings → App → Notifications
  2. Verify APNs .p8 key in OneSignal is correct
  3. Confirm Bundle ID matches exactly
  4. Disable Do Not Disturb mode

"Badge count not updating"

Solution:

  • Ensure badge count is included in notification payload
  • Check app handles badge count updates
  • Clear app from background and reopen

"Notifications delayed"

Solution:

  • iOS may delay notifications to save battery
  • Use high priority for time-sensitive notifications
  • Check device has good internet connection

Android Issues

"Notifications not appearing on Android"

Possible causes:

  • Notification permissions denied
  • Firebase Server Key incorrect
  • Battery optimization killing app
  • Notification channel disabled

Solutions:

  1. Check notification permissions in Settings → Apps → App → Notifications
  2. Verify Firebase Server Key in OneSignal
  3. Disable battery optimization for app
  4. Check notification channel is enabled

"Notifications appear but no sound"

Solution:

  • Check notification channel settings
  • Verify device volume is up
  • Check Do Not Disturb mode is off
  • Ensure notification priority is set correctly

"Notifications not grouping"

Solution:

  • Set notification group in OneSignal
  • Use consistent group key for related notifications
  • Check Android version supports grouping (4.1+)

General Issues

"Device not registering with OneSignal"

Solutions:

  1. Check OneSignal App ID is correct in app
  2. Verify internet connection
  3. Check app has been opened at least once
  4. Review device logs for errors
  5. Reinstall app and try again

"Notifications work in testing but not production"

Solutions:

  1. Verify production certificates are correct
  2. Check OneSignal is in production mode
  3. Ensure production app uses correct OneSignal App ID
  4. Review app signing configuration

"High unsubscribe rate"

Solutions:

  1. Don't send too many notifications
  2. Make notifications relevant and valuable
  3. Allow users to customize notification preferences
  4. Send at appropriate times
  5. Provide clear opt-out option

Best Practices

Notification Frequency

  • Don't spam: Limit to 1-3 per day
  • Respect time zones: Send at appropriate times
  • Allow customization: Let users choose notification types
  • Monitor unsubscribes: High rate indicates too many notifications

Notification Content

  • Clear and concise: Get to the point quickly
  • Actionable: Include clear call-to-action
  • Personalized: Use user's name or relevant data
  • Timely: Send when most relevant
  • Valuable: Provide real value to user

Technical Best Practices

  • Test on real devices: Emulators may not work correctly
  • Test both platforms: iOS and Android behave differently
  • Test different OS versions: Behavior varies by version
  • Monitor delivery rates: Track and optimize
  • Handle errors gracefully: App shouldn't crash on notification

Testing Checklist

Before launching, verify:

  • Notifications appear on iOS devices
  • Notifications appear on Android devices
  • Notification permissions requested correctly
  • Notifications work when app is closed
  • Notifications work when app is in background
  • Notifications work when app is in foreground
  • Deep links open correct screens
  • Images display correctly
  • Action buttons work (if implemented)
  • Badge counts update correctly (iOS)
  • Notification channels work (Android)
  • Sound and vibration work
  • Notifications group correctly
  • Unsubscribe works properly
  • Analytics tracking works
  • API integration works (if applicable)

Next Steps

  1. Monitor notification performance regularly
  2. Optimize send times based on user engagement
  3. A/B test different notification content
  4. Segment users for targeted notifications
  5. Collect user feedback on notification preferences
  6. Update notification strategy based on metrics

Additional Resources