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
- User opens app → Device registers with OneSignal
- OneSignal assigns Player ID → Unique identifier for the device
- Server sends notification → Via OneSignal API or dashboard
- OneSignal delivers → To Apple (APNs) or Google (FCM)
- 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
- Log in to OneSignal Dashboard
- Select your app
- Go to Audience → All Users
- 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
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
- Go to Messages → New Push
- 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
- Click "Send to Test Users"
- Enter Player IDs of test devices
- Find Player IDs in Audience → All Users
Option 2: Specific Segment
- Select "Send to Particular Segment(s)"
- Choose segment (e.g., "Subscribed Users")
- Add filters if needed
Option 3: All Users
- Select "Send to Subscribed Users"
- 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
- Review your notification
- Click "Confirm"
- 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
Notification with Deep Link
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 Delivery → Sent 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:
- Check notification permissions in Settings → App → Notifications
- Verify APNs .p8 key in OneSignal is correct
- Confirm Bundle ID matches exactly
- 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:
- Check notification permissions in Settings → Apps → App → Notifications
- Verify Firebase Server Key in OneSignal
- Disable battery optimization for app
- 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:
- Check OneSignal App ID is correct in app
- Verify internet connection
- Check app has been opened at least once
- Review device logs for errors
- Reinstall app and try again
"Notifications work in testing but not production"
Solutions:
- Verify production certificates are correct
- Check OneSignal is in production mode
- Ensure production app uses correct OneSignal App ID
- Review app signing configuration
"High unsubscribe rate"
Solutions:
- Don't send too many notifications
- Make notifications relevant and valuable
- Allow users to customize notification preferences
- Send at appropriate times
- 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
- Monitor notification performance regularly
- Optimize send times based on user engagement
- A/B test different notification content
- Segment users for targeted notifications
- Collect user feedback on notification preferences
- Update notification strategy based on metrics