2020-10-14 17:18:58 +03:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2020 Ivan Sein <ivan@nextcloud.com>
|
|
|
|
*
|
|
|
|
* @author Ivan Sein <ivan@nextcloud.com>
|
|
|
|
*
|
|
|
|
* @license GNU GPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2019-01-18 18:10:31 +03:00
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2020-07-09 18:21:23 +03:00
|
|
|
#import <CallKit/CallKit.h>
|
2019-01-18 18:10:31 +03:00
|
|
|
|
|
|
|
extern NSString * const CallKitManagerDidAnswerCallNotification;
|
2019-02-01 12:58:57 +03:00
|
|
|
extern NSString * const CallKitManagerDidEndCallNotification;
|
2019-02-01 17:01:02 +03:00
|
|
|
extern NSString * const CallKitManagerDidStartCallNotification;
|
2019-02-05 18:33:15 +03:00
|
|
|
extern NSString * const CallKitManagerDidChangeAudioMuteNotification;
|
2019-02-11 17:40:10 +03:00
|
|
|
extern NSString * const CallKitManagerWantsToUpgradeToVideoCall;
|
2022-01-07 18:16:36 +03:00
|
|
|
extern NSString * const CallKitManagerDidFailRequestingCallTransaction;
|
2019-01-18 18:10:31 +03:00
|
|
|
|
2020-07-09 18:21:23 +03:00
|
|
|
@interface CallKitCall : NSObject
|
|
|
|
|
|
|
|
@property (nonatomic, strong) NSUUID *uuid;
|
|
|
|
@property (nonatomic, strong) NSString *token;
|
|
|
|
@property (nonatomic, strong) NSString *displayName;
|
|
|
|
@property (nonatomic, strong) NSString *accountId;
|
|
|
|
@property (nonatomic, strong) CXCallUpdate *update;
|
2020-07-14 20:34:26 +03:00
|
|
|
@property (nonatomic, assign) BOOL reportedWhileInCall;
|
2021-02-15 00:28:32 +03:00
|
|
|
@property (nonatomic, assign) BOOL isRinging;
|
2022-06-27 19:10:33 +03:00
|
|
|
@property (nonatomic, assign) BOOL silentCall;
|
2020-07-09 18:21:23 +03:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2020-07-15 16:20:59 +03:00
|
|
|
@class NCPushNotification;
|
|
|
|
|
2019-01-18 18:10:31 +03:00
|
|
|
@interface CallKitManager : NSObject
|
|
|
|
|
2020-07-09 18:21:23 +03:00
|
|
|
@property (nonatomic, strong) NSMutableDictionary *calls; // uuid -> callKitCall
|
2019-01-18 18:10:31 +03:00
|
|
|
|
|
|
|
+ (instancetype)sharedInstance;
|
2019-02-13 16:01:00 +03:00
|
|
|
+ (BOOL)isCallKitAvailable;
|
2020-07-09 18:21:23 +03:00
|
|
|
- (void)reportIncomingCall:(NSString *)token withDisplayName:(NSString *)displayName forAccountId:(NSString *)accountId;
|
2020-07-15 16:20:59 +03:00
|
|
|
- (void)reportIncomingCallForNonCallKitDevicesWithPushNotification:(NCPushNotification *)pushNotification;
|
2022-10-20 20:29:26 +03:00
|
|
|
- (void)reportIncomingCallForOldAccount;
|
2022-06-27 19:10:33 +03:00
|
|
|
- (void)startCall:(NSString *)token withVideoEnabled:(BOOL)videoEnabled andDisplayName:(NSString *)displayName silently:(BOOL)silently withAccountId:(NSString *)accountId;
|
2020-07-09 18:21:23 +03:00
|
|
|
- (void)endCall:(NSString *)token;
|
2020-07-10 14:24:54 +03:00
|
|
|
- (void)reportAudioMuted:(BOOL)muted forCall:(NSString *)token;
|
2019-01-18 18:10:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
@end
|