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/v4 Twilio iOS v5 #138

Closed
wants to merge 7 commits into from
Closed

Feat/v4 Twilio iOS v5 #138

wants to merge 7 commits into from

Conversation

lonnylot
Copy link
Contributor

@lonnylot lonnylot commented Dec 28, 2019

Upgrading to use Twilio 5.x iOS SDK.

This is an important update as the Twilio iOS 2.x SDK is unsupported as of January 1st 2020 and they recommend using the iOS 5.x SDK for incoming calls on iOS >= 13.x.

I am not an iOS dev. and I am giving this my best shot. I believe there are bugs, but I wanted to get it out publicly to ask for help from anyone who knows iOS/Objective-C.

EDIT: Here are some links related to the breaking changes:

  1. https://support.twilio.com/hc/en-us/articles/360035005593-iOS-13-Breaking-Changes
  2. iOS 13 Apps built on Xcode 11 may terminate your app when TVOCancelledCallInvite is received twilio/voice-quickstart-ios#251

@lonnylot lonnylot changed the base branch from master to feat/v4 December 28, 2019 19:14
@lonnylot lonnylot changed the title Feat/v4 Twilio ios v5 Feat/v4 Twilio iOS v5 Dec 28, 2019
@enaluz
Copy link
Contributor

enaluz commented Dec 28, 2019

Great work! I was just getting started on this on my own, but glad to see someone made some headway already.

After some initial testing on my app, it seems that when the call is ended on either end of the call, the call isn't terminated for the other party. Perhaps a bug with the performEndCallAction method on line 543? Will try to investigate further.

@lonnylot
Copy link
Contributor Author

lonnylot commented Dec 29, 2019 via email

@lonnylot
Copy link
Contributor Author

lonnylot commented Dec 29, 2019 via email

@enaluz
Copy link
Contributor

enaluz commented Dec 29, 2019

That fix resolved the issue! The only small issue I found was that at the top of performEndCallActionWithUUID, there used to be a conditional check for the uuid that would just return if uuid == nil. An exception would be raised at the JS layer because that check was removed in your changes, however it wouldn't crash the app.

Not sure how important the uuid is (and in what situations it would be important), but my app is taking calls successfully without having the uuid set. Other than that, everything seems to check out in dev for me.

Would appreciate it if anybody else could do more testing for their use cases and report back!

@lonnylot
Copy link
Contributor Author

Fixes #89

Copy link
Collaborator

@fabriziomoscon fabriziomoscon left a comment

Choose a reason for hiding this comment

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

Just a couple of clarifications.
I will need to test it on iOS before merging into master.

@enaluz
Copy link
Contributor

enaluz commented Jan 2, 2020

After playing around with this a bit, I found a bug when doing back to back calls. The second call doesn't terminate for the callee when the caller terminates the call. In the second call, two logs are missing that showed up during the first call: provider:performEndCallAction and provider:didDeactivateAudioSession. Seems like an easy fix, will try to fix this on my end today or tomorrow.

@enaluz
Copy link
Contributor

enaluz commented Jan 3, 2020

The bug I described above was introduced in part, because of self.userInitiatedDisconnect = YES; in line 121 of RNTwilioVoice.m. This change broke for me because in the JS layer I was executing the disconnect method under the connectionDidDisconnect event listener (I don't use a CallUI in my app, I just use the CallKit UI). Although removing the disconnect method in the JS layer would make this PR work for me, I believe this could still break for other people. Not sure what the best move if that is the case.

Thoughts @fabriziomoscon @gitstud ?

Happy to clarify if this was a vague or confusing explanation.

@fabriziomoscon
Copy link
Collaborator

I will try to verify this and help during the weekend. Unfortunately my app conversion to RN 0.61 is taking forever, but once I am in a position to make and receive calls I will help 100% with implantation

@lonnylot
Copy link
Contributor Author

lonnylot commented Jan 3, 2020

@enaluz May I ask why you're calling the disconnect method from the connectionDidDisconnect event?

Also, could you please provide the NSLogs so we can see what code path is being taken? I suspect it's from activeCall or activeCallInvites not being cleared at the appropriate time.

@lonnylot
Copy link
Contributor Author

lonnylot commented Jan 7, 2020

I finally finished my dialer yesterday and was able to test all of the events.

@fabriziomoscon what can I do to help get this committed so we can continue to bug fix and add helpful features to this library?

Copy link
Collaborator

@fabriziomoscon fabriziomoscon left a comment

Choose a reason for hiding this comment

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

Hi, this is a very long PR. It is impossible to merge without me properly testing manually. Also because this library doesn't have tests :/
The fact that you changed some variable names, formatting and swapped lines, probably makes a lot of sense, but unfortunately it makes it tricky to complete a review.

Could I ask you to squash all commits into one and stock to the original formatting and variable names?
A future commit where you can for variable names and formatting should be sent separately.

@lonnylot
Copy link
Contributor Author

lonnylot commented Jan 8, 2020

Yeah, that's fare. Sorry about that - the initial implementation was just me copying the updated Twilio QuickStart, which is probably the wrong way to do it.

I'll update it again with just the changes required for updating to the new version of the iOS SDK.

bobiechen-twilio pushed a commit to twilio/voice-quickstart-objc that referenced this pull request Jan 14, 2020
* Correctly find callInvite to cancel

I'm a novice at iOS development, but in my attempt to copy this QuickStart implementation into hoxfon/react-native-twilio-programmable-voice#138 I needed to make this change to get the cancel to work correctly.

I wanted to share this change with you, but I have not tested it in this repo myself. Please confirm and merge if it is an issue.

* Updated key name to uuid
@fabriziomoscon
Copy link
Collaborator

This was automatically closed by me deleting the base branch feature/android-skd-4.
The new base branch is: #144

Please do not remove https://github.com/lonnylot/react-native-twilio-programmable-voice/tree/feat/v4-ios-v5 as I will include it into #144

@fabriziomoscon fabriziomoscon mentioned this pull request Jan 18, 2020
22 tasks
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.

3 participants