Skip to content

Commit 7d00da7

Browse files
committed
Fix iOS icon theme switching issue
- Remove theme-specific iOS icons (iOS doesn't support dynamic switching) - Configure single universal apple-touch-icon.png for all themes - Add comprehensive iOS icon guide explaining limitations - Update both layout.tsx and manifest.json configurations iOS limitation: Home screen icons don't change with system theme. Universal icon approach is industry standard for PWAs.
1 parent 748d562 commit 7d00da7

3 files changed

Lines changed: 86 additions & 24 deletions

File tree

IOS_ICON_GUIDE.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# 📱 iOS App Icon Theme Switching Guide
2+
3+
## ⚠️ **Important iOS Limitation**
4+
5+
**iOS does NOT support dynamic theme switching for PWA home screen icons.**
6+
7+
### How iOS Handles PWA Icons:
8+
9+
1. **During "Add to Home Screen"**: iOS picks ONE icon based on current theme
10+
2. **After adding**: Icon stays the same regardless of theme changes
11+
3. **To update icon**: Must remove app and re-add to home screen
12+
13+
This is a limitation of iOS Safari/WebKit, not your app configuration.
14+
15+
## 🎯 **Recommended Solution: Universal Icon**
16+
17+
Create **one icon that works well in both light and dark themes**:
18+
19+
### **Best Practices for Universal Icons:**
20+
21+
1. **Use neutral colors** (works in both themes)
22+
2. **Avoid pure white/black backgrounds**
23+
3. **Add subtle borders** for contrast
24+
4. **Test on both light/dark home screens**
25+
26+
### 🎨 **Design Tips:**
27+
28+
```
29+
✅ Good Universal Colors:
30+
- Brand colors (blue, green, purple, etc.)
31+
- Gradients with neutral tones
32+
- Icons with colored backgrounds
33+
- Subtle shadows/borders
34+
35+
❌ Avoid:
36+
- Pure white backgrounds (invisible on light mode)
37+
- Pure black backgrounds (invisible on dark mode)
38+
- Very light colors without borders
39+
- Text-heavy designs
40+
```
41+
42+
## 🔄 **Alternative: Keep Theme Icons (Limited)**
43+
44+
If you prefer separate theme icons, users need to:
45+
46+
1. **Light Mode**: Remove app → Switch to light → Re-add app
47+
2. **Dark Mode**: Remove app → Switch to dark → Re-add app
48+
49+
**Note**: Most users won't do this, so universal icon is better.
50+
51+
## 🧪 **Testing Your Icon**
52+
53+
1. **Light Mode Test**:
54+
- Switch iOS to light mode
55+
- Add app to home screen
56+
- Check visibility/contrast
57+
58+
2. **Dark Mode Test**:
59+
- Switch iOS to dark mode
60+
- Add app to home screen
61+
- Check visibility/contrast
62+
63+
3. **Universal Icon Test**:
64+
- Create one icon
65+
- Test in both themes
66+
- Ensure good visibility in both
67+
68+
## 📱 **Current Configuration**
69+
70+
**Updated to use universal icon**:
71+
- `apple-touch-icon.png` - Single icon for all themes
72+
- Removed theme-specific variants to avoid confusion
73+
74+
## 🎯 **Icon Requirements Reminder**
75+
76+
- **Size**: 180x180 pixels
77+
- **Format**: PNG
78+
- **Background**: Opaque (iOS adds rounded corners)
79+
- **Safe area**: Keep content away from edges
80+
- **Visibility**: Must work on both light/dark home screens
81+
82+
---
83+
84+
## 💡 **Pro Tip**
85+
86+
Popular apps like Instagram, Twitter, and WhatsApp use universal icons that work well in both themes. This is the industry standard approach for PWAs on iOS.

app/layout.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,6 @@ export const metadata: Metadata = {
149149
],
150150
apple: [
151151
{ url: "/apple-touch-icon.png", sizes: "180x180", type: "image/png" },
152-
{
153-
url: "/apple-touch-icon-light.png",
154-
sizes: "180x180",
155-
type: "image/png",
156-
media: "(prefers-color-scheme: light)",
157-
},
158-
{
159-
url: "/apple-touch-icon-dark.png",
160-
sizes: "180x180",
161-
type: "image/png",
162-
media: "(prefers-color-scheme: dark)",
163-
},
164152
],
165153
other: [
166154
{

public/manifest.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@
5555
"src": "/apple-touch-icon.png",
5656
"sizes": "180x180",
5757
"type": "image/png"
58-
},
59-
{
60-
"src": "/apple-touch-icon-light.png",
61-
"sizes": "180x180",
62-
"type": "image/png",
63-
"media": "(prefers-color-scheme: light)"
64-
},
65-
{
66-
"src": "/apple-touch-icon-dark.png",
67-
"sizes": "180x180",
68-
"type": "image/png",
69-
"media": "(prefers-color-scheme: dark)"
7058
}
7159
],
7260
"screenshots": [

0 commit comments

Comments
 (0)