WIP
This commit is contained in:
parent
e903683f07
commit
b184f2adf9
|
@ -62,6 +62,14 @@
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="frehub" android:host="frehub.com" />
|
<data android:scheme="frehub" android:host="frehub.com" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="visit_request" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="access" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="mensagem" />
|
<action android:name="mensagem" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
@ -71,9 +79,9 @@
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- <meta-data
|
<meta-data
|
||||||
android:name="com.google.firebase.messaging.notification_icon"
|
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||||
android:resource="@drawable/notification_icon" /> -->
|
android:resource="@drawable/notification_icon" />
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
|
|
@ -36,60 +36,19 @@ Future<void> onMessageReceived(
|
||||||
FlutterFlowIconButton(
|
FlutterFlowIconButton(
|
||||||
icon: const Icon(Icons.done),
|
icon: const Icon(Icons.done),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
showDialog(
|
showAlertDialog(
|
||||||
context: context,
|
context,
|
||||||
builder: (context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Aprovar Visita',
|
ptText: 'Aprovar Visita',
|
||||||
enText: 'Approve Visit',
|
enText: 'Approve Visit',
|
||||||
),
|
),
|
||||||
),
|
|
||||||
content: Text(
|
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
ptText:
|
ptText:
|
||||||
'Você tem certeza que deseja aprovar essa visita?',
|
'Você tem certeza que deseja aprovar essa visita?',
|
||||||
enText:
|
enText:
|
||||||
'Are you sure you want to approve this visit?',
|
'Are you sure you want to approve this visit?',
|
||||||
),
|
),
|
||||||
),
|
() async {
|
||||||
backgroundColor: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
actions: [
|
|
||||||
FFButtonWidget(
|
|
||||||
text: FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
enText: 'No',
|
|
||||||
ptText: 'Não',
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
options: FFButtonOptions(
|
|
||||||
width: 100,
|
|
||||||
height: 40,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(10)),
|
|
||||||
),
|
|
||||||
FFButtonWidget(
|
|
||||||
text: FFLocalizations.of(context)
|
|
||||||
.getVariableText(
|
|
||||||
enText: 'Yes',
|
|
||||||
ptText: 'Sim',
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
log("payload: $payload");
|
log("payload: $payload");
|
||||||
await answersRequest
|
await answersRequest
|
||||||
.call(
|
.call(
|
||||||
|
@ -114,26 +73,7 @@ Future<void> onMessageReceived(
|
||||||
DialogUtil.errorDefault(context);
|
DialogUtil.errorDefault(context);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
options: FFButtonOptions(
|
|
||||||
width: 100,
|
|
||||||
height: 40,
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
textStyle: TextStyle(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryText,
|
|
||||||
),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context)
|
|
||||||
.primaryBackground,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
});
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FlutterFlowIconButton(
|
FlutterFlowIconButton(
|
||||||
|
|
|
@ -93,7 +93,9 @@ class _AppState extends State<App> {
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen(foregroundHandleMessage);
|
FirebaseMessaging.onMessage.listen(foregroundHandleMessage);
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
|
||||||
onMessageReceived(message.data, '', message.data['click_action']);
|
log(message.toMap().toString());
|
||||||
|
onMessageReceived(message.data, message.notification!.body,
|
||||||
|
message.data['click_action']);
|
||||||
});
|
});
|
||||||
FirebaseMessaging.onBackgroundMessage(_backgroundHandleMessage);
|
FirebaseMessaging.onBackgroundMessage(_backgroundHandleMessage);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue