updateFirebaseToken static method

Future<void> updateFirebaseToken(
  1. String username,
  2. String email,
  3. String fcmToken,
  4. String uniqueId,
)

Implementation

static Future<void> updateFirebaseToken(
    String username, String email, String fcmToken, String uniqueId) async {
  final url = Uri.parse(
      'https://app.quickconnect.biz/api/api/v1/store-firebase-token');
  final body = {
    'user_name': username,
    'email': email,
    'firebase_token': fcmToken,
    'client_unique_id': uniqueId,
  };
  try {
    final response = await http.post(url, body: body);
    if (response.statusCode == 200) {
      debugPrint('FCM Token updated successfully');
    } else {
      debugPrint(
          'Failed to update FCM Token: ${response.statusCode} ${response.body}');
    }
  } catch (e) {
    debugPrint('Error updating FCM Token: $e');
  }
}