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

Various fixes and improvements #3

Merged
merged 1 commit into from Sep 1, 2021

Conversation

defano
Copy link

@defano defano commented Aug 31, 2021

Hi @Alezhka ,

Awesome plugin—nice work on this! I'd been waiting for a while for someone to write this and I'm glad you did! I've integrated it into my own project and ran into a few issues—some bugs, others required extensions. I've included all those changes in this PR. I'm happy to tweak as you prefer.

  • FIXED: Incoming call screen was not being shown on my Android device when the phone’s screen was off. Incoming call activity requires the USE_FULL_SCREEN_INTENT permission to be declared in the AndroidManifest on newer versions of Android.
  • FIXED: Supplying a missing or incorrect iconName in the ConfigIOS object would prevent the incoming call notification from being displayed on iOS devices. Added some nil-checking to display a warning message instead of failing.
  • FIXED: An accepted call on iOS gets killed after duration, even if the call was accepted by the user. Corrected the timeout logic to end the call only if it isn’t being attended.
  • FIXED: Incoming MuteEvent and DMTFEvent events were not being dispatched. I corrected a copy-and-paste bug in the switch statement responsible for creating those events.
  • NOT FIXED: The Dart model DMTFEvent is misspelled; it should be DTMFEvent.
  • FIXED: The mute property on MuteEvent was always null. I fixed the name of the Map key used to populate it (was mute, but should be muted).
  • NOT FIXED: I’m not enough of an Android guy to know what’s right here, but in the README example, I had to change android:theme="@style/AppCompatTheme” to android:theme="@style/Theme.AppCompat" in order to get the call notification to be displayed. Perhaps others will run into this, too…?
  • IMPROVED: I needed a way to disable the “Keypad”, “Add Call” and “FaceTime” buttons on the iOS call screen. I added a new API (displayIncomingCallAdvanced) that offers several new named parameters for controlling this on iOS: supportsDTMF, supportsHolding, supportsGrouping and supportsUngrouping. I also changed the handle and handleType attributes to be nullable for cases where a handle is not desired (which has the effect of disabling the “FaceTime” button).
  • IMPROVED: I needed a way to prevent this plugin from changing my application’s existing AVAudioSession configuration (iOS). I suspect most applications that use this plugin will also be controlling their AVAudioSession elsewhere and will need fine-grained control over what attributes (if any) should be configured by flutter_incoming_call. To that extent, I added new boolean ConfigIOS attributes: avSessionSetCategory, avSessionSetMode, avSessionSetPreferredSampleRate, avSessionSetPreferredIOBufferDuration and avSessionSetActive. By default, all are true (current behavior), but client applications can enable/disable which parameters are set. (My application needs avSessionSetMode to be called, but none of the others, in order to function correctly).
  • IMPROVED: IDE directories were checked into source control (some containing files referencing paths local to your computer). I removed and .gitignore’d the Android Studio directories (.idea) … but perhaps having them checked in was intentional? Some folks swear by this practice. :)

@Alezhka Alezhka merged commit 637bda1 into Alezhka:master Sep 1, 2021
@Alezhka
Copy link
Owner

Alezhka commented Sep 1, 2021

Hi, great respect for the work you've done! Silly mistakes, but very important!

I started writing a plugin for my experimental project, but the project was closed and there is not as much time left for plugin development as I would like. I spent a lot of time looking for a ready-made solution and not finding one, I decided to make a core implementation of the functionality of receiving calls.

Regarding the configuration of IOS. There was a desire to bring more parameters into the config, but my hands did not reach them.

I will try to find time to continue working on the library!

Thanks again! 🙏

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