GCKDeviceManager 클래스

GCKDeviceManager 클래스 참조

개요

Cast 기기 컨트롤러입니다.

이 클래스는 Cast 기기에서 실행되는 애플리케이션에 메시지를 보내고, 애플리케이션으로부터 메시지를 수신하고, 애플리케이션을 실행하고, 애플리케이션을 닫을 수 있습니다.

GCKDeviceManager 인스턴스는 Cast 기기에 연결이 설정되어 있거나 생성 또는 해체되는 과정에 있는 동안 범위 내에 있어야 합니다. connect (GCKDeviceManager)로 연결이 시작되기 전이나 deviceManager:didDisconnectWithError: (GCKDeviceManagerDelegate-p), deviceManager:didSuspendConnectionWithReason: (GCKDeviceManagerDelegate-p) 또는 deviceManager:didFailToConnectWithError: (GCKDeviceManagerDelegate-p) 위임 콜백이 호출된 후 객체를 해제해도 됩니다.

Deprecated:
GCKSessionManagerGCKCastSession를 사용하여 Cast 수신자와 상호작용합니다.

NSObject를 상속합니다.

인스턴스 메서드 요약

(instancetype) - initWithDevice:clientPackageName:
 지정된 기기로 새 GCKDeviceManager을 생성합니다. 더보기
 
(instancetype) - initWithDevice:clientPackageName:ignoreAppStateNotifications:
 지정된 이니셜라이저입니다. 더보기
 
(void) - connect
 기기에 연결합니다. 더보기
 
(void) - disconnect
 기기에서 연결을 해제합니다. 더보기
 
(void) - disconnectWithLeave:
 기기에서 연결을 해제합니다. 더보기
 
(BOOL) - addChannel:
 특정 네임스페이스에서 이 기기의 메시지를 보내고 받을 수 있는 채널을 추가합니다. 더보기
 
(BOOL) - removeChannel:
 이전에 추가된 채널을 삭제합니다. 더보기
 
(NSInteger) - launchApplication:
 애플리케이션을 실행합니다. 더보기
 
(NSInteger) - launchApplication:withLaunchOptions:
 지정된 실행 옵션을 사용하여 애플리케이션을 실행합니다. 더보기
 
(NSInteger) - launchApplication:relaunchIfRunning:
 애플리케이션을 실행합니다. 이미 실행 중인 경우 선택적으로 다시 실행합니다. 더보기
 
(NSInteger) - joinApplication:
 애플리케이션에 참여합니다. 더보기
 
(NSInteger) - joinApplication:sessionID:
 특정 애플리케이션 세션 ID로 애플리케이션에 참여합니다. 더보기
 
(BOOL) - leaveApplication
 현재 애플리케이션을 종료합니다. 더보기
 
(NSInteger) - stopApplication
 실행 중인 애플리케이션을 중지합니다. 더보기
 
(NSInteger) - stopApplicationWithSessionID:
 지정된 애플리케이션 세션 ID로 애플리케이션을 중지합니다. 더보기
 
(NSInteger) - setVolume:
 시스템 볼륨을 설정합니다. 더보기
 
(NSInteger) - setMuted:
 음소거를 사용 설정 또는 중지합니다. 자세히...
 
(NSInteger) - requestDeviceStatus
 기기의 현재 상태를 요청합니다. 더보기
 

숙박 시설 요약

BOOL ignoreAppStateNotifications
 이 객체가 앱 상태 알림을 수신할지 여부입니다. 더보기
 
GCKConnectionState connectionState
 기기 관리자의 현재 연결 상태입니다. 더보기
 
GCKConnectionState applicationConnectionState
 기기 관리자의 현재 애플리케이션 연결 상태입니다. 더보기
 
BOOL isConnected
 기기 관리자가 기기에 연결을 설정한 경우 True입니다. 더보기
 
BOOL isConnectedToApp
 기기 관리자가 기기의 애플리케이션에 연결을 설정한 경우 True입니다. 더보기
 
BOOL isReconnecting
 일시적인 이벤트 (예: 앱이 백그라운드에 있거나 다시 연결하여 해결할 수 있는 네트워크 오류가 발생함)로 인해 기기 관리자가 연결이 해제된 경우 true입니다. 더보기
 
NSTimeInterval reconnectTimeout
 소켓이 일시적인 오류로 연결이 끊어지는 경우 이 시간 동안 다시 연결이 시도됩니다. 더보기
 
GCKDevicedevice
 GCKDeviceManager에 의해 제어되는 기기입니다. 더보기
 
id< GCKDeviceManagerDelegatedelegate
 GCKDeviceManager에서 알림을 수신하는 대리자입니다. 더보기
 
float deviceVolume
 알려진 경우 기기의 현재 볼륨(범위 [0.0, 1.0])입니다. 그렇지 않으면 0입니다. 더보기
 
BOOL deviceMuted
 알려진 경우 기기의 현재 음소거 상태입니다. 그렇지 않으면 NO입니다. 더보기
 
GCKActiveInputStatus activeInputStatus
 기기의 현재 '활성 입력' 상태입니다. 더보기
 
GCKStandbyStatus standbyStatus
 기기의 현재 '대기' 상태입니다. 더보기
 
NSString * applicationSessionID
 현재 연결된 수신기 애플리케이션의 애플리케이션 세션 ID입니다(있는 경우). 그렇지 않으면 nil입니다. 더보기
 
GCKApplicationMetadataapplicationMetadata
 현재 수신기에서 실행 중인 수신기 애플리케이션의 메타데이터입니다(있는 경우). 그렇지 않으면 nil입니다. 더보기
 
NSString * applicationStatusText
 현재 실행 중인 리시버 애플리케이션에서 가장 최근에 보고된 상태 텍스트입니다(있는 경우). 그렇지 않으면 nil입니다. 더보기
 

메소드 세부정보

- (instancetype) initWithDevice: (GCKDevice *)  device
clientPackageName: (NSString *)  clientPackageName 

지정된 기기로 새 GCKDeviceManager을 생성합니다.

이 객체는 앱 상태 알림을 수신 대기하고 앱이 백그라운드로 전환되면 기기에서 자동으로 연결 해제되며 앱이 포그라운드로 돌아오면 기기에 다시 연결하려고 시도합니다.

Parameters
deviceThe device to control.
clientPackageNameThe client package name.
- (instancetype) initWithDevice: (GCKDevice *)  device
clientPackageName: (NSString *)  clientPackageName
ignoreAppStateNotifications: (BOOL)  ignoreAppStateNotifications 

지정된 이니셜라이저입니다.

지정된 기기를 제어하기 위한 새 GCKDeviceManager를 생성합니다.

ignoreAppStateNotificationsNO이면 객체는 앱 상태의 변경사항을 수신 대기하고 앱이 백그라운드로 전환되면 기기에서 자동으로 연결이 해제되며 앱이 포그라운드로 돌아오면 기기에 다시 연결하려고 시도합니다.

ignoreAppStateNotificationsYES인 경우 객체는 이러한 알림을 수신하지 않으며 연결 수명 주기를 관리하는 것은 앱의 책임입니다. 일반적으로 백그라운드 iOS 앱은 무기한으로 계속 실행될 수 없으며 활성 네트워크 연결은 결국 운영체제에 의해 닫힙니다.

Parameters
deviceThe device to control.
clientPackageNameThe client package name.
ignoreAppStateNotificationsWhether this object will ignore app state notifications.
- (void) connect

기기에 연결합니다.

- (void) disconnect

기기에서 연결을 해제합니다.

명시적 연결 해제입니다.

connect가 호출된 후 이 객체가 소유자에 의해 해제되기 전에 연결 해제 메서드 중 하나가 호출되어야 합니다.

- (void) disconnectWithLeave: (BOOL)  leaveApplication

기기에서 연결을 해제합니다.

connect가 호출된 후 이 객체가 소유자에 의해 해제되기 전에 연결 해제 메서드 중 하나가 호출되어야 합니다.

Parameters
leaveApplicationYES if this is an explicit disconnect that should disconnect from ("leave") the receiver application before closing the connection; NO if this is an implicit disconnect that should just close the connection.
- (BOOL) addChannel: (GCKCastChannel *)  channel

특정 네임스페이스에서 이 기기의 메시지를 보내고 받을 수 있는 채널을 추가합니다.

Parameters
channelThe channel.
반환 값
채널이 추가된 경우
YES, 해당 네임스페이스에 이미 연결된 채널이 있어 추가되지 않은 경우 NO
- (BOOL) removeChannel: (GCKCastChannel *)  channel

이전에 추가된 채널을 삭제합니다.

Parameters
channelThe channel.
반환 값
채널이 삭제된 경우
YES, 지정된 채널이 이전에 연결되지 않아 삭제되지 않은 경우 NO
- (NSInteger) launchApplication: (NSString *)  applicationID

애플리케이션을 실행합니다.

Parameters
applicationIDThe application ID.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) launchApplication: (NSString *)  applicationID
withLaunchOptions: (GCKLaunchOptions *__nullable)  launchOptions 

지정된 실행 옵션을 사용하여 애플리케이션을 실행합니다.

Parameters
applicationIDThe application ID.
launchOptionsThe launch options for this request. If nil, defaults will be used.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) launchApplication: (NSString *)  applicationID
relaunchIfRunning: (BOOL)  relaunchIfRunning 

애플리케이션을 실행합니다. 이미 실행 중인 경우 선택적으로 다시 실행합니다.

Deprecated:
대신 launchApplication:withLaunchOptions:를 사용하세요.
Parameters
applicationIDThe application ID.
relaunchIfRunningIf YES, relaunches the application if it is already running instead of joining the running application.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) joinApplication: (NSString *__nullable)  applicationID

애플리케이션에 참여합니다.

Parameters
applicationIDThe application ID. If nil, attempts to join whichever application is currently running; otherwise, attempts to join the specified application.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) joinApplication: (NSString *)  applicationID
sessionID: (NSString *)  sessionID 

특정 애플리케이션 세션 ID로 애플리케이션에 참여합니다.

지정된 세션 ID가 수신기에서 더 이상 활성 상태가 아니면 요청이 실패합니다.

Parameters
applicationIDThe application ID.
sessionIDThe application session ID.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (BOOL) leaveApplication

현재 애플리케이션을 종료합니다.

반환 값
NO(메시지를 보낼 수 없는 경우)
- (NSInteger) stopApplication

실행 중인 애플리케이션을 중지합니다.

반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) stopApplicationWithSessionID: (NSString *__nullable)  sessionID

지정된 애플리케이션 세션 ID로 애플리케이션을 중지합니다.

지정된 세션 ID가 수신기에서 더 이상 활성 상태가 아니면 요청이 실패합니다.

Parameters
sessionIDThe application session ID, which may not be nil.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) setVolume: (float)  volume

시스템 볼륨을 설정합니다.

Parameters
volumeThe new volume, in the range [0.0, 1.0]. Out of range values will be silently clipped.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) setMuted: (BOOL)  muted

음소거를 사용 설정 또는 사용 중지합니다.

Parameters
mutedWhether audio should be muted or unmuted.
반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.
- (NSInteger) requestDeviceStatus

기기의 현재 상태를 요청합니다.

이렇게 하면 업데이트된 상태 정보가 수신된 후 모든 위임자 상태 업데이트 콜백이 호출됩니다.

반환 값
요청 ID 또는 요청을 전송할 수 없는 경우 kGCKInvalidRequestID입니다.

숙박 시설 세부정보

- (BOOL) ignoreAppStateNotifications
readnonatomicassign

이 객체가 앱 상태 알림을 수신할지 여부입니다.

이 플래그는 초기화 프로그램에서 지정할 수 있습니다. 기본값은 NO입니다.

- (GCKConnectionState) connectionState
readnonatomicassign

기기 관리자의 현재 연결 상태입니다.

- (GCKConnectionState) applicationConnectionState
readnonatomicassign

기기 관리자의 현재 애플리케이션 연결 상태입니다.

- (BOOL) isConnected
readnonatomicassign

기기 관리자가 기기에 연결을 설정한 경우 True입니다.

Deprecated:
connectionState을 사용합니다.
- (BOOL) isConnectedToApp
readnonatomicassign

기기 관리자가 기기의 애플리케이션에 연결을 설정한 경우 True입니다.

Deprecated:
applicationConnectionState을 사용합니다.
- (BOOL) isReconnecting
readnonatomicassign

일시적인 이벤트 (예: 앱이 백그라운드에 있거나 다시 연결하여 해결할 수 있는 네트워크 오류가 발생함)로 인해 기기 관리자가 연결이 해제된 경우 true입니다.

일시적인 이벤트 후 기기 관리자가 다시 연결을 시도하는 동안 연결 해제/연결 콜백은 호출되지 않지만 속성은 항상 실제 현재 상태를 반영하며 관찰할 수 있습니다.

- (NSTimeInterval) reconnectTimeout
readwritenonatomicassign

소켓이 일시적인 오류로 연결이 끊어지는 경우 이 시간 동안 다시 연결이 시도됩니다.

기본 제한 시간은 15초입니다.

- (GCKDevice*) device
readnonatomicassign

GCKDeviceManager에 의해 제어되는 기기입니다.

- (id<GCKDeviceManagerDelegate>) delegate
readwritenonatomicweak

GCKDeviceManager에서 알림을 수신하는 대리자입니다.

- (float) deviceVolume
readnonatomicassign

알려진 경우 기기의 현재 볼륨(범위 [0.0, 1.0])입니다. 그렇지 않으면 0입니다.

- (BOOL) deviceMuted
readnonatomicassign

알려진 경우 기기의 현재 음소거 상태입니다. 그렇지 않으면 NO입니다.

- (GCKActiveInputStatus) activeInputStatus
readnonatomicassign

기기의 현재 '활성 입력' 상태입니다.

- (GCKStandbyStatus) standbyStatus
readnonatomicassign

기기의 현재 '대기' 상태입니다.

- (NSString*) applicationSessionID
readnonatomiccopy

현재 연결된 수신기 애플리케이션의 애플리케이션 세션 ID입니다(있는 경우). 그렇지 않으면 nil입니다.

수신기 애플리케이션이 실행될 때마다 (동일한 애플리케이션이 다시 실행되는 경우 포함) 새 고유 세션 ID가 생성되며 수신기 애플리케이션이 계속 실행되는 동안 유효합니다.

- (GCKApplicationMetadata*) applicationMetadata
readnonatomiccopy

현재 수신기에서 실행 중인 수신기 애플리케이션의 메타데이터입니다(있는 경우). 그렇지 않으면 nil입니다.

- (NSString*) applicationStatusText
readnonatomiccopy

현재 실행 중인 리시버 애플리케이션에서 가장 최근에 보고된 상태 텍스트입니다(있는 경우). 그렇지 않으면 nil입니다.