Skip to content

Commit 46a9134

Browse files
committed
Merge branch 'master' into fix-call-direction-when-ringing
2 parents 3230a3f + 7f4af49 commit 46a9134

File tree

176 files changed

+25909
-3365
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+25909
-3365
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: '🐞 Bug Report'
3+
about: Create a report
4+
title: ''
5+
labels: ['type:Bug', 'status:Unconfirmed']
6+
assignees: ''
7+
---
8+
9+
<!--
10+
Found a bug? Please fill out the sections below. 👍
11+
-->
12+
13+
### Issue Summary
14+
15+
<!--
16+
A summary of the issue.
17+
-->
18+
19+
### Steps to Reproduce
20+
21+
1.
22+
23+
Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?
24+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: '🚀 Feature request'
3+
about: Suggest an idea/concept/feature to enhance the project
4+
title: ''
5+
labels: 'type:Enhancement'
6+
assignees: ''
7+
---
8+
9+
### Is your proposal related to a problem?
10+
11+
<!--
12+
Provide a clear and concise description of what the problem is.
13+
-->
14+
15+
(Write your answer here.)
16+
17+
### Describe the solution you'd like
18+
19+
<!--
20+
Provide a clear and concise description of what you want to happen.
21+
-->
22+
23+
(Describe your proposed solution here.)
24+
25+
### Describe alternatives you've considered
26+
27+
<!--
28+
Let us know about other solutions you've tried or researched.
29+
-->
30+
31+
(Write your answer here.)
32+
33+
### Additional context
34+
35+
<!--
36+
Is there anything else you can add about the proposal?
37+
You might want to link to related issues here, if you haven't already.
38+
-->
39+
40+
(Write your answer here.)

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Description
2+
3+
Please include a summary of the change(s) and which issue(s) are to be fixed/addressed or feature(s) to be added. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
6+
## Type of change
7+
8+
Please delete options that are not relevant.
9+
10+
- [ ] Bug fix (non-breaking change which fixes an issue)
11+
- [ ] New feature (non-breaking change which adds functionality)
12+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
13+
- [ ] This change requires a documentation update
14+
15+
## Screenshots (if appropriate):

.github/workflows/flutter.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Flutter Analyze & Test (main)
7+
8+
on:
9+
push:
10+
branches: [ "master" ]
11+
pull_request:
12+
branches: [ "master" ]
13+
14+
workflow_dispatch:
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Install Flutter
25+
uses: subosito/flutter-action@v2
26+
with:
27+
flutter-version: '3.7.11'
28+
channel: 'stable'
29+
cache: true
30+
31+
- run: flutter --version
32+
33+
- name: Install dependencies
34+
run: flutter pub get
35+
36+
- name: Analyze project source
37+
run: flutter analyze
38+
39+
- name: Run tests
40+
run: flutter test --coverage

.gitignore

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
1-
.DS_Store
1+
# See https://www.dartlang.org/guides/libraries/private-files
2+
3+
# Files and directories created by pub
24
.dart_tool/
5+
.packages
6+
build/
7+
# If you're building an application, you may want to check-in your pubspec.lock
8+
pubspec.lock
9+
10+
# Directory created by dartdoc
11+
# If you don't generate documentation locally you can remove this line.
12+
doc/api/
13+
14+
# dotenv environment variables file
15+
.env*
16+
17+
# Avoid committing generated Javascript files:
18+
*.dart.js
19+
*.info.json # Produced by the --dump-info flag.
20+
*.js # When generated by dart2js. Don't specify *.js if your
21+
# project includes source files written in JavaScript.
22+
*.js_
23+
*.js.deps
24+
*.js.map
25+
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
29+
# Android Studio generated files
30+
android/.gradle/
31+
android/local.properties
32+
33+
# IDE files
334
.vscode
435
.idea
5-
.packages
6-
.pub/
736

37+
# Apple files
38+
.DS_Store
39+
40+
# Flutter/Dart/Pub related
841
build/
42+
.dart_tool/
43+
.pub/
44+
.packages
45+
46+
# Lock files
947
*.lock

.metadata

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: 60bd88df915880d23877bfc1602e8ddcf4c4dd2a
8-
channel: stable
7+
revision: f72efea43c3013323d1b95cff571f3c1caa37583
8+
channel: unknown
99

1010
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
17+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
18+
- platform: android
19+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
20+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
21+
- platform: ios
22+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
23+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
24+
- platform: macos
25+
create_revision: f72efea43c3013323d1b95cff571f3c1caa37583
26+
base_revision: f72efea43c3013323d1b95cff571f3c1caa37583
27+
28+
# User provided section
29+
30+
# List of Local paths (relative to this file) that should be
31+
# ignored by the migrate tool.
32+
#
33+
# Files that are not part of the templates will be ignored by default.
34+
unmanaged_files:
35+
- 'lib/main.dart'
36+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
## Next release
22
* Feat: [Android] Turn off the screen when a call is active and the head is against the handset. @solid-software (https://solid.software)
3+
* Feat: [macOS] Added support for macOS, based on iOS implementation backed by Twilio Voice Web (twilio-voice.js [v2.4.1-dev-custom](https://github.com/cybex-dev/twilio-voice.js/tree/2.4.1-dev-custom)).
4+
* Feat: [Web] Web support with notifications (via Service Worker) with live example at https://twilio-voice-web.web.app @cybex-dev
5+
* Feat: [Android, iOS] Add handset call status: `isMuted()`, `isOnSpeaker()` and `isHolding()` @cybex-dev
6+
* Refactor: Hold call signature changed to `holdCall({bool shouldHold = true})` @cybex-dev
7+
* Feat: [iOS] Add support for changing callkit icon (future plans to extended this for Flutter assets) @cybex-dev
8+
* [twilio_voice_mimp:0.2.5) fix 4 Null Pointer execption Android
9+
* [twilio_voice_mimp:0.2.4) add Android DE Local
10+
* [twilio_voice_mimp:0.2.4) add Android IT Local
11+
* [twilio_voice_mimp:0.2.3) Upgrade to Twilio Android SDK 6.1.2 / iOS SDK 6.4.2
12+
* [twilio_voice_mimp:0.2.3) small Bugfix for null pointer Exception
13+
* [twilio_voice_mimp:0.2.2) more Magic is needed with FLAG_MUTABLE (Android 12)
14+
* [twilio_voice_mimp:0.2.1) PendingIntent gets FLAG_UPDATE_CURRENT replaced by FLAG_IMMUTABLE (Android 12)
15+
* [twilio_voice_mimp:0.1.2) Upgrade to Twilio Android SDK 6.1.0 / iOS SDK 6.4.0
16+
* [twilio_voice_mimp:0.1.1) Fix case Constants.ACTION_ACCEPT null pointer
17+
* [twilio_voice_mimp:0.0.18) remove example / Add AudioSwitch
18+
* [twilio_voice_mimp:0.0.17) Make Android RingTone louder
19+
* [twilio_voice_mimp:0.0.16) Unknown Caller ist auch in der App sichtbar
20+
* [twilio_voice_mimp:0.0.15) Splash Icon missing
21+
* [twilio_voice_mimp:0.0.14) Compiler anhancements
22+
* [twilio_voice_mimp:0.0.13) Android CallsScreen now displays ClientID / CallerID
23+
* [twilio_voice_mimp:0.0.12) iOS XCODE failed
24+
* [twilio_voice_mimp:0.0.11) iOS Podspecs were failing
25+
* [twilio_voice_mimp:0.0.10) **German Localization in Android
26+
* ~~Feat: Add check and request Bluetooth permissions @cybex-dev~~
27+
* Feat: [Android] Use Android Native callkit equivalent via [ConnectionService](https://developer.android.com/reference/android/telecom/ConnectionService). @cybex-dev
28+
* Change: [Android] Removed (Deprecated) `requiresBackgroundPermissions` & `requestBackgroundPermissions` as they are no longer needed for background UI screens. @cybex-dev
29+
* Change: [Android] Removed (Deprecated) `showBackgroundCallUi` as it is no longer needed for background UI screens. (this might be reinstated in future, depending on feature requests) @cybex-dev
30+
* Change: [Android] Removed (Deprecated) `backgroundCallUi` as it is no longer needed for background UI screens. @cybex-dev
31+
* Change: [Android] Removed (Deprecated) `requestBluetoothPermission`, `hasBluetoothPermission` as these are no longer needed and handled by the native Telecom App. @cybex-dev
32+
* (on-hold) Feat: [Android] Added custom scheme `twi://` @cybex-dev
33+
* Feat (early-access): [Android] Added customParams interpretation via `TVCallInviteParameters` and `TVCallParameters`, see readme for more details. @cybex-dev
34+
* Feat: [Android] Add CallingAccount (Phone Account) label & description via `strings.xml`. @cybex-dev
35+
* Feat: [Android] Add Calling Account (Phone Account) icon (using current app icon via `getApplicationInfo().getIcon()`). @cybex-dev
36+
* Fix: request Permissions return result via Flutter future.
337

438
## 0.0.9
539
* Feat: forwarded callInvite custom parameters to flutter

NOTES.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
2+
# Notes
3+
4+
### Android
5+
6+
**Package Information:**
7+
> minSdkVersion: 26
8+
> compileSdkVersion: 34
9+
10+
**Gradle:**
11+
> gradle-wrapper: 8.2.1-all
12+
13+
**Permissions:**
14+
* `android.permission.FOREGROUND_SERVICE`
15+
Required for foreground services on Android 10+ including running foreground services in the background e.g. to capture microphone audio.
16+
17+
* `android.permission.RECORD_AUDIO`
18+
Grants access to the microphone for audio recording, to be used for voice calls.
19+
20+
* `android.permission.READ_PHONE_STATE`
21+
Required for reading the phone state, the phone state is the backbone permission for `ConnectionService` integration. It allows checking active calls, placing new calls, and receiving calls and call state updates. It also allows creating a `PhoneAccount` required for placing calls. If not accepted, any and all incoming calls are rejected immediately upon receiving `CallInvite`.
22+
23+
* `android.permission.READ_PHONE_NUMBERS`
24+
Required for reading phone numbers (e.g. for Telecom App), this is required to create a `PhoneAccount`, see `READ_PHONE_STATE` above.
25+
26+
* `android.permission.CALL_PHONE`
27+
Required for `ConnectionService` to interact with the `TelecomManager` to place outgoing calls.
28+
29+
#### ConnectionService integration
30+
There are a few (additional) permissions added to use the [system-managed `ConnectionService`](https://developer.android.com/reference/android/telecom/ConnectionService), several permissions are required to enable this functionality (see example app). These permissions `android.permission.READ_PHONE_STATE`, `android.permission.READ_PHONE_NUMBERS`, `android.permission.RECORD_AUDIO` and `android.permission.CALL_PHONE` have already been added to the package, you do not have to add them. Finally, a [PhoneAccount] is required to interact with the `ConnectionService`, this is discussed in more detail below.
31+
32+
33+
#### Phone Account
34+
Registering of a [PhoneAccount](https://developer.android.com/reference/android/telecom/PhoneAccount)'s are essential to the functionality. This is integrated into the plugin - however it should be noted if the `PhoneAccount` is not registered nor the `Call Account` enabled, the plugin will not function as expected. See [here](https://developer.android.com/reference/android/telecom/PhoneAccount) for more information regarding `PhoneAccount`s. Logging output will indicate whether any permissions are lacking, or missing.
35+
36+
To register a Phone Account, request access to `READ_PHONE_NUMBERS` permission first.
37+
```dart
38+
TwilioVoice.instance.requestReadPhoneNumbersPermission();
39+
```
40+
then, register the `PhoneAccount`
41+
42+
To open the `Call Account` settings, use the following code:
43+
```dart
44+
TwilioVoice.instance.openPhoneAccountSettings();
45+
```
46+
47+
alternatively, this could be found in Phone App settings -> Other/Advanced Call Settings -> Calling Accounts -> Twilio Voice (toggle switch)
48+
49+
(if there is a method to programmatically open this, please submit a PR)
50+
51+
### iOS & macOS
52+
53+
If you encounter this error
54+
> warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.XX, but the range of supported deployment target versions is 10.XY to 13.1.99. (in target 'ABCD' from project 'Pods')
55+
56+
To resolve this:
57+
- open XCode
58+
- browse to your Pods project (left `Project Navigator` drawer, select `Pods` project (there is `Pods` or `Runner`, expand and select `Pods` folder)
59+
- for each pod with the above issue, select the `pod` > then select the `General` tab > and set `Minimum Deployments` to the value to e.g. `10.15` (or whatever the latest version is that you're using in your main project).
60+
61+
You may also add this to your `Podfile` to ensure you don't do this each time:
62+
```
63+
post_install do |installer|
64+
installer.pods_project.targets.each do |target|
65+
flutter_additional_macos_build_settings(target)
66+
67+
# Add from here
68+
target.build_configurations.each do |config|
69+
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.15' # or whatever version you're using
70+
end
71+
# to here
72+
73+
end
74+
end
75+
```
76+
77+
## Limitations
78+
79+
### macOS
80+
81+
Clearly, macOS isn't uppermost in mind when looking at a mobile first platform like Flutter. There are some functionality limitations for the platform/interop such as [UIImage](https://docs.flutter.dev/ui/assets-and-images#loading-ios-images-in-flutter) support and Twilio Voice library support as a whole. Hopefully we'll be seeing these implemented in future.

0 commit comments

Comments
 (0)