From 3efc5a8a4b5dfd5bc5de971bb06f4d39fae76cdd Mon Sep 17 00:00:00 2001 From: Watson Date: Thu, 4 Dec 2014 15:59:34 +0900 Subject: [PATCH] [WatchKit] fix info.plist in WatchKit extension and app --- lib/motion/project/template/ios-watch-extension-builder.rb | 1 + lib/motion/project/template/ios-watch-extension-config.rb | 2 ++ .../project/template/ios-watch-extension/files/Rakefile.erb | 3 +++ 3 files changed, 6 insertions(+) diff --git a/lib/motion/project/template/ios-watch-extension-builder.rb b/lib/motion/project/template/ios-watch-extension-builder.rb index dc61c7be..63073a9e 100644 --- a/lib/motion/project/template/ios-watch-extension-builder.rb +++ b/lib/motion/project/template/ios-watch-extension-builder.rb @@ -38,6 +38,7 @@ module Motion; module Project sh "/usr/bin/ibtool --errors --warnings --notices --module #{config.escaped_storyboard_module_name} --minimum-deployment-target #{config.sdk_version} --output-partial-info-plist /tmp/Interface-SBPartialInfo.plist --auto-activate-custom-fonts --output-format human-readable-text --compilation-directory '#{config.app_bundle(platform)}' watch_app/Interface.storyboard" # Create bundle/Info.plist. + config.info_plist['WKCompanionAppBundleIdentifier'] = config.identifier.sub('.watchapp', '') generate_info_plist(config, platform) end diff --git a/lib/motion/project/template/ios-watch-extension-config.rb b/lib/motion/project/template/ios-watch-extension-config.rb index 56b47849..7b889cf8 100644 --- a/lib/motion/project/template/ios-watch-extension-config.rb +++ b/lib/motion/project/template/ios-watch-extension-config.rb @@ -135,6 +135,8 @@ EOS plist = super plist['UIDeviceFamily'] << '4' # Probably means Apple Watch device? plist['WKWatchKitApp'] = true + plist.delete('UIBackgroundModes') + plist.delete('UIStatusBarStyle') plist end diff --git a/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb b/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb index 3d00f896..d17c6990 100644 --- a/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb +++ b/lib/motion/project/template/ios-watch-extension/files/Rakefile.erb @@ -13,6 +13,9 @@ Motion::Project::App.setup do |app| app.name = '<%= name %> WatchKit Extension' app.frameworks << "WatchKit" app.info_plist['NSExtension'] = { + 'NSExtensionAttributes' => { + 'WKAppBundleIdentifier' => app.identifier + '.watchapp' + }, 'NSExtensionPointIdentifier' => 'com.apple.watchkit' } app.info_plist['RemoteInterfacePrincipalClass'] = 'InterfaceController'