25-10-2/1

This commit is contained in:
Hamza-Ayed
2025-10-02 01:20:16 +03:00
parent 7595be8067
commit c48627a175
342 changed files with 15825 additions and 14862 deletions

View File

@@ -7,6 +7,7 @@ import '../../../print.dart';
import '../../views/auth/otp_page.dart';
import '../../views/widgets/error_snakbar.dart';
import '../functions/crud.dart';
import '../functions/package_info.dart';
import 'login_controller.dart';
// --- Helper Class for Phone Authentication ---
@@ -83,6 +84,24 @@ class PhoneAuthHelper {
}
}
static Future<void> _addTokens() async {
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
await CRUD()
.post(link: "${AppLink.server}/ride/firebase/add.php", payload: {
'token': (box.read(BoxName.tokenFCM.toString())),
'passengerID': box.read(BoxName.passengerID).toString(),
"fingerPrint": fingerPrint
});
await CRUD().post(
link: "${AppLink.seferPaymentServer}/ride/firebase/add.php",
payload: {
'token': (box.read(BoxName.tokenFCM.toString())),
'passengerID': box.read(BoxName.passengerID).toString(),
"fingerPrint": fingerPrint
});
}
static Future<void> registerUser({
required String phoneNumber,
required String firstName,
@@ -102,6 +121,7 @@ class PhoneAuthHelper {
final data = (response);
if (data != 'failure') {
// Registration successful, log user in
await _addTokens();
await _handleSuccessfulLogin(data['message']['data']);
} else {
mySnackeBarError(