diff --git a/lib/motion/project/template/ios/config.rb b/lib/motion/project/template/ios/config.rb index 4f0904f5..5f7692e5 100644 --- a/lib/motion/project/template/ios/config.rb +++ b/lib/motion/project/template/ios/config.rb @@ -388,6 +388,17 @@ def launch_image_metadata(path) } end + def icon_file_names + images = resources_dirs.map do |dir| + Dir.glob(File.join(dir, 'Icon*.png')).map do |file| + f = File.basename(file, File.extname(file)) + i = f.rindex('@') + i ? f[0...i] : f + end + end.flatten.compact + images.uniq + end + # From iOS 7 and up we try to infer the launch images by looking for png # files that start with 'Default'. # @@ -403,6 +414,7 @@ def launch_images end def merged_info_plist(platform) + self.icons = icon_file_names if icons.empty? ios = { 'MinimumOSVersion' => deployment_target, 'CFBundleResourceSpecification' => 'ResourceRules.plist',