Skip to content
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
2 changes: 1 addition & 1 deletion RNCallKeep.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.platform = :ios, "8.0"
s.source_files = "ios/RNCallKeep/*.{h,m}"
s.dependency 'React/Core'
s.dependency 'React-Core'
end

4 changes: 2 additions & 2 deletions android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void endAllCalls() {

@ReactMethod
public void checkPhoneAccountPermission(ReadableArray optionalPermissions, Promise promise) {
Activity currentActivity = this.getCurrentActivity();
Activity currentActivity = getCurrentActivity();

if (!isConnectionServiceAvailable()) {
promise.reject(E_ACTIVITY_DOES_NOT_EXIST, "ConnectionService not available for this version of Android.");
Expand Down Expand Up @@ -464,7 +464,7 @@ private String getApplicationName(Context appContext) {
}

private Boolean hasPermissions() {
Activity currentActivity = this.getCurrentActivity();
Activity currentActivity = getCurrentActivity();

boolean hasPermissions = true;
for (String permission : permissions) {
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react-native-device-info": "^2.3.2",
"react-native-gesture-handler": "~1.3.0",
"react-native-reanimated": "~1.1.0",
"react-native-unimodules": "~0.5.2",
"react-native-unimodules": "~0.14.10",
"react-native-web": "^0.11.4",
"uuid": "^3.3.2"
},
Expand Down
1,664 changes: 1,622 additions & 42 deletions example/yarn.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export default class RNCallKeep {

}

static async hasRequiredPermissions(options: IOptions): Promise<boolean> {

}

static displayIncomingCall(
uuid: string,
handle: string,
Expand Down Expand Up @@ -159,6 +163,10 @@ export default class RNCallKeep {

}

static checkPhoneAccountPermission(): Promise<boolean> {

}

/**
* @description setAvailable method is available only on Android.
*/
Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class RNCallKeep {

return;
};

hasRequiredPermissions = async (options) => {
if(isIOS) {
return true;
}
RNCallKeepModule.setup(options);
return await this.hasPhoneAccount();
}

displayIncomingCall = (uuid, handle, localizedCallerName, handleType = 'number', hasVideo = false) => {
if (!isIOS) {
Expand Down Expand Up @@ -124,6 +132,9 @@ class RNCallKeep {
? RNCallKeepModule.checkSpeaker()
: Promise.reject('RNCallKeep.checkSpeaker was called from unsupported OS');


checkPhoneAccountPermission = async (options) => await RNCallKeepModule.checkPhoneAccountPermission(options.additionalPermissions || []);

setAvailable = (state) => {
if (isIOS) {
return;
Expand Down
13 changes: 10 additions & 3 deletions ios/RNCallKeep/RNCallKeep.m
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,15 @@ + (BOOL)application:(UIApplication *)application
// iOS 13 returns an INStartCallIntent userActivity type
if (@available(iOS 13, *)) {
INStartCallIntent *intent = (INStartCallIntent*)interaction.intent;
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
// isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
// isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
if ([intent respondsToSelector:@selector(callCapability)]) {
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
} else {
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
}
} else {
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
Expand Down Expand Up @@ -566,7 +573,7 @@ - (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAct
NSLog(@"[RNCallKeep][CXProviderDelegate][provider:performAnswerCallAction]");
#endif
[self configureAudioSession];
[self sendEventWithName:RNCallKeepPerformAnswerCallAction body:@{ @"callUUID": [action.callUUID.UUIDString lowercaseString] }];
[self sendEventWithName:RNCallKeepPerformAnswerCallAction body:@{ @"callUUID": [action.callUUID.UUIDString lowercaseString], @"isLocked": [[UIApplication sharedApplication] isProtectedDataAvailable] ? @"false" : @"true" }];
[action fulfill];
}

Expand Down