Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when do await FlutterCallkitIncoming.activeCalls(); #132

Closed
dkramorov opened this issue May 28, 2022 · 25 comments · Fixed by #142
Closed

Error when do await FlutterCallkitIncoming.activeCalls(); #132

dkramorov opened this issue May 28, 2022 · 25 comments · Fixed by #142

Comments

@dkramorov
Copy link

E/flutter (31530): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(error, Unsupported value: 'Data(args={})' of type 'class com.hiennv.flutter_callkit_incoming.Data', , null)
E/flutter (31530): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (31530): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (31530):
E/flutter (31530): #2 FlutterCallkitIncoming.activeCalls (package:flutter_callkit_incoming/flutter_callkit_incoming.dart:72:12)
E/flutter (31530):
E/flutter (31530): #3 SIPUAManager.checkCurrentCall (package:calleriha/sip_ua/sip_ua_manager.dart:211:17)
E/flutter (31530):
E/flutter (31530): #4 _MyCallScreenWidget._buildActionButtons. (package:calleriha/sip_ua/callscreen.dart:409:41)
E/flutter (31530):
E/flutter (31530):

@faizanMayo786
Copy link

This error is caused when you are not connected to internet. Check your internet connectino and try again:
As it is mentioned in the link Given: here

@VijaiCPrasad
Copy link

This error is caused when you are not connected to internet. Check your internet connectino and try again: As it is mentioned in the link Given: here

This error is not caused because of lack of connectivity. I face this too in android. Also, there is nothing common between the link you provided and the log in this issue except that both are "PlatformException".

@faizanMayo786
Copy link

Ok I am sorry for this I will look into it again

@PaulBout1
Copy link
Contributor

PaulBout1 commented May 30, 2022

Same error with version ^1.0.2+1 I'm downgrading to ^1.0.1+6

@wahabsohail
Copy link

I am also facing the same issue. flutter_callkit_incoming: ^1.0.2+1
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, Unsupported value: 'Data(args={})' of type 'class com.hiennv.flutter_callkit_incoming.Data', , null)

@VijaiCPrasad
Copy link

Same error with version ^1.0.2+1 I'm downgrading to ^1.0.1+6

1.0.1+6 works for you?

@zionnite
Copy link

this error has nothing to do with internet connectivity,
downgrading does not work as well

@hiennguyen92 please whats the way forward on this?

@PaulBout1
Copy link
Contributor

PaulBout1 commented May 31, 2022

try that fork : https://github.com/PaulBout1/flutter_callkit_incoming.git
it works for me

@zionnite
Copy link

try that fork : https://github.com/PaulBout1/flutter_callkit_incoming.git it works for me

I can see that this repo is directly linking up to @hiennguyen92 original repo, but please what version its working for you let me downgrade my version

@zionnite
Copy link

and again, if i dare downgrade to lower version, am afraid I will start having some issue with the package

@hiennguyen92
Copy link
Owner

Ok. I will check ut

@zionnite
Copy link

zionnite commented Jun 1, 2022

Screen Shot 2022-06-01 at 10 29 10 AM

@hiennguyen92 please see this

@suriyaKalidoss21
Copy link

I'm also facing this issue.

@suriyaKalidoss21
Copy link

try that fork : https://github.com/PaulBout1/flutter_callkit_incoming.git
it works for me

its having bugs

@suriyaKalidoss21
Copy link

get call not returning current call details

@rohithmahesh3
Copy link

I have fixed it for my project.
The function returning the data upon call was on SharedPreferencesUtils.kt

fun getDataActiveCalls(context: Context?): ArrayList<Data> {
    val json = getString(context, "ACTIVE_CALLS", "[]")
    return Utils.getGsonInstance()
        .fromJson(json, object : TypeToken<ArrayList<Data>>() {}.type)
}

I just created a new function

fun getDataActiveCallsForFlutter(context: Context?): ArrayList<Data> {
    val json = getString(context, "ACTIVE_CALLS", "[]")
    return Utils.getGsonInstance().fromJson(json, object: TypeToken<ArrayList< Map<String, Any?>>>() {}.type)
}

and replaced the old one with it in FlutterCallKitIncomingPlugin.kt

  "activeCalls" -> {
      result.success(getDataActiveCallsForFlutter(context))
  }

here is my fork flutter_callkit_incoming. Hope it helps somebody.

@zionnite
Copy link

zionnite commented Jun 2, 2022

thanks @rohithmahesh3 , let me try it out.

@zionnite
Copy link

zionnite commented Jun 2, 2022

how I perform the reject call function when the application is terminated or killed. I'm using flutter_callkit_incoming: 1.0.1+6.

bro, there are many bugs in this version of the package 1.0.1+6.

do well to follow up closed issues and open issues in this repo so as to be current

@VijaiCPrasad
Copy link

Bro, please help me with which plugin version should I use?

Please do not hijack the issue. Open a new issue to ask your question or search for existing ones

@zionnite
Copy link

zionnite commented Jun 2, 2022

go with current version, a lot of bugs has been fixed and do well to make some changes according to @rohithmahesh3 suggestion and that should help

by the way @wahabsohail we are all learning, learn to learn

@zionnite
Copy link

zionnite commented Jun 2, 2022

I have fixed it for my project. The function returning the data upon call was on SharedPreferencesUtils.kt

fun getDataActiveCalls(context: Context?): ArrayList<Data> {
    val json = getString(context, "ACTIVE_CALLS", "[]")
    return Utils.getGsonInstance()
        .fromJson(json, object : TypeToken<ArrayList<Data>>() {}.type)
}

I just created a new function

fun getDataActiveCallsForFlutter(context: Context?): ArrayList<Data> {
    val json = getString(context, "ACTIVE_CALLS", "[]")
    return Utils.getGsonInstance().fromJson(json, object: TypeToken<ArrayList< Map<String, Any?>>>() {}.type)
}

and replaced the old one with it in FlutterCallKitIncomingPlugin.kt

  "activeCalls" -> {
      result.success(getDataActiveCallsForFlutter(context))
  }

here is my fork flutter_callkit_incoming. Hope it helps somebody.

you saved my time and everything its in order now.
thanks buddy!

@suriyaKalidoss21
Copy link

In release mode its returning invalid json
[
{a: {}, b: 647334, c: Sanjay, d: , e: https://i.pravatar.cc/100, f: 1.0, g: 30000.0, h: Accept, i: Decline, j: Missed call, k: Call back, l: {oppositeUserId: 3233, roomId: 23}, m: {}, n: notification, o: true, p: true, q: false, r: system_ringtone_default, s: #0955fa, t: , u: #4CAF50, v: true, w: true}

]

@PaulBout1
Copy link
Contributor

In release mode its returning invalid json [ {a: {}, b: 647334, c: Sanjay, d: , e: https://i.pravatar.cc/100, f: 1.0, g: 30000.0, h: Accept, i: Decline, j: Missed call, k: Call back, l: {oppositeUserId: 3233, roomId: 23}, m: {}, n: notification, o: true, p: true, q: false, r: system_ringtone_default, s: #0955fa, t: , u: #4CAF50, v: true, w: true}

]

Off topic. solution is here : #83 (comment)

@suriyaKalidoss21
Copy link

@zionnite
Copy link

zionnite commented Jun 6, 2022

This branch is [12 commits behind]
(PaulBout1/flutter_callkit_incoming@master...hiennguyen92:master) hiennguyen92:master.

This branch is [1 commit ahead]
(rohithmahesh3/flutter_callkit_incoming@hiennguyen92:master...master) of hiennguyen92:master.

look at the above and there lies your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants