hiennguyen92 / flutter_callkit_incoming

Flutter Callkit Incoming
https://pub.dev/packages/flutter_callkit_incoming
MIT License
182 stars 313 forks source link

getDevicePushTokenVoIP() returns nothing #488

Open cofirazak opened 8 months ago

cofirazak commented 8 months ago

@hiennguyen92 First of all, thank you for this package! Great work!

I followed the PUSHKIT.md setup, but when i call await FlutterCallkitIncoming.getDevicePushTokenVoIP() it returns just nothing.

I decided to check the correctness of my apple account / project settings and called a similar function from other popular package – ConnectycubeFlutterCallKit.getToken(); and it returned me the token.

But in ConnectycubeFlutterCallKit there is on step before this – ConnectycubeFlutterCallKit().init();

Under the hood of this init() there is:

_eventChannel.receiveBroadcastStream().listen((rawData) {
  print('[initEventsHandler] rawData: $rawData');
  final eventData = Map<String, dynamic>.from(rawData);
  _processEvent(eventData);
});

And at the start of my app this print outputs:

flutter: [initEventsHandler] rawData: 
{
  event: voipToken, 
  args: {voipToken: F277A8518B45C2676FAD63804931CC62F4E48DE731E67AA7C0F4BD8DCA3DF991}
}

I compared it with your code and saw the same part of code – _eventChannel.receiveBroadcastStream():

static Stream<CallEvent?> get onEvent =>
      _eventChannel.receiveBroadcastStream().map(_receiveCallEvent);

But in your code at the start of my app there is no voipToken event happened, only events related to calls when i make one.

What i do wrong? How should i get the voip token?

hiennguyen92 commented 8 months ago

https://github.com/hiennguyen92/flutter_callkit_incoming/blob/5b8705cff267435025bd51ac5c7c85bb1afb1f24/example/ios/Runner/AppDelegate.swift#L60

Nazeer-Nageb commented 8 months ago

@cofirazak Can you tell me how to push call voip in ios ? Are there anything help me to push call code or video ? Thanks .

cofirazak commented 8 months ago

https://github.com/hiennguyen92/flutter_callkit_incoming/blob/5b8705cff267435025bd51ac5c7c85bb1afb1f24/example/ios/Runner/AppDelegate.swift#L60

@hiennguyen92 When i start my app, or even make a successful call – this method pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) is never triggered.

Should i call it manually somehow from my app? Or it should be triggered automatically by flutter_callkit_incoming package like in the connectycube_flutter_call_kit package it is triggered after ConnectycubeFlutterCallKit().init(); ?

cofirazak commented 8 months ago

@Nazeer-Nageb Have you followed the PUSHKIT.md setup?

hiennguyen92 commented 8 months ago

https://github.com/hiennguyen92/flutter_callkit_incoming/blob/master/PUSHKIT.md

Here are instructions on how to setup and send voip.

cofirazak commented 8 months ago

@hiennguyen92 Please help me understand 1 moment:

https://github.com/hiennguyen92/flutter_callkit_incoming/blob/5b8705cff267435025bd51ac5c7c85bb1afb1f24/example/ios/Runner/AppDelegate.swift#L60

This line of code is from method pushRegistry Should i call this method manually somehow from my app? If yes, then what api should i use to call this method?