webrtc_m130/webrtc/sdk/objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h
Anders Carlsson fc309750a9 Access UIApplication on main thread
Track UIApplication applicationState changes from a C++ class. Uses
NSNotificationCenter to access changes on the main thread and exposes
a local variable that can be checked from any thread.

This fixes a runtime warning on iOS 11 beta.

My Objective-C++ is a little rusty so please check if this follows
the conventions for C++ code in the project. It also changes the
interface exposed by RTCUIApplication.h, not sure if that has impact
on any public APIs that needs to be documented somewhere?

Bug: webrtc:7773
Change-Id: I9c8ba090ef9f28d812114026a906cef742192c39
Reviewed-on: https://chromium-review.googlesource.com/527442
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Kári Tristan Helgason <kthelgason@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18558}
2017-06-13 09:37:47 +00:00

24 lines
615 B
Objective-C

/*
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#if defined(WEBRTC_IOS)
#import <Foundation/Foundation.h>
@interface RTCUIApplicationStatusObserver : NSObject
+ (instancetype)sharedInstance;
- (BOOL)isApplicationActive;
@end
#endif // WEBRTC_IOS