flutter-webrtc / callkeep

iOS CallKit and Android ConnectionService for Flutter
MIT License
133 stars 147 forks source link

type 'Null' is not a subtype of type 'List<String>' in type cast #132

Closed Rizardomon closed 2 years ago

Rizardomon commented 2 years ago

I am trying to get the user permissions through the callkeep.setup() function, but it gives me this error when trying to execute the function. I call the required permissions first and make sure they are accepted, but it still gives me the error. I am using flutter 2.2.0 with null safety.

image

image

yg271828 commented 2 years ago

workaround, that works for me: add

'additionalPermissions': ['']

in 'android' section

yg271828 commented 2 years ago

android section in your calkeep setup:

final _callSetup = <String, dynamic>{
    'ios': {
      'appName': 'My app',
    },
    'android': {
      'alertTitle': 'Permissions required',
      'alertDescription':
          'This application needs to access your phone accounts',
      'cancelButton': 'Cancel',
      'okButton': 'ok',
      // Required to get audio in background when using Android 11
      'foregroundService': {
        'channelId': com.company.my',
        'channelName': 'Foreground service for my app',
        'notificationTitle': 'My app is running on background',
        'notificationIcon': 'mipmap/ic_notification_launcher',
      },
      'additionalPermissions': [''],
    },
  };
Rizardomon commented 2 years ago

Thanks man, i tried here and works just fine!!