From 5394ef749aee702992df5d1acc85069314f767bd Mon Sep 17 00:00:00 2001 From: Vladislav Kiryukhin Date: Wed, 28 Mar 2018 17:59:08 +0300 Subject: [PATCH 1/5] Play video in background --- Stepic/AppDelegate.swift | 2 + Stepic/Info.plist | 8 +++- Stepic/Player.swift | 47 ++++++++++---------- Stepic/StepicVideoPlayerViewController.swift | 5 +++ 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Stepic/AppDelegate.swift b/Stepic/AppDelegate.swift index ae66b767d1..8d68103556 100644 --- a/Stepic/AppDelegate.swift +++ b/Stepic/AppDelegate.swift @@ -52,6 +52,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { NotificationCenter.default.addObserver(self, selector: #selector(AppDelegate.didReceiveRegistrationToken(_:)), name: NSNotification.Name.InstanceIDTokenRefresh, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(self.didBadgeUpdate(systemNotification:)), name: .badgeUpdated, object: nil) + application.beginReceivingRemoteControlEvents() + ExecutionQueues.sharedQueues.setUpQueueObservers() ExecutionQueues.sharedQueues.recoverQueuesFromPersistentStore() ExecutionQueues.sharedQueues.executeConnectionAvailableQueue() diff --git a/Stepic/Info.plist b/Stepic/Info.plist index 19a7f8dda2..f4950d3aef 100644 --- a/Stepic/Info.plist +++ b/Stepic/Info.plist @@ -2,8 +2,6 @@ - UIStatusBarStyle - UIStatusBarStyleLightContent CFBundleDevelopmentRegion en CFBundleExecutable @@ -89,6 +87,10 @@ NSAllowsArbitraryLoads + UIBackgroundModes + + audio + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -97,6 +99,8 @@ armv7 + UIStatusBarStyle + UIStatusBarStyleLightContent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/Stepic/Player.swift b/Stepic/Player.swift index fbf62210ff..c4219d2a15 100644 --- a/Stepic/Player.swift +++ b/Stepic/Player.swift @@ -293,6 +293,13 @@ public class Player: UIViewController { public override func viewDidLoad() { super.viewDidLoad() + do { + try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) + try AVAudioSession.sharedInstance().setActive(true) + } catch { + print("failed to set up background playing: \(error)") + } + self.playerView.layer.addObserver(self, forKeyPath: PlayerReadyForDisplayKey, options: ([.new, .old]), context: &PlayerLayerObserverContext) self.timeObserver = self.avplayer.addPeriodicTimeObserver(forInterval: CMTimeMake(1, 100), queue: DispatchQueue.main, using: { [weak self] _ in guard let strongSelf = self else { return } @@ -468,30 +475,28 @@ extension Player { // UIApplication internal func addApplicationObservers() { - NotificationCenter.default.addObserver(self, selector: #selector(applicationWillResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: UIApplication.shared) - NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(_:)), name: NSNotification.Name.UIApplicationDidEnterBackground, object: UIApplication.shared) - NotificationCenter.default.addObserver(self, selector: #selector(applicationWillEnterForeground(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: UIApplication.shared) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationWillResignActive(_:)), name: .UIApplicationWillResignActive, object: UIApplication.shared) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationDidBecomeActive(_:)), name: .UIApplicationDidBecomeActive, object: UIApplication.shared) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationDidEnterBackground(_:)), name: .UIApplicationDidEnterBackground, object: UIApplication.shared) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationWillEnterForeground(_:)), name: .UIApplicationWillEnterForeground, object: UIApplication.shared) } internal func removeApplicationObservers() { } - @objc internal func applicationWillResignActive(_ aNotification: NSNotification) { - if self.playbackState == .playing { - self.pause() - } + @objc internal func handleApplicationWillResignActive(_ aNotification: Notification) { + } - @objc internal func applicationDidEnterBackground(_ aNotification: NSNotification) { - if self.playbackState == .playing { - self.pause() - } + @objc internal func handleApplicationDidBecomeActive(_ aNotification: Notification) { + playerView.player = self.avplayer } - @objc internal func applicationWillEnterForeground(_ aNoticiation: NSNotification) { - if self.playbackState == .paused { - self.playFromCurrentTime() - } + @objc internal func handleApplicationDidEnterBackground(_ aNotification: Notification) { + playerView.player = nil + } + + @objc internal func handleApplicationWillEnterForeground(_ aNoticiation: Notification) { } } @@ -622,21 +627,17 @@ extension Player { internal class PlayerView: UIView { - var player: AVPlayer! { + var player: AVPlayer? { get { - return (self.layer as! AVPlayerLayer).player + return playerLayer.player } set { - if (self.layer as! AVPlayerLayer).player != newValue { - (self.layer as! AVPlayerLayer).player = newValue - } + playerLayer.player = newValue } } var playerLayer: AVPlayerLayer { - get { - return self.layer as! AVPlayerLayer - } + return layer as! AVPlayerLayer } var fillMode: String { diff --git a/Stepic/StepicVideoPlayerViewController.swift b/Stepic/StepicVideoPlayerViewController.swift index ec3463b4ea..1e0fb8acf4 100644 --- a/Stepic/StepicVideoPlayerViewController.swift +++ b/Stepic/StepicVideoPlayerViewController.swift @@ -389,9 +389,14 @@ class StepicVideoPlayerViewController: UIViewController { extension StepicVideoPlayerViewController : PlayerDelegate { func playerReady(_ player: Player) { + guard player.playbackState == .stopped else { + return + } + print("player is ready to display") activityIndicator.isHidden = true setTimeParametersAfterPlayerIsReady() + player.seekToTime(CMTime(seconds: playerStartTime, preferredTimescale: 1000)) player.playFromCurrentTime() player.rate = currentRate.rawValue From e8db0099f69ab295f4f8f3b6df4970c82ebe93c8 Mon Sep 17 00:00:00 2001 From: Vladislav Kiryukhin Date: Wed, 28 Mar 2018 19:31:50 +0300 Subject: [PATCH 2/5] Add remote config --- Stepic/AppDelegate.swift | 2 -- Stepic/Player.swift | 33 +++++++++++++++++++++++++-------- Stepic/RemoteConfig.swift | 13 ++++++++++++- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/Stepic/AppDelegate.swift b/Stepic/AppDelegate.swift index 8d68103556..ae66b767d1 100644 --- a/Stepic/AppDelegate.swift +++ b/Stepic/AppDelegate.swift @@ -52,8 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { NotificationCenter.default.addObserver(self, selector: #selector(AppDelegate.didReceiveRegistrationToken(_:)), name: NSNotification.Name.InstanceIDTokenRefresh, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(self.didBadgeUpdate(systemNotification:)), name: .badgeUpdated, object: nil) - application.beginReceivingRemoteControlEvents() - ExecutionQueues.sharedQueues.setUpQueueObservers() ExecutionQueues.sharedQueues.recoverQueuesFromPersistentStore() ExecutionQueues.sharedQueues.executeConnectionAvailableQueue() diff --git a/Stepic/Player.swift b/Stepic/Player.swift index c4219d2a15..e27c9063e5 100644 --- a/Stepic/Player.swift +++ b/Stepic/Player.swift @@ -293,11 +293,13 @@ public class Player: UIViewController { public override func viewDidLoad() { super.viewDidLoad() - do { - try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) - try AVAudioSession.sharedInstance().setActive(true) - } catch { - print("failed to set up background playing: \(error)") + if RemoteConfig.shared.allowVideoInBackground { + do { + try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback) + try AVAudioSession.sharedInstance().setActive(true) + } catch { + print("failed to set up background playing: \(error)") + } } self.playerView.layer.addObserver(self, forKeyPath: PlayerReadyForDisplayKey, options: ([.new, .old]), context: &PlayerLayerObserverContext) @@ -485,18 +487,33 @@ extension Player { } @objc internal func handleApplicationWillResignActive(_ aNotification: Notification) { - + if !RemoteConfig.shared.allowVideoInBackground && self.playbackState == .playing { + self.pause() + } } @objc internal func handleApplicationDidBecomeActive(_ aNotification: Notification) { - playerView.player = self.avplayer + if RemoteConfig.shared.allowVideoInBackground { + // Attach AVPlayer to AVPlayerLayer again + playerView.player = self.avplayer + } } @objc internal func handleApplicationDidEnterBackground(_ aNotification: Notification) { - playerView.player = nil + if RemoteConfig.shared.allowVideoInBackground { + // Detach AVPlayer from AVPlayerLayer (from Apple's manual) + playerView.player = nil + } else { + if self.playbackState == .playing { + self.pause() + } + } } @objc internal func handleApplicationWillEnterForeground(_ aNoticiation: Notification) { + if !RemoteConfig.shared.allowVideoInBackground && self.playbackState == .paused { + self.playFromCurrentTime() + } } } diff --git a/Stepic/RemoteConfig.swift b/Stepic/RemoteConfig.swift index a7c77f7865..7d8536b65e 100644 --- a/Stepic/RemoteConfig.swift +++ b/Stepic/RemoteConfig.swift @@ -13,10 +13,12 @@ enum RemoteConfigKeys: String { case showStreaksNotificationTrigger = "show_streaks_notification_trigger" case adaptiveBackendUrl = "adaptive_backend_url" case supportedInAdaptiveModeCourses = "adaptive_courses_ios" + case allowVideoInBackground = "allow_video_in_background" } class RemoteConfig { private let defaultShowStreaksNotificationTrigger = ShowStreaksNotificationTrigger.loginAndSubmission + private let defaultAllowVideoInBackground = false static let shared = RemoteConfig() var loadingDoneCallback: (() -> Void)? @@ -25,7 +27,8 @@ class RemoteConfig { lazy var appDefaults: [String: NSObject] = [ RemoteConfigKeys.showStreaksNotificationTrigger.rawValue: defaultShowStreaksNotificationTrigger.rawValue as NSObject, RemoteConfigKeys.adaptiveBackendUrl.rawValue: StepicApplicationsInfo.adaptiveRatingURL as NSObject, - RemoteConfigKeys.supportedInAdaptiveModeCourses.rawValue: StepicApplicationsInfo.adaptiveSupportedCourses as NSObject + RemoteConfigKeys.supportedInAdaptiveModeCourses.rawValue: StepicApplicationsInfo.adaptiveSupportedCourses as NSObject, + RemoteConfigKeys.allowVideoInBackground.rawValue: defaultAllowVideoInBackground as NSObject ] enum ShowStreaksNotificationTrigger: String { @@ -57,6 +60,14 @@ class RemoteConfig { return ids } + var allowVideoInBackground: Bool { + guard let configValue = FirebaseRemoteConfig.RemoteConfig.remoteConfig().configValue(forKey: RemoteConfigKeys.allowVideoInBackground.rawValue).stringValue else { + return defaultAllowVideoInBackground + } + + return configValue == "true" + } + init() { loadDefaultValues() fetchCloudValues() From 9424b63fe946963f7c2a5eca4a2d12e06b024f72 Mon Sep 17 00:00:00 2001 From: Vladislav Kiryukhin Date: Wed, 28 Mar 2018 19:57:02 +0300 Subject: [PATCH 3/5] Forbid command center --- Stepic/StepicVideoPlayerViewController.swift | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Stepic/StepicVideoPlayerViewController.swift b/Stepic/StepicVideoPlayerViewController.swift index 1e0fb8acf4..6f0c61a5b2 100644 --- a/Stepic/StepicVideoPlayerViewController.swift +++ b/Stepic/StepicVideoPlayerViewController.swift @@ -238,6 +238,8 @@ class StepicVideoPlayerViewController: UIViewController { WatchSessionSender.sendPlaybackStatus(.available) NotificationCenter.default.addObserver(self, selector: #selector(StepicVideoPlayerViewController.audioRouteChanged(_:)), name: NSNotification.Name.AVAudioSessionRouteChange, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationDidBecomeActive(_:)), name: .UIApplicationDidBecomeActive, object: UIApplication.shared) + NotificationCenter.default.addObserver(self, selector: #selector(handleApplicationDidEnterBackground(_:)), name: .UIApplicationDidEnterBackground, object: UIApplication.shared) topTimeSlider.setThumbImage(Images.playerControls.timeSliderThumb, for: UIControlState()) @@ -275,7 +277,18 @@ class StepicVideoPlayerViewController: UIViewController { topTimeSlider.addTarget(self, action: #selector(StepicVideoPlayerViewController.finishedSeeking), for: UIControlEvents.touchUpInside) topTimeSlider.addTarget(self, action: #selector(StepicVideoPlayerViewController.startedSeeking), for: UIControlEvents.touchDown) MPRemoteCommandCenter.shared().togglePlayPauseCommand.addTarget(self, action: #selector(StepicVideoPlayerViewController.togglePlayPause)) -// MPRemoteCommandCenter.sharedCommandCenter().togglePlayPauseCommand.addTarget(self, action: #selector(togglePlayStop(_:))); + } + + @objc internal func handleApplicationDidEnterBackground(_ aNotification: Notification) { + if !RemoteConfig.shared.allowVideoInBackground { + MPRemoteCommandCenter.shared().togglePlayPauseCommand.removeTarget(self) + } + } + + @objc internal func handleApplicationDidBecomeActive(_ aNotification: Notification) { + if !RemoteConfig.shared.allowVideoInBackground { + MPRemoteCommandCenter.shared().togglePlayPauseCommand.addTarget(self, action: #selector(StepicVideoPlayerViewController.togglePlayPause)) + } } @objc func togglePlayPause() { From 7adeeb50bad5317868b0b20acae0e1fa78a38f25 Mon Sep 17 00:00:00 2001 From: Vladislav Kiryukhin Date: Thu, 29 Mar 2018 16:52:39 +0300 Subject: [PATCH 4/5] Add tooltip --- Stepic.xcodeproj/project.pbxproj | 86 ++++++++++---------- Stepic/StepicVideoPlayerViewController.swift | 17 ++++ Stepic/Tooltip.swift | 21 ++++- Stepic/TooltipDefaultsManager.swift | 15 ++++ Stepic/TooltipFactory.swift | 4 + Stepic/en.lproj/Localizable.strings | 1 + Stepic/ru.lproj/Localizable.strings | 1 + 7 files changed, 99 insertions(+), 46 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 80c31c34be..2665f912d1 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -8749,7 +8749,7 @@ CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 08D120731C937B2200A54ABC = { DevelopmentTeam = 4562ZPB9BG; @@ -8758,13 +8758,13 @@ CreatedOnToolsVersion = 6.4; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.ApplicationGroups.iOS = { enabled = 0; }; com.apple.BackgroundModes = { - enabled = 0; + enabled = 1; }; com.apple.GameCenter = { enabled = 0; @@ -8847,13 +8847,13 @@ CreatedOnToolsVersion = 8.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 9F9C71221E076AE000EC8DA3 = { CreatedOnToolsVersion = 8.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; }; }; @@ -15421,16 +15421,16 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = E9KER42773; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = StickerPackExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.StickerPackExtension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "c9ec1fae-f8ce-4f32-b356-5cd3fede8cc5"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.StickerPackExtension"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -15445,15 +15445,15 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = E9KER42773; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = StickerPackExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.StickerPackExtension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "6afc4145-e327-4af9-b19a-0dedfcbd72e9"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.StickerPackExtension"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -15624,8 +15624,8 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Stepic/Stepic.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 82; DEVELOPMENT_TEAM = E9KER42773; ENABLE_BITCODE = YES; @@ -15635,8 +15635,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "com.AlexKarpov.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "1b78f6cb-2443-4479-8828-77bb34275cb0"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Stepic/Stepic-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -15655,8 +15655,8 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Stepic/Stepic.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 82; DEVELOPMENT_TEAM = E9KER42773; ENABLE_BITCODE = YES; @@ -15666,8 +15666,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "com.AlexKarpov.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "636e8124-b505-48f4-9514-ff6f037a7ce0"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Stepic/Stepic-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -16330,16 +16330,16 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = E9KER42773; + DEVELOPMENT_TEAM = ""; IBSC_MODULE = StepicWatch_Extension; INFOPLIST_FILE = StepicWatch/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "0ef25a5f-052b-473a-85da-c8b50ea92f1c"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -16359,15 +16359,15 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = E9KER42773; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; IBSC_MODULE = StepicWatch_Extension; INFOPLIST_FILE = StepicWatch/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "4961717c-0bf7-4a77-b45e-d91540553fea"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; @@ -16383,16 +16383,16 @@ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CLANG_ANALYZER_NONNULL = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = E9KER42773; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "StepicWatch Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = "6fd1fd0b-92ce-4fa4-9d8b-ff57fbe23dee"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp.watchkitextension"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -16409,15 +16409,15 @@ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CLANG_ANALYZER_NONNULL = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = E9KER42773; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "StepicWatch Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = "23acfcb4-1517-485f-b269-7ab3373df952"; - PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp.watchkitextension"; + PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; diff --git a/Stepic/StepicVideoPlayerViewController.swift b/Stepic/StepicVideoPlayerViewController.swift index 6f0c61a5b2..c0b5378b80 100644 --- a/Stepic/StepicVideoPlayerViewController.swift +++ b/Stepic/StepicVideoPlayerViewController.swift @@ -230,6 +230,7 @@ class StepicVideoPlayerViewController: UIViewController { fileprivate var player: Player! var video: Video! + var videoInBackgroundTooltip: Tooltip? override func viewDidLoad() { super.viewDidLoad() @@ -279,6 +280,22 @@ class StepicVideoPlayerViewController: UIViewController { MPRemoteCommandCenter.shared().togglePlayPauseCommand.addTarget(self, action: #selector(StepicVideoPlayerViewController.togglePlayPause)) } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if RemoteConfig.shared.allowVideoInBackground && TooltipDefaultsManager.shared.shouldShowInVideoPlayer { + delay(2.0) { [weak self] in + guard let s = self else { + return + } + + s.videoInBackgroundTooltip = TooltipFactory.videoInBackground + s.videoInBackgroundTooltip?.show(direction: .down, in: s.view, from: s.fullscreenPlayButton, isArrowVisible: false) + TooltipDefaultsManager.shared.didShowInVideoPlayer = true + } + } + } + @objc internal func handleApplicationDidEnterBackground(_ aNotification: Notification) { if !RemoteConfig.shared.allowVideoInBackground { MPRemoteCommandCenter.shared().togglePlayPauseCommand.removeTarget(self) diff --git a/Stepic/Tooltip.swift b/Stepic/Tooltip.swift index 85c8e8f18d..69e9e0ce75 100644 --- a/Stepic/Tooltip.swift +++ b/Stepic/Tooltip.swift @@ -12,6 +12,7 @@ import EasyTipView protocol Tooltip { init(text: String, shouldDismissAfterTime: Bool, color: TooltipColor) func show(direction: TooltipDirection, in inView: UIView?, from fromView: UIView) + func show(direction: TooltipDirection, in inView: UIView?, from fromView: UIView, isArrowVisible: Bool) func show(direction: TooltipDirection, in inView: UIView?, from fromItem: UIBarButtonItem) func dismiss() } @@ -85,8 +86,18 @@ class EasyTipTooltip: Tooltip { preferences.drawing.borderColor = color.borderColor } - private func setupTooltip(direction: TooltipDirection) { + private func setupTooltip(direction: TooltipDirection, isArrowVisible: Bool) { preferences.drawing.arrowPosition = easyTipDirectionFromTooltipDirection(direction: direction) + + if !isArrowVisible { + switch direction { + case .up, .down: + preferences.drawing.arrowWidth = CGFloat(0) + case .left, .right: + preferences.drawing.arrowHeight = CGFloat(0) + } + } + easyTip = EasyTipView(text: text, preferences: preferences, delegate: nil) } @@ -101,13 +112,17 @@ class EasyTipTooltip: Tooltip { } func show(direction: TooltipDirection, in inView: UIView?, from fromView: UIView) { - setupTooltip(direction: direction) + show(direction: direction, in: inView, from: fromView, isArrowVisible: true) + } + + func show(direction: TooltipDirection, in inView: UIView?, from fromView: UIView, isArrowVisible: Bool) { + setupTooltip(direction: direction, isArrowVisible: isArrowVisible) easyTip.show(forView: fromView, withinSuperview: inView) setupDisappear() } func show(direction: TooltipDirection, in inView: UIView?, from fromItem: UIBarButtonItem) { - setupTooltip(direction: direction) + setupTooltip(direction: direction, isArrowVisible: true) easyTip.show(forItem: fromItem, withinSuperView: inView) setupDisappear() } diff --git a/Stepic/TooltipDefaultsManager.swift b/Stepic/TooltipDefaultsManager.swift index 50ae4637d6..a4178a90e9 100644 --- a/Stepic/TooltipDefaultsManager.swift +++ b/Stepic/TooltipDefaultsManager.swift @@ -17,6 +17,7 @@ class TooltipDefaultsManager { private let didShowOnLessonDownloadsKey = "didShowOnLessonDownloadsKey" private let didShowOnHomeContinueLearningKey = "didShowOnHomeContinueLearningKey" private let didShowOnStreaksSwitchInProfileKey = "didShowOnStreaksSwitchInProfileKey" + private let didShowInVideoPlayerKey = "didShowInVideoPlayerKey" var didShowOnLessonDownloads: Bool { set(value) { @@ -48,6 +49,16 @@ class TooltipDefaultsManager { } } + var didShowInVideoPlayer: Bool { + set(value) { + defaults.set(value, forKey: didShowInVideoPlayerKey) + } + + get { + return defaults.value(forKey: didShowInVideoPlayerKey) as? Bool ?? false + } + } + var shouldShowOnHomeContinueLearning: Bool { return !didShowOnHomeContinueLearning } @@ -59,4 +70,8 @@ class TooltipDefaultsManager { var shouldShowOnStreaksSwitchInProfile: Bool { return !didShowOnStreaksSwitchInProfile } + + var shouldShowInVideoPlayer: Bool { + return !didShowInVideoPlayer + } } diff --git a/Stepic/TooltipFactory.swift b/Stepic/TooltipFactory.swift index 8dfb75a6ea..9833e5fd42 100644 --- a/Stepic/TooltipFactory.swift +++ b/Stepic/TooltipFactory.swift @@ -24,4 +24,8 @@ struct TooltipFactory { static var streaksTooltip: Tooltip { return EasyTipTooltip(text: NSLocalizedString("StreaksSwitchTooltip", comment: ""), shouldDismissAfterTime: true, color: .standard) } + + static var videoInBackground: Tooltip { + return EasyTipTooltip(text: NSLocalizedString("VideoInBackgroundTooltip", comment: ""), shouldDismissAfterTime: true, color: .standard) + } } diff --git a/Stepic/en.lproj/Localizable.strings b/Stepic/en.lproj/Localizable.strings index 34d38bf252..4a6767473f 100644 --- a/Stepic/en.lproj/Localizable.strings +++ b/Stepic/en.lproj/Localizable.strings @@ -400,6 +400,7 @@ ShareCourseTooltip = "Share the link with your friends to learn together"; LessonDownloadTooltip = "Download lesson to watch lectures offline"; ContinueLearningWidgetTooltip = "Tap to continue from where you finished last time"; StreaksSwitchTooltip = "Turn on to get new portion of knowledge every day"; +VideoInBackgroundTooltip = "You can play video in background"; /* Notification alerts */ NotificationTabNotificationRequestAlertTitle = "Stay tuned"; diff --git a/Stepic/ru.lproj/Localizable.strings b/Stepic/ru.lproj/Localizable.strings index cc0ae68a5e..8e61647fa6 100644 --- a/Stepic/ru.lproj/Localizable.strings +++ b/Stepic/ru.lproj/Localizable.strings @@ -401,6 +401,7 @@ ShareCourseTooltip = "Поделитесь ссылкой с друзьями, LessonDownloadTooltip = "Загрузите урок, чтобы смотреть видео оффлайн"; ContinueLearningWidgetTooltip = "Нажмите, чтобы перейти к тому месту, где закончили в прошлый раз"; StreaksSwitchTooltip = "Включите, чтобы получать новую порцию знаний каждый день"; +VideoInBackgroundTooltip = "Вы можете продолжить воспроизведение видео в фоновом режиме"; /* Notification alerts */ NotificationTabNotificationRequestAlertTitle = "Следи за обновлениями"; From edb50e5e44759202adcafbc68f315d43bfecf210 Mon Sep 17 00:00:00 2001 From: Vladislav Kiryukhin Date: Thu, 29 Mar 2018 16:55:19 +0300 Subject: [PATCH 5/5] Revert manual signing in pbxproj --- Stepic.xcodeproj/project.pbxproj | 86 ++++++++++++++++---------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index 2665f912d1..80c31c34be 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -8749,7 +8749,7 @@ CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; 08D120731C937B2200A54ABC = { DevelopmentTeam = 4562ZPB9BG; @@ -8758,13 +8758,13 @@ CreatedOnToolsVersion = 6.4; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; SystemCapabilities = { com.apple.ApplicationGroups.iOS = { enabled = 0; }; com.apple.BackgroundModes = { - enabled = 1; + enabled = 0; }; com.apple.GameCenter = { enabled = 0; @@ -8847,13 +8847,13 @@ CreatedOnToolsVersion = 8.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; 9F9C71221E076AE000EC8DA3 = { CreatedOnToolsVersion = 8.2; DevelopmentTeam = E9KER42773; LastSwiftMigration = 0920; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; }; }; @@ -15421,16 +15421,16 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = E9KER42773; INFOPLIST_FILE = StickerPackExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.StickerPackExtension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "c9ec1fae-f8ce-4f32-b356-5cd3fede8cc5"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.StickerPackExtension"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -15445,15 +15445,15 @@ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = E9KER42773; INFOPLIST_FILE = StickerPackExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.StickerPackExtension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "6afc4145-e327-4af9-b19a-0dedfcbd72e9"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.StickerPackExtension"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -15624,8 +15624,8 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Stepic/Stepic.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 82; DEVELOPMENT_TEAM = E9KER42773; ENABLE_BITCODE = YES; @@ -15635,8 +15635,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "com.AlexKarpov.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "1b78f6cb-2443-4479-8828-77bb34275cb0"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Stepic/Stepic-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -15655,8 +15655,8 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Stepic/Stepic.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; CURRENT_PROJECT_VERSION = 82; DEVELOPMENT_TEAM = E9KER42773; ENABLE_BITCODE = YES; @@ -15666,8 +15666,8 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "com.AlexKarpov.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "636e8124-b505-48f4-9514-ff6f037a7ce0"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic"; SWIFT_OBJC_BRIDGING_HEADER = "Stepic/Stepic-Bridging-Header.h"; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 4.0; @@ -16330,16 +16330,16 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = E9KER42773; IBSC_MODULE = StepicWatch_Extension; INFOPLIST_FILE = StepicWatch/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "0ef25a5f-052b-473a-85da-c8b50ea92f1c"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp"; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -16359,15 +16359,15 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = E9KER42773; IBSC_MODULE = StepicWatch_Extension; INFOPLIST_FILE = StepicWatch/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "4961717c-0bf7-4a77-b45e-d91540553fea"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp"; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; @@ -16383,16 +16383,16 @@ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CLANG_ANALYZER_NONNULL = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = E9KER42773; INFOPLIST_FILE = "StepicWatch Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "6fd1fd0b-92ce-4fa4-9d8b-ff57fbe23dee"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp.watchkitextension"; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -16409,15 +16409,15 @@ ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication; CLANG_ANALYZER_NONNULL = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = E9KER42773; INFOPLIST_FILE = "StepicWatch Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.AlexKarpov.Stepic.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE = "23acfcb4-1517-485f-b269-7ab3373df952"; + PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.AlexKarpov.Stepic.watchkitapp.watchkitextension"; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On;