- Added
imageUrlfield to Notification type - Created NotificationDetailScreen with image display
- Image loading indicator and error handling
- Image preview indicator in notification cards
New Screen: screens/NotificationDetailScreen.tsx
- Full-screen notification view
- Priority banner with color coding
- Large image display (if available)
- Complete notification content
- Metadata display (created by, expiry, market)
- Back navigation
Utility: utils/notificationUtils.ts
- AsyncStorage-based tracking (no backend required)
- Device-level read status
- Unread count calculation
- Automatic read marking on view
Component: components/NotificationBell.tsx
- Shows in header of all screens (replacing logo)
- Red badge with unread count (99+ max)
- Tap to navigate to Notifications screen
- Auto-refresh every 30 seconds
- Updates on screen focus
- Blue background for unread notifications
- Unread dot indicator
- Bold title for unread
- Image indicator badge
- Tap anywhere to view details
- Chevron icon for navigation
- Notification bell added to left side of header
- Language switcher remains on right
You need to add the notification bell to these screens:
MarketScreen.tsx:
import NotificationBell from '../components/NotificationBell';
// In the return statement, update Header:
<Header
title={t('market')}
leftComponent={<NotificationBell />}
rightComponent={<LanguageSwitcher />} // if it has one
/>StatsScreen.tsx:
import NotificationBell from '../components/NotificationBell';
<Header
title={t('stats')}
leftComponent={<NotificationBell />}
/>AboutScreen.tsx:
import NotificationBell from '../components/NotificationBell';
<Header
title={t('about')}
leftComponent={<NotificationBell />}
/>File: screens/AdminNotificationScreen.tsx
Find the form section (around line 40-100) and add after message field:
// Add to formData state (line ~40)
const [formData, setFormData] = useState<NotificationFormData>({
title: '',
message: '',
priority: 'medium',
targetAudience: 'all',
targetMarket: undefined,
expiryDays: 7,
imageUrl: '', // ADD THIS LINE
});
// Add input field in the form (after message input, around line ~150)
<View style={styles.inputGroup}>
<Text style={styles.label}>{t('imageUrl')} ({t('optional')})</Text>
<TextInput
style={styles.input}
value={formData.imageUrl}
onChangeText={(text) => setFormData({ ...formData, imageUrl: text })}
placeholder={t('imageUrlPlaceholder')}
placeholderTextColor="#9CA3AF"
autoCapitalize="none"
keyboardType="url"
/>
<Text style={styles.helpText}>
{t('imageUrlHelp')}
</Text>
</View>Add to save function (around line ~80-100):
const notificationData: any = {
title: formData.title.trim(),
message: formData.message.trim(),
priority: formData.priority,
targetAudience: formData.targetAudience,
createdBy: user.username,
createdAt: Timestamp.now(),
expiresAt,
isActive: true,
imageUrl: formData.imageUrl?.trim() || null, // ADD THIS LINE
};File: locales/en.json
Add these lines:
"imageUrl": "Image URL",
"optional": "Optional",
"imageUrlPlaceholder": "https://example.com/image.jpg",
"imageUrlHelp": "Enter a direct image URL (HTTPS recommended)",
"hasImage": "Has Image",
"notificationDetails": "Notification Details",
"close": "Close",
"message": "Message",
"priority": "Priority"File: locales/kn.json
Add these lines:
"imageUrl": "ಚಿತ್ರ URL",
"optional": "ಐಚ್ಛಿಕ",
"imageUrlPlaceholder": "https://example.com/image.jpg",
"imageUrlHelp": "ನೇರ ಚಿತ್ರ URL ನಮೂದಿಸಿ (HTTPS ಶಿಫಾರಸು)",
"hasImage": "ಚಿತ್ರವಿದೆ",
"notificationDetails": "ಅಧಿಸೂಚನೆ ವಿವರಗಳು",
"close": "ಮುಚ್ಚಿ",
"message": "ಸಂದೇಶ",
"priority": "ಆದ್ಯತೆ"Since notification bell is now in header, you can optionally remove the Notifications tab:
File: App.tsx
Comment out or remove:
// Remove this entire Tab.Screen block (around line 305-311)
// <Tab.Screen
// name="Notifications"
// component={NotificationsScreen}
// options={{
// tabBarLabel: t('notifications'),
// }}
// />Also remove from icon logic (around line 253-255):
// Remove these lines:
// } else if (route.name === 'Notifications') {
// iconName = focused ? 'notifications' : 'notifications-outline';- Login to Admin Panel
- Create notification with image URL:
Title: Test Image Notification Message: This notification has an image Image URL: https://picsum.photos/400/300 Priority: Medium - Go to Notifications screen (tap bell icon)
- Tap the notification
- Verify image loads in detail view
- Create 3 new notifications
- See 3 unread count on bell icon
- Tap bell to view notifications
- Notice blue background on unread
- Tap one notification to view details
- Go back to list
- Notice that notification is now white (read)
- Bell count shows 2 unread
- From Home screen, tap notification bell
- Should navigate to Notifications screen
- Tap a notification
- Should show full detail view
- Tap back button
- Should return to notifications list
- Device back button should work correctly
1. Start the app:
npm start2. Look for notification bell:
- Should appear in top-left of Home screen
- Replaces the app logo
3. Create test notification:
- Go to About tab
- Tap shield icon (admin)
- Login
- Create notification with image URL
4. Test the flow:
- Tap bell icon → Goes to Notifications
- Tap notification → Shows full detail
- Image should load
- Back button works
- ✅ Notification bell with unread count badge
- ✅ Tap bell to view all notifications
- ✅ Tap notification to see full details
- ✅ Image support in notifications
- ✅ Read/Unread visual distinction
- ✅ Priority color coding
- ✅ Market-specific tags
- ✅ Relative timestamps
- ✅ Pull-to-refresh
- ✅ Filter by priority
- ✅ Multi-language support
- ✅ Create notifications with image URLs
- ✅ Priority selection (Low/Medium/High)
- ✅ Target all users or specific market
- ✅ Set expiry date
- ✅ Manage active notifications
- ✅ Delete old notifications
- ✅ AsyncStorage for read status (device-level)
- ✅ Firestore for notification data
- ✅ Auto-refresh unread count (30s interval)
- ✅ Efficient querying (client-side filtering)
- ✅ Image loading with error handling
- ✅ Navigation integration
- ✅ TypeScript types updated
screens/NotificationDetailScreen.tsx- Full notification viewcomponents/NotificationBell.tsx- Bell with badgeutils/notificationUtils.ts- Read tracking utilities
types/index.ts- Added imageUrl and read status typesscreens/NotificationsScreen.tsx- Added detail view, read trackingscreens/HomeScreen.tsx- Added notification belllocales/en.json&kn.json- Need translations (see above)
screens/MarketScreen.tsx- Add notification bellscreens/StatsScreen.tsx- Add notification bellscreens/AboutScreen.tsx- Add notification bellscreens/AdminNotificationScreen.tsx- Add imageUrl field
- Notification Bell Position: Now in header left (replaces logo on most screens)
- Read Status: Stored locally per device (not synced across devices)
- Image URLs: Must be direct image URLs (HTTPS recommended)
- Unread Count: Auto-updates every 30 seconds
- Navigation: Uses existing React Navigation setup
- No Backend Changes: Read status uses AsyncStorage only
- Logo in header
- Notifications tab in bottom navigation
- Basic notification list
- No detail view
- No image support
- No read/unread tracking
- Notification bell with badge
- Tap bell for notifications (no bottom tab needed)
- Rich notification cards
- Full detail screen with images
- Read/unread visual distinction
- Unread count always visible
For End Users:
- Tap the bell icon anytime to check notifications
- Red badge shows unread count
- Blue background = unread notification
- Tap any notification for full details
- Pull down to refresh
For Admins:
- Use direct image URLs (not Google Drive/Dropbox)
- Test image URLs before sending
- Use appropriate priority levels
- Set reasonable expiry dates
- Include clear, actionable messages
Last Updated: October 30, 2025 Status: 90% Complete - Needs final touches (see above) Test Status: Ready for testing with minor completion steps