diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 36196b33..b8fc876e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -74,6 +74,10 @@ + + + + diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index fef3a6f9..e5e99402 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -361,8 +361,12 @@ URL do Convite: https://visita.freaccess.com.br/${payload['convites'][i]['VAW_ID } } -Future answersRequest(BuildContext context, String? ref, String? task, - String? response, String? id) async { +Future answersRequest( + {required BuildContext context, + required String? ref, + required String? task, + required String? response, + required String? id}) async { ApiCallResponse? respondeSolicitacaoCall; respondeSolicitacaoCall = await PhpGroup.respondeSolicitacaoCall.call( diff --git a/lib/app_state.dart b/lib/app_state.dart index b01723f7..45bda94a 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -165,7 +165,9 @@ class AppState extends ChangeNotifier { }); await _safeInitAsync(() async { - _isRequestOSNotification = await secureStorage.getBool('ff_request_os_notification') ?? _isRequestOSNotification; + _isRequestOSNotification = + await secureStorage.getBool('ff_request_os_notification') ?? + _isRequestOSNotification; }); } @@ -181,11 +183,11 @@ class AppState extends ChangeNotifier { _isRequestOSNotification = value; secureStorage.setBool('ff_request_os_notification', value); } + void deleteIsRequestOSNotification() { secureStorage.delete(key: 'ff_request_os_notification'); } - bool _whatsapp = false; bool get whatsapp => _whatsapp; diff --git a/lib/backend/notifications/notification_service.dart b/lib/backend/notifications/notification_service.dart index d4efae7c..cf29f510 100644 --- a/lib/backend/notifications/notification_service.dart +++ b/lib/backend/notifications/notification_service.dart @@ -51,11 +51,11 @@ Future onMessageReceived( () async { log("payload: $payload"); await answersRequest( - context, - payload['referencia'].toString(), - 'L', - 'Mensagem', - payload['idVisitante'].toString(), + context: context, + ref: payload['referencia'].toString(), + task: 'L', + response: '', + id: payload['idVisitante'].toString(), ).then((value) { if (value) { context.pop(); @@ -91,11 +91,11 @@ Future onMessageReceived( ), () async { await answersRequest .call( - context, - payload['referencia'].toString(), - 'B', - 'Mensagem', - payload['idVisitante'].toString(), + context: context, + ref: payload['referencia'].toString(), + task: 'B', + response: '', + id: payload['idVisitante'].toString(), ) .then((value) { if (value) { @@ -192,6 +192,8 @@ Future onMessageReceived( ); }); + break; + case 'enroll_cond': break; default: break; diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 9e278249..57852e34 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -233,11 +233,11 @@ class _LiberationHistoryWidgetState extends State { onPressed: () async { answersRequest .call( - context, - liberationHistoryItem['NOT_ID'].toString(), - 'L', - '', - liberationHistoryItem['VTE_ID'].toString(), + context: context, + ref: liberationHistoryItem['NOT_ID'].toString(), + task: 'L', + response: '', + id: liberationHistoryItem['VTE_ID'].toString(), ) .then((value) { log('test: $value'); @@ -286,11 +286,11 @@ class _LiberationHistoryWidgetState extends State { onPressed: () async { return answersRequest .call( - context, - liberationHistoryItem['NOT_ID'].toString(), - 'B', - '', - liberationHistoryItem['VTE_ID'].toString(), + context: context, + ref: liberationHistoryItem['NOT_ID'].toString(), + task: 'B', + response: '', + id: liberationHistoryItem['VTE_ID'].toString(), ) .then((message) { if (message.isEmpty) {