Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding DISABLE_CALLKIT preprocessor macro to disable compilation of CallKit #1028

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changes to be released in next version
🧱 Build
* build.sh: Add xcframework argument to build a universal MatrixSDK.xcframework
* MatrixSDKTests-macOS: Remove tests from macOS profile and archive builds to match iOS.
* Support adding DISABLE_CALLKIT preprocessor macro to disable compilation of CallKit.

Others
*
Expand Down
2 changes: 2 additions & 0 deletions MatrixSDK/VoIP/CallKit/MXCallKitAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
limitations under the License.
*/

#ifndef DISABLE_CALLKIT
#if TARGET_OS_IPHONE

@import Foundation;
Expand Down Expand Up @@ -64,3 +65,4 @@ API_AVAILABLE(ios(10.0))
NS_ASSUME_NONNULL_END

#endif
#endif
2 changes: 2 additions & 0 deletions MatrixSDK/VoIP/CallKit/MXCallKitAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
limitations under the License.
*/

#ifndef DISABLE_CALLKIT
#if TARGET_OS_IPHONE

#import "MXCallKitAdapter.h"
Expand Down Expand Up @@ -370,3 +371,4 @@ - (void)contactIdentifierForCall:(MXCall *)call onComplete:(void (^)(NSString *c
@end

#endif
#endif
4 changes: 4 additions & 0 deletions MatrixSDK/VoIP/CallKit/MXCallKitConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
limitations under the License.
*/

#ifndef DISABLE_CALLKIT

@import Foundation;

NS_ASSUME_NONNULL_BEGIN
Expand Down Expand Up @@ -60,3 +62,5 @@ NS_ASSUME_NONNULL_BEGIN
@end

NS_ASSUME_NONNULL_END

#endif
4 changes: 4 additions & 0 deletions MatrixSDK/VoIP/CallKit/MXCallKitConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
limitations under the License.
*/

#ifndef DISABLE_CALLKIT

#import "MXCallKitConfiguration.h"

@implementation MXCallKitConfiguration
Expand Down Expand Up @@ -44,3 +46,5 @@ - (instancetype)initWithName:(NSString *)name
}

@end

#endif
5 changes: 5 additions & 0 deletions MatrixSDK/VoIP/MXCallManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
NS_ASSUME_NONNULL_BEGIN

@class MXCall;
#ifndef DISABLE_CALLKIT
@class MXCallKitAdapter;
#endif

@class MXRoom, MXRoomState;
@class MXRoomMember;
@class MXSession;
Expand Down Expand Up @@ -137,9 +140,11 @@ extern NSString *const kMXCallManagerPSTNSupportUpdated;
The CallKit adapter.
Provide it if you want to add CallKit support.
*/
#ifndef DISABLE_CALLKIT
#if TARGET_OS_IPHONE
@property (nonatomic, nullable) MXCallKitAdapter *callKitAdapter;
#endif
#endif

/**
The time in milliseconds that an incoming or outgoing call invite is valid for.
Expand Down
4 changes: 4 additions & 0 deletions MatrixSDK/VoIP/MXCallManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ - (void)handleCallRejectReplacement:(MXEvent *)event

- (void)handleCallStateDidChangeNotification:(NSNotification *)notification
{
#ifndef DISABLE_CALLKIT
#if TARGET_OS_IPHONE
MXCall *call = notification.object;

Expand All @@ -590,15 +591,18 @@ - (void)handleCallStateDidChangeNotification:(NSNotification *)notification
break;
}
#endif
#endif
}

- (void)handleCallSupportHoldingStatusDidChange:(NSNotification *)notification
{
#ifndef DISABLE_CALLKIT
#if TARGET_OS_IPHONE
MXCall *call = notification.object;

[self.callKitAdapter updateSupportsHoldingForCall:call];
#endif
#endif
}

- (void)unregisterFromNotifications
Expand Down