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

feat: show video call for push notification #30

Merged
merged 8 commits into from
Nov 30, 2021

Conversation

yingtao-butterflymx
Copy link
Contributor

No description provided.

add CallNotificationTypeManager
add CallNotificationType setting UI
refactor AccountTableViewController
unregister webhooks when changing call notification type.
save apns device token with the key "apnsDeviceToken"

func endCurrentCall() {
if CallNotificationTypeManager.shared.getCurrentCallNotificationType() == .videoCall {
endCurrentCallKitCall()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can call this in the SDK's callback function "callEnded"? So based on usingCallKit we could decide to hide uikit or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callEnded happens after endCurrentCall()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, ok, so you end call kit call and it's delegate will call BMXCallKit.shared.endCall(), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@@ -185,5 +233,57 @@ extension CallsService: PKPushRegistryDelegate, CXProviderDelegate {
func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
BMXCallKit.shared.disconnectSoundDevice()
}

func rejectCallForPushNotification(userInfo: [AnyHashable: Any]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when do you call it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently when app is in the foreground, the video call will begin automatically if an initial call push notification comes. I wanted to add some simple UI to give users a selection to accept or reject the call, so I added this function. Later I thought it was just a demo app, maybe I don't need to provide this selection. So I didn't add the selection but forgot deleting the function.
What do yo think about it?
Do you think we should provide a selection for users in this scenario?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can have a reject button, but would you need to call BMXCallKit.shared.processCall to reject it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I need to get a correct incomingCallProcessor because BMXCallKit.shared.endCall calls processor?.endCall(guid: callId)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, that is not obvious and I think can confuse a SDK user, maybe process call should be inside BMXCallKit.shared.endCall then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. I will make changes inside BMXCallKit.shared.endCall then.

Copy link
Contributor Author

@yingtao-butterflymx yingtao-butterflymx Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sviatoslavbmx I talked with Yurii and ended up adding a preview call UI for push notification with answer button and reject button, but I don't need rejectCallForPushNotification any more because I will directly use CallsService.shared.endCurrentCall()

rename video to voip for CallNotificationType
remove rejectCallForPushNotification
@yingtao-butterflymx yingtao-butterflymx requested review from 4taras4 and sviatoslavbmx and removed request for sbelmeha November 25, 2021 05:19
@yingtao-butterflymx yingtao-butterflymx merged commit 3c43c77 into develop Nov 30, 2021
@yingtao-butterflymx yingtao-butterflymx deleted the feature/NT-637 branch November 30, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants