cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
39 stars 80 forks source link

Cannot receive incoming calls #251

Open rhowelp opened 1 week ago

rhowelp commented 1 week ago

I integrate this twilio voice in my app but it seems that I can't receive any phone call so I decided to test the one from your example in web and it works and then I copied the example files from the twilio voice repo but it is also not working.

I hope I could make this work. Thanks!

I already added this permissions

    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/> 

Here is my flutter doctor

[√] Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22631.3958], locale en-PH)
    • Flutter version 3.19.1 on channel stable at C:\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abb292a07e (7 months ago), 2024-02-20 14:35:05 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\MSIpc\AppData\Local\Android\sdk
    • Platform android-34-ext8, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.34)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.34601.136
    • Windows 10 SDK version 10.0.19041.0
    X The current Visual Studio installation is incomplete.
      Please use Visual Studio Installer to complete the installation or reinstall Visual Studio.

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code (version 1.92.2)
    • VS Code at C:\Users\MSIpc\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.96.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3958]    
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 128.0.6613.85
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 128.0.2739.54

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Here is the complete log

Connecting to VM Service at ws://127.0.0.1:61608/rt_M6KYJmUU=/ws
D/ProfileInstaller( 7910): Installing profile for com.tinsel.app
D/CompatibilityChangeReporter( 7910): Compat change id reported: 3400644; UID 10202; state: ENABLED
I/m.tinsel.app( 7910): Compiler allocated 4627KB to compile void android.view.ViewRootImpl.performTraversals()
I/TwilioVoicePlugin( 7910): Setting event sink
I/flutter ( 7910): voip-service registration
I/flutter ( 7910): voip-registering with environment variables
I/flutter ( 7910): Failed to register with environment variables, please provide ID and TOKEN
D/TwilioVoicePlugin( 7910): logEvent: LOG|Registering client alicesId:Alice
I/flutter ( 7910): Registering client alicesId:Alice
I/flutter ( 7910): voip-onCallStateChanged CallEvent.log
I/ImeTracker( 7910): com.tinsel.app:1f052eb: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
D/InputMethodManager( 7910): showSoftInput() view=io.flutter.embedding.android.FlutterView{b371b58 VFE...... .F....ID 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor( 7910): The input method toggled cursor monitoring on
D/InsetsController( 7910): show(ime(), fromIme=true)
D/EGL_emulation( 7910): app_time_stats: avg=9147.73ms min=1053.31ms max=17242.14ms count=2
D/EGL_emulation( 7910): app_time_stats: avg=1692.01ms min=4.31ms max=17656.80ms count=11
I/ImeTracker( 7910): com.tinsel.app:1f052eb: onShown
I/ImeTracker( 7910): com.tinsel.app:88a10fcf: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
D/InputMethodManager( 7910): showSoftInput() view=io.flutter.embedding.android.FlutterView{b371b58 VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 7910): show(ime(), fromIme=true)
I/ImeTracker( 7910): com.tinsel.app:88a10fcf: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
D/EGL_emulation( 7910): app_time_stats: avg=286.04ms min=45.55ms max=518.70ms count=4
D/EGL_emulation( 7910): app_time_stats: avg=493.26ms min=477.02ms max=515.35ms count=3
D/EGL_emulation( 7910): app_time_stats: avg=499.33ms min=496.30ms max=501.32ms count=3
D/EGL_emulation( 7910): app_time_stats: avg=499.58ms min=484.20ms max=514.28ms count=3
I/ImeTracker( 7910): com.tinsel.app:246e4896: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
D/InputMethodManager( 7910): showSoftInput() view=io.flutter.embedding.android.FlutterView{b371b58 VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor( 7910): The input method toggled cursor monitoring on
D/InsetsController( 7910): show(ime(), fromIme=true)
I/ImeTracker( 7910): com.tinsel.app:246e4896: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/ImeTracker( 7910): com.tinsel.app:f07ee8be: onRequestShow at ORIGIN_CLIENT_SHOW_SOFT_INPUT reason SHOW_SOFT_INPUT
D/InputMethodManager( 7910): showSoftInput() view=io.flutter.embedding.android.FlutterView{b371b58 VFE...... .F...... 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 7910): show(ime(), fromIme=true)
I/ImeTracker( 7910): com.tinsel.app:f07ee8be: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
D/EGL_emulation( 7910): app_time_stats: avg=123.17ms min=4.95ms max=492.69ms count=11
I/ImeTracker( 7910): com.tinsel.app:e69e758d: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT
W/WindowOnBackDispatcher( 7910): sendCancelIfRunning: isInProgress=falsecallback=ImeCallback=ImeOnBackInvokedCallback@125608264 Callback=android.window.IOnBackInvokedCallback$Stub$Proxy@302696e
D/EGL_emulation( 7910): app_time_stats: avg=560.50ms min=1.52ms max=8260.08ms count=15
D/EGL_emulation( 7910): app_time_stats: avg=120.24ms min=3.38ms max=516.85ms count=11
I/ImeTracker( 7910): com.tinsel.app:b28fe682: onRequestHide at ORIGIN_CLIENT_HIDE_SOFT_INPUT reason HIDE_SOFT_INPUT_BY_INSETS_API
I/ImeTracker( 7910): com.tinsel.app:e69e758d: onHidden
I/flutter ( 7910): voip-registering access token
I/flutter ( 7910): androidToken is fvW9BCU-TwOt0yV5LhVNJT:APA91bEZCRy_TD1aDlguNN_8YmkJ0UK57lGq7BTCT7unayb0OffzTyh-UHEHJlrzgf6vAifyo_T5zHlnBTBuNw2ZMyv9cT0rX_r9h0WXKx78D6lU7Q66Hd2UXkh7Xfezxcti7bDV2Pk0
D/EGL_emulation( 7910): app_time_stats: avg=916.72ms min=2.14ms max=18163.61ms count=20
D/TwilioVoicePlugin( 7910): Setting up token
D/TwilioVoicePlugin( 7910): Registering for call events
D/TwilioVoicePlugin( 7910): isMuted invoked
D/TwilioVoicePlugin( 7910): isHolding call invoked
D/TwilioVoicePlugin( 7910): isSpeakerOn invoked
D/TwilioVoicePlugin( 7910): isBluetoothOn invoked
D/TrafficStats( 7910): tagSocket(155) with statsTag=0x3e8, statsUid=-1
D/TwilioVoicePlugin( 7910): checkMicrophonePermission
D/TwilioVoicePlugin( 7910): checkReadPhoneStatePermission
D/TwilioVoicePlugin( 7910): checkReadPhoneNumbersPermission
D/TwilioVoicePlugin( 7910): checkCallPhonePermission
D/TwilioVoicePlugin( 7910): checkManageOwnCallsPermission
D/TwilioVoicePlugin( 7910): logEvent: LOG|hasRegisteredPhoneAccount
D/TwilioVoiceConnectionService( 7910): getPhoneAccountHandle: Get PhoneAccountHandle with name: Tinsel, componentName: ComponentInfo{com.tinsel.app/com.twilio.twilio_voice.service.TVConnectionService}
D/TwilioVoicePlugin( 7910): logEvent: LOG|isPhoneAccountEnabled
D/TwilioVoiceConnectionService( 7910): getPhoneAccountHandle: Get PhoneAccountHandle with name: Tinsel, componentName: ComponentInfo{com.tinsel.app/com.twilio.twilio_voice.service.TVConnectionService}
I/flutter ( 7910): hasRegisteredPhoneAccount
I/flutter ( 7910): voip-onCallStateChanged CallEvent.log
3 I/flutter ( 7910): hasRegisteredPhoneAccount
I/flutter ( 7910): isPhoneAccountEnabled
I/flutter ( 7910): voip-onCallStateChanged CallEvent.log
3 I/flutter ( 7910): isPhoneAccountEnabled
D/TwilioVoicePlugin( 7910): Successfully registered FCM fvW9BCU-TwOt0yV5LhVNJT:APA91bEZCRy_TD1aDlguNN_8YmkJ0UK57lGq7BTCT7unayb0OffzTyh-UHEHJlrzgf6vAifyo_T5zHlnBTBuNw2ZMyv9cT0rX_r9h0WXKx78D6lU7Q66Hd2UXkh7Xfezxcti7bDV2Pk0
D/TrafficStats( 7910): tagSocket(163) with statsTag=0x3e8, statsUid=-1
D/EGL_emulation( 7910): app_time_stats: avg=572.25ms min=5.98ms max=5664.92ms count=11
D/EGL_emulation( 7910): app_time_stats: avg=613.57ms min=13.54ms max=32753.16ms count=55
rhowelp commented 1 week ago

Hello can I follow up on this?

I also tested the example file and run it on web, and it works. I was able to receive the call and accept it but I can't make it work on Android, can't receive incoming calls.