질문
MDM 스크린캡춰 제어 시 토스트 메세지
2
2018-07-24 14:00:15
112.♡.242.154
제목과 같이 MDM 스크린캡춰 제어 시 토스트 메세지 가 불가능 한가요?
가령 MDM 스크린캡춰 제어가 걸렸을 경우 스크린캡춰를 시도하면
'스크린캡춰가 제한되었습니다. 로그아웃 후 실행하여 주십시오' 같은
메세지를 뿌리고 싶은데 방법이 없을까요?
찾아보니 아래 소스에서 스크린캡춰후 처리 부분에 삽입하면 됟듯한데
개발파트에선 불가능 하다고만 하니 너무 답답합니다.
정말 MDM 스크린캡춰 제어시 에는 토스트 메세지가 불가능 한지요?
# Objective-C
1
2
3
4
5
6
7
8
9 |
// Objective-C
NSOperationQueue *mainQueue = [ NSOperationQueue mainQueue];
[[ NSNotificationCenter defaultCenter]
addObserverForName: UIApplicationUserDidTakeScreenshotNotification
object: nil
queue:mainQueue
usingBlock:^( NSNotification *notification) {
// 스크린캡쳐후 처리
}];
|
# Swift
1
2
3
4
5
6
7
8
9
10 |
// Swift
let mainQueue = NSOperationQueue .mainQueue()
NSNotificationCenter .defaultCenter().addObserverForName(
UIApplicationUserDidTakeScreenshotNotification ,
object: nil ,
queue: mainQueue)
{
notification in
// 스크린캡쳐후 처리
}
|
추가로 말씀드리자면 notificationcenter로 이벤트가 들어오는 시점은 캡쳐가 행해진 후(캡쳐가 끝난 후) 이벤트가 발생됩니다.
/Vollago