Skip to content

Commit

Permalink
- iPad support documented in the readme
Browse files Browse the repository at this point in the history
- Added examples showing you don't need to specify all resolutions
  • Loading branch information
EddyVerbruggen committed May 30, 2017
1 parent 293c5a7 commit e69ba94
Show file tree
Hide file tree
Showing 22 changed files with 69 additions and 13 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -72,7 +72,9 @@ this.appIconChanger.changeIcon({
## Preparing your app for icon switching
Apple doesn't allow switching to arbitrary icons, so they must be bundled with your app before releasing the app to the store.

Add the icons you'd like your users to be able to switch to for all relevant resolutions as usual:
Add the icons you'd like your users to be able to switch to for all relevant resolutions as usual.

> Note that you DON'T NEED to provide all those resolutions; you could get away with adding just the largest resolution and refer to it in the plist file. iOS will scale it down to other resolutions for you.
<img src="https://github.com/EddyVerbruggen/nativescript-app-icon-changer/raw/master/media/icon-listing.png" width="236px" height="266px" />

Expand All @@ -95,7 +97,6 @@ Then reference those icons in `App_Resources/iOS/Info.plist` as well:
<key>CFBundleIconFiles</key>
<array>
<!-- The actual filenames. Don't list the @2x/@3x files here -->
<string>icon-blue-50</string>
<string>icon-blue-57</string>
<string>icon-blue-60</string>
<string>icon-blue-72</string>
Expand All @@ -109,5 +110,6 @@ Then reference those icons in `App_Resources/iOS/Info.plist` as well:
</plist>
```

Confused? Look at [the demo app](https://github.com/EddyVerbruggen/nativescript-app-icon-changer/tree/master/demo/app/App_Resources/iOS) to see the gory details.
> Need iPad support as well? Just duplicate that plist config and change `<key>CFBundleIcons</key>` to `<key>CFBundleIcons~ipad</key>`.
Want to see this configured in an actual project? Look at [the demo app](https://github.com/EddyVerbruggen/nativescript-app-icon-changer/tree/master/demo/app/App_Resources/iOS) to see the gory details.
74 changes: 64 additions & 10 deletions demo/app/App_Resources/iOS/Info.plist
Expand Up @@ -54,7 +54,6 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-50</string>
<string>icon-57</string>
<string>icon-60</string>
<string>icon-72</string>
Expand All @@ -67,7 +66,6 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-red-50</string>
<string>icon-red-57</string>
<string>icon-red-60</string>
<string>icon-red-72</string>
Expand All @@ -80,7 +78,6 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-blue-50</string>
<string>icon-blue-57</string>
<string>icon-blue-60</string>
<string>icon-blue-72</string>
Expand All @@ -93,7 +90,6 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-green-50</string>
<string>icon-green-57</string>
<string>icon-green-60</string>
<string>icon-green-72</string>
Expand All @@ -106,11 +102,8 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-yellow-50</string>
<string>icon-yellow-57</string>
<string>icon-yellow-60</string>
<string>icon-yellow-72</string>
<string>icon-yellow-76</string>
<!-- this shows you don't NEED to supply all resolutions; Apple will scale down for you when needed -->
<string>icon-yellow-152</string>
</array>
</dict>
<key>icon-purple</key>
Expand All @@ -119,7 +112,6 @@
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-purple-50</string>
<string>icon-purple-57</string>
<string>icon-purple-60</string>
<string>icon-purple-72</string>
Expand All @@ -129,5 +121,67 @@
</dict>
</dict>

<!-- For iPad we're simply specifying 1 resolution, to show that that works as well (just use a large one, iOS will scale it down) -->
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>icon</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-76</string>
</array>
</dict>
<key>icon-red</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-red-76</string>
</array>
</dict>
<key>icon-blue</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-blue-76</string>
</array>
</dict>
<key>icon-green</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-green-76</string>
</array>
</dict>
<key>icon-yellow</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-yellow-152</string>
</array>
</dict>
<key>icon-purple</key>
<dict>
<key>UIPrerenderedIcon</key>
<true/>
<key>CFBundleIconFiles</key>
<array>
<string>icon-purple-76</string>
</array>
</dict>
</dict>
</dict>

</dict>
</plist>
Binary file removed demo/app/App_Resources/iOS/icon-blue-50.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-green-50.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-purple-50.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-red-50.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-100.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-114.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-144.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-50.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-60@2x.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-60@3x.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-72.png
Binary file not shown.
Binary file removed demo/app/App_Resources/iOS/icon-yellow-76.png
Binary file not shown.

0 comments on commit e69ba94

Please sign in to comment.