Skip to content

Commit

Permalink
- release 2.1.0;
Browse files Browse the repository at this point in the history
  • Loading branch information
TatankaConCube committed Sep 2, 2022
1 parent f115f3f commit 0186111
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.0

- (Android) Add the possibility of setting a Notification icon;

## 2.0.9

- (iOS) Fix getting call state;
Expand Down
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# ConnectyCube Flutter Call Kit plugin

A Flutter plugin for displaying call screen when the app is in the background or terminated.
It provides a complex solution for implementation the background calls feature in your app including getting token and displaying the Incoming call screen.
It provides a complex solution for implementation the background calls feature in your app including
getting token and displaying the Incoming call screen.

## Supported platforms

Expand All @@ -26,7 +27,8 @@ It provides a complex solution for implementation the background calls feature i

## Configure your project

This plugin doesn't require complicated configs, just [connect it](https://pub.dev/packages/connectycube_flutter_call_kit/install) as usual flutter plugin to your app and do the next simple actions:
This plugin doesn't require complicated configs, just [connect it](https://pub.dev/packages/connectycube_flutter_call_kit/install)
as usual flutter plugin to your app and do the next simple actions:

### Prepare Android

Expand Down Expand Up @@ -70,10 +72,16 @@ ConnectycubeFlutterCallKit.onTokenRefreshed = (token) {
};
```
### Customize the plugin
We added a helpful method for customization the plugin according to your needs. At this moment you can customize the ringtone, icon, and color accent. Use the next method for it:
We added a helpful method for customization the plugin according to your needs. At this moment you
can customize the ringtone, application icon, noitification small icon (Android only)
and notification accent color (Android only). Use the next method for it:

```dart
ConnectycubeFlutterCallKit.instance.updateConfig(ringtone: 'custom_ringtone', icon: 'app_icon', color: '#07711e');
ConnectycubeFlutterCallKit.instance.updateConfig(
ringtone: 'custom_ringtone',
icon: 'app_icon',
notificationIcon: 'ic_notification',
color: '#07711e');
```

### Show Incoming call notification
Expand Down Expand Up @@ -119,7 +127,8 @@ ConnectycubeFlutterCallKit.onCallRejectedWhenTerminated = onCallRejectedWhenTerm
ConnectycubeFlutterCallKit.onCallAcceptedWhenTerminated = onCallAcceptedWhenTerminated;
```

!> Attention: the functions `onCallRejectedWhenTerminated` and `onCallAcceptedWhenTerminated` must be a top-level function and cannot be anonymous
!> Attention: the functions `onCallRejectedWhenTerminated` and `onCallAcceptedWhenTerminated` must
be a top-level function and cannot be anonymous

### Get the call state

Expand All @@ -145,7 +154,8 @@ Then you can get the state of this call using `getCallState`.

### Notify the plugin about processing the call on the Flutter app side

For dismissing the Incoming call screen (or the Call Kit for iOS) you should notify the plugin about these events.
For dismissing the Incoming call screen (or the Call Kit for iOS) you should notify the plugin about
these events.
Use next functions for it:

```dart
Expand All @@ -154,15 +164,17 @@ ConnectycubeFlutterCallKit.reportCallEnded(sessionId: uuid);
```

### Clear call data
After finishing the call you can clear all data on the plugin side related to this call, call the next code for it
After finishing the call you can clear all data on the plugin side related to this call, call the
next code for it

```dart
await ConnectycubeFlutterCallKit.clearCallData(sessionId: sessionId);
```

### Manage the app visibility on the lock screen (Android only)

In case you need to show your app after accepting the call from the lock screen you can do it using the method
In case you need to show your app after accepting the call from the lock screen you can do it using
the method
```dart
ConnectycubeFlutterCallKit.setOnLockScreenVisibility(isVisible: true);
```
Expand All @@ -173,7 +185,8 @@ ConnectycubeFlutterCallKit.setOnLockScreenVisibility(isVisible: false);
```

## Show Incoming call screen by push notification
In case you want to display the Incoming call screen automatically by push notification you can do it easily. For it, the caller should send the push notification to all call members. This push notification should contain some required parameters. If you use the [Connectycube Flutter SDK](https://pub.dev/packages/connectycube_sdk), you can do it using the next code:
In case you want to display the Incoming call screen automatically by push notification you can do
it easily. For it, the caller should send the push notification to all call members. This push notification should contain some required parameters. If you use the [Connectycube Flutter SDK](https://pub.dev/packages/connectycube_sdk), you can do it using the next code:

```dart
CreateEventParams params = CreateEventParams();
Expand All @@ -199,6 +212,7 @@ createEvent(params.getEventForRequest()).then((cubeEvent) {
});
```

For hiding the Incoming call screen via push notification use a similar request but with a different `signal_type`, it can be `'endCall'` or `'rejectCall'`.
For hiding the Incoming call screen via push notification use a similar request but with a
different `signal_type`, it can be `'endCall'` or `'rejectCall'`.

You can check how this plugin works in our [P2P Calls code sample](https://github.com/ConnectyCube/connectycube-flutter-samples/tree/master/p2p_call_sample).
2 changes: 1 addition & 1 deletion ios/connectycube_flutter_call_kit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'connectycube_flutter_call_kit'
s.version = '2.0.9'
s.version = '2.1.0'
s.summary = 'Connectycube Call Kit plugin for flutter.'
s.description = <<-DESC
Connectycube Call Kit plugin for flutter.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: connectycube_flutter_call_kit
description: A Flutter plugin for displaying call screen when app in background or terminated.
version: 2.0.9
version: 2.1.0
homepage: https://github.com/ConnectyCube/connectycube-flutter-call-kit
issue_tracker: https://github.com/ConnectyCube/connectycube-flutter-call-kit/issues

Expand Down

0 comments on commit 0186111

Please sign in to comment.