Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26385] iOS 11 Detect screen recording

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelseventlistener, ios-11, screen, security
ReporterMuhammad Qasim
AssigneeVijay Singh
Created2018-09-04T06:11:44.000+0000
Updated2018-09-12T10:06:52.000+0000

Description

iOS 11 has introduced the new built-in screen recording feature. While this is a great and useful feature it is also a security threat to confidential content, passwords and codes etc. iOS offers a notification UIScreenCapturedDidChangeNotification to observe when screen recording status changes. Our client require this functionality immediately but I was not able to find any solution for this in Titanium (except Hyperloop of course). Please expose this functionality in Titanium SDK at highest priority. Thanks. Helful links: [Official Apple Docs](https://developer.apple.com/documentation/uikit/uiscreen) [https://medium.com/@abhimuralidharan/detecting-screen-capturing-in-ios-11-cca15881c785](https://medium.com/@abhimuralidharan/detecting-screen-capturing-in-ios-11-cca15881c785) [StackOverFlow](https://stackoverflow.com/questions/46217459/how-to-understand-if-device-screen-is-being-recorded-in-ios-11/46218452)

Comments

  1. Sharif AbuDarda 2018-09-04

    Hello, Thanks for the ticket. As this can be performed through hyperloop. I believe we are not planning on this in near future. But, our engineers will look into it. Thanks.
  2. Muhammad Qasim 2018-09-04

    @SharifAbuDarda Does it mean that now Titanium SDK will no more have any new features as almost all of new features can be implemented using hyperloop even for small things like this one :(
  3. Sharif AbuDarda 2018-09-05

    [~appsol], I apologize for the misunderstanding. I meant since this can be achieved through Hyperloop. We are not planning to get on this right away. We will keep the ticket open for now. Thanks.
  4. Hans Knöchel 2018-09-05

    [~appsol] The whole SDK is open source [here](https://github.com/appcelerator/titanium_mobile) and accepts contributions at any time. If you are in a rush, feel free to extend it from there and we can review it accordingly. Thx! Hyperloop quick solution:
       var UIScreen = require('UIKit/UIScreen');
       var isCapturing = UIScreen.mainScreen.isCaptured()
       
    That's it. You can set a repeatable interval to check for this, just like in the example that you had.
  5. Muhammad Qasim 2018-09-07

    @hknoechel Thanks for sharing the suggestion. Appreciated. Could you please also tell how to add observer for
    UIScreenCapturedDidChangeNotification
    I have tried but don't know what to pass for the "observer (self)" and "selector" parameters. This is the native code:
       [[NSNotificationCenter defaultCenter] addObserver:self
                       selector:@selector(handleScreenCaptureChange)
          name:UIScreenCapturedDidChangeNotification object:nil];
       
       -(void)handleScreenCaptureChange
       {
           if (@available(iOS 11.0, *)) {
               BOOL isCaptured = [[UIScreen mainScreen] isCaptured];
               if (isCaptured && !isMainScreenMirrored) {
       
                   //Display Alert : "Please turn off screen recording and play again."
       
               }
           }
       }
       

JSON Source