项目作者: Alezhka

项目描述 :
Flutter incoming call
高级语言: Kotlin
项目地址: git://github.com/Alezhka/flutter_incoming_call.git
创建时间: 2020-09-21T19:46:17Z
项目社区:https://github.com/Alezhka/flutter_incoming_call

开源协议:GNU General Public License v3.0

下载


flutter_incoming_call

A Flutter plugin to show incoming call in your Flutter app! Alpha version(not ready for production!)

Usage

To use this plugin:

  1. Configure android project:
    Just add to your manifest activity and receiver.
    ```xml@style/Theme.AppCompat" android:screenOrientation="portrait" android:showOnLockScreen="true">




  1. 2. Configure Flutter plugin:
  2. ```dart
  3. FlutterIncomingCall.configure(
  4. appName: 'example_incoming_call',
  5. duration: 30000,
  6. android: ConfigAndroid(
  7. vibration: true,
  8. ringtonePath: 'default',
  9. channelId: 'calls',
  10. channelName: 'Calls channel name',
  11. channelDescription: 'Calls channel description',
  12. ),
  13. ios: ConfigIOS(
  14. iconName: 'AppIcon40x40',
  15. ringtonePath: null,
  16. includesCallsInRecents: false,
  17. supportsVideo: true,
  18. maximumCallGroups: 2,
  19. maximumCallsPerCallGroup: 1,
  20. )
  21. )
  1. Listen events:
    1. FlutterIncomingCall.onEvent.listen((event) {
    2. if(event is CallEvent) { // Android | IOS
    3. } else if(event is HoldEvent) { // IOS
    4. } else if(event is MuteEvent) { // IOS
    5. } else if(event is DmtfEvent) { // IOS
    6. } else if(event is AudioSessionEvent) { // IOS
    7. }
    8. });
  2. Call api:
    1. FlutterIncomingCall.displayIncomingCall(String uid, String name, String avatar, String handle, String type, bool isVideo);
    2. FlutterIncomingCall.endCall(String uuid);
    3. FlutterIncomingCall.endAllCalls();

Demo

ios ios (Lockscreen) Android Android (Lockscreen)

Example

Check out the example in the example project folder for a working example.