|
|
|
@ -98,8 +98,10 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
|
|
|
|
void setupVoIPCallBacks() {
|
|
|
|
void setupVoIPCallBacks() {
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
voIPKit.getVoIPToken().then((String? value) async {
|
|
|
|
voIPKit.getVoIPToken().then((String? value) async {
|
|
|
|
|
|
|
|
print('🎈 example: getVoIPToken: $value');
|
|
|
|
if (value != null) {
|
|
|
|
if (value != null) {
|
|
|
|
AppState().setiosVoipPlayerID = await ChatApiClient().oneSignalVoip(value!);
|
|
|
|
AppState().setiosVoipPlayerID = await ChatApiClient().oneSignalVoip(value!);
|
|
|
|
|
|
|
|
print('🎈 example: OneSignal ID: ${AppState().iosVoipPlayerID}');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -150,8 +152,11 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
|
|
|
|
isIncomingCall = true;
|
|
|
|
isIncomingCall = true;
|
|
|
|
if (AppState().getisUserOnline) {
|
|
|
|
if (AppState().getisUserOnline) {
|
|
|
|
_iosCallPayload = IosCallPayload(
|
|
|
|
_iosCallPayload = IosCallPayload(
|
|
|
|
uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: _iosCallPayload!.incomingCallerName, incomingCallType: callDetails.split("-").last);
|
|
|
|
uuid: uuid,
|
|
|
|
|
|
|
|
incomingCallerId: callDetails.split("-")[0],
|
|
|
|
|
|
|
|
incomingCallReciverId: callDetails.split("-")[1],
|
|
|
|
|
|
|
|
incomingCallerName: _iosCallPayload!.incomingCallerName,
|
|
|
|
|
|
|
|
incomingCallType: callDetails.split("-").last);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_iosCallPayload = IosCallPayload(
|
|
|
|
_iosCallPayload = IosCallPayload(
|
|
|
|
uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: null, incomingCallType: callDetails.split("-").last);
|
|
|
|
uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: null, incomingCallType: callDetails.split("-").last);
|
|
|
|
@ -398,6 +403,7 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
|
|
|
|
Utils.showLoading(context);
|
|
|
|
Utils.showLoading(context);
|
|
|
|
Future.delayed(Duration(seconds: Platform.isIOS ? 3 : 2)).whenComplete(() {
|
|
|
|
Future.delayed(Duration(seconds: Platform.isIOS ? 3 : 2)).whenComplete(() {
|
|
|
|
if (!isIncomingCall) {
|
|
|
|
if (!isIncomingCall) {
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
if (isAppOpenBySystem!) checkFirebaseToken();
|
|
|
|
if (isAppOpenBySystem!) checkFirebaseToken();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|