Search code examples
iosuiapplicationdelegate

What is FNFPlayer? It accesses UIApplication applicationState from background thread


I am constantly getting these warnings on iOS 11 (xcode 9):

=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 988, TID: 338692, Thread name: fnf player thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   hairzapp                            0x0000000103a35634 -[FNFPlayerLayer _preventPlayback] + 60
5   hairzapp                            0x0000000103a33f30 -[FNFPlayerLayer _resetGLContext] + 36
6   hairzapp                            0x0000000103a129cc __35-[FNFRenderingThread dispatchSync:]_block_invoke + 28
7   hairzapp                            0x0000000103a128a8 __35-[FNFRenderingThread performBlock:]_block_invoke + 36
8   CoreFoundation                      0x00000001848fa0fc <redacted> + 20
9   CoreFoundation                      0x00000001848f99cc <redacted> + 288
10  CoreFoundation                      0x00000001848f7c34 <redacted> + 2436
11  CoreFoundation                      0x0000000184817fb8 CFRunLoopRunSpecific + 436
12  CoreFoundation                      0x0000000184867098 CFRunLoopRun + 116
13  hairzapp                            0x0000000103a12ba4 -[FNFRenderingThread main] + 204
14  Foundation                          0x0000000185342860 <redacted> + 996
15  libsystem_pthread.dylib             0x000000018457c31c <redacted> + 308
16  libsystem_pthread.dylib             0x000000018457c1e8 <redacted> + 0
17  libsystem_pthread.dylib             0x000000018457ac28 thread_start + 4
2017-11-28 22:33:33.895582+0100 hairzapp[988:338692] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 988, TID: 338692, Thread name: fnf player thread, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   hairzapp                            0x0000000103a35634 -[FNFPlayerLayer _preventPlayback] + 60
5   hairzapp                            0x0000000103a33f30 -[FNFPlayerLayer _resetGLContext] + 36
6   hairzapp                            0x0000000103a129cc __35-[FNFRenderingThread dispatchSync:]_block_invoke + 28
7   hairzapp                            0x0000000103a128a8 __35-[FNFRenderingThread performBlock:]_block_invoke + 36
8   CoreFoundation                      0x00000001848fa0fc <redacted> + 20
9   CoreFoundation                      0x00000001848f99cc <redacted> + 288
10  CoreFoundation                      0x00000001848f7c34 <redacted> + 2436
11  CoreFoundation                      0x0000000184817fb8 CFRunLoopRunSpecific + 436
12  CoreFoundation                      0x0000000184867098 CFRunLoopRun + 116
13  hairzapp                            0x0000000103a12ba4 -[FNFRenderingThread main] + 204
14  Foundation                          0x0000000185342860 <redacted> + 996
15  libsystem_pthread.dylib             0x000000018457c31c <redacted> + 308
16  libsystem_pthread.dylib             0x000000018457c1e8 <redacted> + 0
17  libsystem_pthread.dylib             0x000000018457ac28 thread_start + 4

Can you help me find the source? I guess it must be one of the libraries I use, because there are only few calls to [UIApplication applicationState] in my code:

pod 'objective-zip', '1.0.3'
pod 'Google-Mobile-Ads-SDK'
pod 'AppLovinSDK'
pod 'AdColony'
pod 'GoogleMobileAdsMediationAppLovin'
pod 'GoogleMobileAdsMediationAdColony'
pod 'GoogleAnalytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork', '4.25.0'
pod 'GoogleConversionTracking'
pod 'Fabric'
pod 'Crashlytics'
pod 'AFNetworking'
pod 'AFNetworkActivityLogger', :git => 'https://github.com/AFNetworking/AFNetworkActivityLogger.git', :branch => '3_0_0'
pod 'iRate'
pod 'Firebase/Core'
pod 'Firebase/Messaging' 
pod 'MBProgressHUD'
pod 'Realm'
pod 'UICollectionViewLeftAlignedLayout'
pod 'OpenCV'
pod 'SCLAlertView-Objective-C'
pod 'CMPopTipView'

I would be glad if somebody could give me hint how to find the bad lib.


Solution

  • I guess it has Facebook SDK roots.
    Found Instagramm class-dump on GitHub, looks like some private class. https://github.com/RishabSwift/InstagramHeaders/blob/master/FNFPlayerLayer.h

    - (_Bool)_preventPlayback;    
    

    Also found FNFPlayerLayer "breadcrumbs" here:
    https://github.com/facebook/infer/blob/master/infer/tests/codetoanalyze/objc/ioslints/unavailable_property_ios.m

    Probably it comes from FBAudienceNetwork framework, you can try to remove it from your Podfile, then make pod install and analyze console logs again.