Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hiennguyen92/flutter_callkit_inco…
Browse files Browse the repository at this point in the history
…ming

# Conflicts:
#	PUSHKIT.md
  • Loading branch information
hiennguyen92 committed Feb 21, 2022
2 parents a6e0e5e + 5595580 commit ebe1e7d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.0.1+1

* Switch using Service for Ringtone(Android)
* Fixed issue vibration(Android)
* Add `getDevicePushTokenVoIP()` feature
* Fixed some bugs.

## 1.0.1

* Pustkit and VoIP setup instructions (PUSHKIT.md)
Expand Down
3 changes: 2 additions & 1 deletion PUSHKIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ If you are making VoIP application than you definitely want to update your appli
## 🚀  Setup


Make sure when you create Bundle ID(https://developer.apple.com/account/resources/identifiers) for you have checked `Push Notifications`
Make sure when you create Bundle ID(https://developer.apple.com/account/resources/identifiers) for app you have checked `Push Notifications`


1. Enable Voice over IP Setting
* Xcode Project > Capabilities
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A Flutter plugin to show incoming call in your Flutter app(Custom for Android/Ca
* Show an incoming call
* Start an outgoing call
* Custom UI Android/Callkit for iOS
* Example using Pushkit/VoIP for iOS

<br>

Expand Down Expand Up @@ -219,6 +220,7 @@ A Flutter plugin to show incoming call in your Flutter app(Custom for Android/Ca
let data = flutter_callkit_incoming.Data(id: "44d915e1-5ff4-4bed-bf13-c423048ec97a", nameCaller: "Hien Nguyen", handle: "0123456789", type: 0)
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.showCallkitIncoming(data, fromPushKit: true)
```
<br>

```objc
//Objective-C
Expand All @@ -232,12 +234,12 @@ A Flutter plugin to show incoming call in your Flutter app(Custom for Android/Ca
Data * data = [[Data alloc]initWithId:@"44d915e1-5ff4-4bed-bf13-c423048ec97a" nameCaller:@"Hien Nguyen" handle:@"0123456789" type:1];
[SwiftFlutterCallkitIncomingPlugin.sharedInstance showCallkitIncoming:data fromPushKit:YES];
```
<br>

```java
//send custom event from native
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.sendEventCustom("customEvent", body: ["customKey": "customValue"])


```

4. Properties
Expand Down
14 changes: 8 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ class _MyAppState extends State<MyApp> {
initCurrentCall();
}


initCurrentCall() async {
//check current call from pushkit if possible
var calls = await FlutterCallkitIncoming.activeCalls();
if(calls is List && calls.isNotEmpty){
if (calls is List && calls.isNotEmpty) {
this._currentUuid = calls[0]['id'];
}
}
Expand Down Expand Up @@ -79,6 +78,7 @@ class _MyAppState extends State<MyApp> {
break;
case CallEvent.ACTION_CALL_TOGGLE_AUDIO_SESSION:
// TODO: only iOS
break;
case CallEvent.ACTION_DID_UPDATE_DEVICE_PUSH_TOKEN_VOIP:
// TODO: only iOS
break;
Expand Down Expand Up @@ -140,7 +140,6 @@ class _MyAppState extends State<MyApp> {
),
onPressed: () async {
this.endAllCalls();
this.getDevicePushTokenVoIP();
},
)
],
Expand Down Expand Up @@ -173,7 +172,10 @@ class _MyAppState extends State<MyApp> {
'type': 0,
'duration': 30000,
'extra': <String, dynamic>{'userId': '1a2b3c4d'},
'headers': <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'},
'headers': <String, dynamic>{
'apiKey': 'Abc@123!',
'platform': 'flutter'
},
'android': <String, dynamic>{
'isCustomNotification': true,
'isShowLogo': false,
Expand Down Expand Up @@ -232,8 +234,8 @@ class _MyAppState extends State<MyApp> {
}

Future<void> getDevicePushTokenVoIP() async {
var devicePushTokenVoIP = await FlutterCallkitIncoming.getDevicePushTokenVoIP();
var devicePushTokenVoIP =
await FlutterCallkitIncoming.getDevicePushTokenVoIP();
print(devicePushTokenVoIP);
}

}
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.1"
version: "1.0.1+1"
flutter_test:
dependency: "direct dev"
description: 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: flutter_callkit_incoming
description: Flutter Callkit Incoming to show callkit screen in your Flutter app.
version: 1.0.1
version: 1.0.1+1
homepage: https://github.com/hiennguyen92/flutter_callkit_incoming

environment:
Expand Down

0 comments on commit ebe1e7d

Please sign in to comment.