Updates & fixes

merge-update-with-lab-changes
Haroon Amjad 1 year ago
parent e193568aaf
commit 1c66351011

@ -151,35 +151,55 @@ class PenguinView: NSObject, FlutterPlatformView
print("====== after present onPenNavSuccess =========")
guard let config = self.model else {
print("Error: Config Model is nil")
return
}
print("Error: Config Model is nil")
return
}
guard let clinicID = self.model?.clinicID,
let clientID = self.model?.clientID, !clientID.isEmpty else {
print("Error: Config Client ID is nil or empty")
return
}
let navigator = PenguinNavigator(config: config)
PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey) { [weak self] token, error in
if let error = error {
let errorMessage = "Token error while getting the for Navigate to method"
// completion(false, "Failed to get token: \(errorMessage)")
print("Failed to get token: \(errorMessage)")
return
}
guard let token = token else {
// completion(false, "Token is nil")
print("Token is nil")
return
}
print("Token Generated")
print(token);
PenNavUIManager.shared.setToken(token: token)
self?.handleNavigation(clinicID: clinicID, token: token) { success, errorMessage in
if success {
print("Navigation successful")
} else {
print("Navigation failed: \(errorMessage ?? "Unknown error")")
}
}
print("====== after Token onPenNavSuccess =========")
}
PenNavUIManager.shared.navigate(to: config.clinicID)
print("====== after Token onPenNavSuccess =========")
}
private func handleNavigation(clinicID: String, token: String, completion: @escaping (Bool, String?) -> Void) {
DispatchQueue.main.async {
PenNavUIManager.shared.setToken(token: token)
PenNavUIManager.shared.navigate(to: clinicID)
completion(true,nil)
}
}

@ -191,7 +191,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
initPenguinSDK() async {
NavigationClinicDetails data = NavigationClinicDetails();
data.clinicId = widget.appo.clinicID.toString();
// data.clinicId = widget.appo.clinicID.toString();
data.clinicId = "49";
data.patientId = widget.appo.patientID.toString();
data.projectId = widget.appo.projectID.toString();
final bool permited = await AppPermission.askPenguinPermissions();

@ -381,7 +381,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
InkWell(
onTap: () {
NavigationClinicDetails data = NavigationClinicDetails();
data.clinicId = appoList[index].clinicID.toString();
// data.clinicId = appoList[index].clinicID.toString();
data.clinicId = "46";
data.patientId = appoList[index].patientID.toString();
data.projectId = appoList[index].projectID.toString();
initPenguinSDK(data);

@ -23,6 +23,7 @@ class PenguinMethodChannel {
"languageCode": languageCode,
"clientKey": "UGVuZ3VpbklOX1Blbk5hdl9QSUY=",
"mapBoxKey": "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg",
// "clinicID": details?.clinicId ?? "",
"clinicID": details?.clinicId ?? "",
"patientID": details?.patientId ?? "",
"projectID": details?.projectId ?? "",

Loading…
Cancel
Save