You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
//
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
typedef void (^BackgroundTaskExpirationHandler)(void);
|
|
|
|
|
|
|
|
@protocol AppContext <NSObject>
|
|
|
|
|
|
|
|
- (BOOL)isMainApp;
|
|
|
|
- (BOOL)isMainAppAndActive;
|
|
|
|
|
|
|
|
// Is a NOOP if isMainApp is NO.
|
|
|
|
- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:
|
|
|
|
(BackgroundTaskExpirationHandler)expirationHandler;
|
|
|
|
- (void)endBackgroundTask:(UIBackgroundTaskIdentifier)backgroundTaskIdentifier;
|
|
|
|
|
|
|
|
// Should only be called if isMainApp is YES.
|
|
|
|
- (void)setMainAppBadgeNumber:(NSInteger)value;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
id<AppContext> CurrentAppContext(void);
|
|
|
|
void SetCurrentAppContext(id<AppContext> appContext);
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|