Skip to content

Commit

Permalink
Fix that the call list cannot be displayed when the push is received …
Browse files Browse the repository at this point in the history
…when andorid is running.
  • Loading branch information
cloudwebrtc committed Jun 16, 2021
1 parent e736cae commit 276f73f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,17 @@ class _MyAppState extends State<HomePage> {
print('onMessage: $message');
if (message.containsKey('data')) {
// Handle data message
final dynamic data = message['data'];
var number = data['body'] as String;
await displayIncomingCall(number);
var payload = message['data'];
var callerId = payload['caller_id'] as String;
var callerName = payload['caller_name'] as String;
var uuid = payload['uuid'] as String;
var hasVideo = payload['has_video'] == "true";
final callUUID = uuid ?? Uuid().v4();
setState(() {
calls[callUUID] = Call(callerId);
});
_callKeep.displayIncomingCall(callUUID, callerId,
localizedCallerName: callerName, hasVideo: hasVideo);
}
},
onBackgroundMessage: myBackgroundMessageHandler,
Expand Down

0 comments on commit 276f73f

Please sign in to comment.