Merge pull request #5420 from pangeachat/5399-more-intentional-request-to-allow-notifications
5399 more intentional request to allow notifications
This commit is contained in:
commit
2fa8b3a511
65 changed files with 808 additions and 39 deletions
|
|
@ -59,6 +59,9 @@ post_install do |installer|
|
|||
'$(inherited)',
|
||||
# dart: PermissionGroup.microphone
|
||||
'PERMISSION_MICROPHONE=1',
|
||||
|
||||
## dart: PermissionGroup.notification
|
||||
'PERMISSION_NOTIFICATIONS=1',
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import 'package:fluffychat/pages/device_settings/device_settings.dart';
|
|||
import 'package:fluffychat/pages/login/login.dart';
|
||||
import 'package:fluffychat/pages/new_group/new_group.dart';
|
||||
import 'package:fluffychat/pages/new_private_chat/new_private_chat.dart';
|
||||
import 'package:fluffychat/pages/onboarding/enable_notifications.dart';
|
||||
import 'package:fluffychat/pages/onboarding/space_code_onboarding.dart';
|
||||
import 'package:fluffychat/pages/settings/settings.dart';
|
||||
import 'package:fluffychat/pages/settings_3pid/settings_3pid.dart';
|
||||
|
|
@ -65,6 +66,7 @@ import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.
|
|||
import 'package:fluffychat/widgets/config_viewer.dart';
|
||||
import 'package:fluffychat/widgets/layouts/empty_page.dart';
|
||||
import 'package:fluffychat/widgets/layouts/two_column_layout.dart';
|
||||
import 'package:fluffychat/widgets/local_notifications_extension.dart';
|
||||
import 'package:fluffychat/widgets/log_view.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:fluffychat/widgets/share_scaffold_dialog.dart';
|
||||
|
|
@ -208,6 +210,22 @@ abstract class AppRoutes {
|
|||
const CreatePangeaAccountPage(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'notifications',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const EnableNotifications(),
|
||||
),
|
||||
redirect: (context, state) async {
|
||||
final redirect =
|
||||
await PAuthGaurd.onboardingRedirect(context, state);
|
||||
if (redirect != null) return redirect;
|
||||
final enabled = await Matrix.of(context).notificationsEnabled;
|
||||
if (enabled) return "/registration/course";
|
||||
return null;
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: 'course',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
|
|
|
|||
|
|
@ -11127,6 +11127,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "بانجيا شات هو تطبيق رسائل لذا فإن الإشعارات مهمة!",
|
||||
"enableNotificationsDesc": "السماح بالإشعارات",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "استخدم صورة النشاط كخلفية للدردشة",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12009,6 +12009,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat - гэта прыкладанне для адпраўкі паведамленняў, таму апавяшчэнні важныя!",
|
||||
"enableNotificationsDesc": "Дазволіць апавяшчэнні",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Выкарыстоўвайце малюнак актыўнасці як фон чата",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12014,6 +12014,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "প্যাঙ্গিয়া চ্যাট একটি টেক্সটিং অ্যাপ, তাই নোটিফিকেশন গুরুত্বপূর্ণ!",
|
||||
"enableNotificationsDesc": "নোটিফিকেশন অনুমোদন করুন",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "চ্যাট ব্যাকগ্রাউন্ড হিসেবে কার্যকলাপের ছবি ব্যবহার করুন",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10664,6 +10664,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikacija za slanje poruka, pa su obaveštenja važna!",
|
||||
"enableNotificationsDesc": "Dozvoli obaveštenja",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Bruk aktivitetsbilde som chatbakgrunn",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10934,6 +10934,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat és una aplicació de missatgeria, així que les notificacions són importants!",
|
||||
"enableNotificationsDesc": "Permetre notificacions",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Utilitza la imatge d'activitat com a fons de xat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11517,6 +11517,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikace pro zasílání zpráv, takže jsou oznámení důležitá!",
|
||||
"enableNotificationsDesc": "Povolit oznámení",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Použít obrázek aktivity jako pozadí chatu",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11971,6 +11971,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat er en beskedapp, så notifikationer er vigtige!",
|
||||
"enableNotificationsDesc": "Tillad notifikationer",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Brug aktivitetsbillede som chatbaggrund",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10917,6 +10917,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat ist eine Messaging-App, daher sind Benachrichtigungen wichtig!",
|
||||
"enableNotificationsDesc": "Benachrichtigungen erlauben",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Aktivitätsbild als Chat-Hintergrund verwenden",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11968,6 +11968,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Η Pangea Chat είναι μια εφαρμογή μηνυμάτων, οπότε οι ειδοποιήσεις είναι σημαντικές!",
|
||||
"enableNotificationsDesc": "Επιτρέψτε τις ειδοποιήσεις",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Χρησιμοποιήστε την εικόνα δραστηριότητας ως φόντο συνομιλίας",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -5059,6 +5059,8 @@
|
|||
"findCourse": "Find a course",
|
||||
"publicInviteDescChat": "Search for users to invite them to this chat.",
|
||||
"publicInviteDescSpace": "Search for users to invite them to this space.",
|
||||
"enableNotificationsTitle": "Pangea Chat is a texting app so notifications are important!",
|
||||
"enableNotificationsDesc": "Allow notifications",
|
||||
"useActivityImageAsChatBackground": "Use activity image as chat background",
|
||||
"chatWithSupport": "Chat with Support",
|
||||
"newCourseAccess": "By default, courses are publicly searchable and require admin approval to join. You can edit these settings at any time.",
|
||||
|
|
|
|||
|
|
@ -11999,6 +11999,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat estas aplikaĵo por mesaĝado, do notifikoj estas gravaj!",
|
||||
"enableNotificationsDesc": "Permesi notifikojn",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Uzu aktivan bildon kiel ĉatfondon",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -8152,6 +8152,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "¡Pangea Chat es una aplicación de mensajería, así que las notificaciones son importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificaciones",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usar imagen de actividad como fondo de chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11181,6 +11181,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat on sõnumite rakendus, seega on teavitused olulised!",
|
||||
"enableNotificationsDesc": "Luba teavitused",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Kasuta tegevuse pilti vestluse taustana",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10910,6 +10910,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat mezularitza aplikazio bat da, beraz jakinarazpenak garrantzitsuak dira!",
|
||||
"enableNotificationsDesc": "Baimendu jakinarazpenak",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Erabili jarduera irudia txat atzeko plano gisa",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11642,6 +11642,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "چت پانگهآ یک اپلیکیشن پیامرسان است، بنابراین اعلانها مهم هستند!",
|
||||
"enableNotificationsDesc": "اجازه دادن به اعلانها",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "از تصویر فعالیت به عنوان پسزمینه چت استفاده کنید",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11533,6 +11533,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat on viestintäsovellus, joten ilmoitukset ovat tärkeitä!",
|
||||
"enableNotificationsDesc": "Salli ilmoitukset",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Käytä aktiviteettikuvaa chat-taustana",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11886,6 +11886,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Ang Pangea Chat ay isang texting app kaya't mahalaga ang mga notification!",
|
||||
"enableNotificationsDesc": "Pahintulutan ang mga notification",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Gamitin ang larawan ng aktibidad bilang background ng chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11234,6 +11234,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat est une application de messagerie, donc les notifications sont importantes !",
|
||||
"enableNotificationsDesc": "Autoriser les notifications",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Utiliser l'image d'activité comme arrière-plan de chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10908,6 +10908,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Is aip téacsála í Pangea Chat mar sin tá fógraí tábhachtach!",
|
||||
"enableNotificationsDesc": "Cuir fógraí ar cead",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Úsáid íomhá gníomhaíochta mar chúlra comhrá",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10907,6 +10907,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat é unha aplicación de mensaxería, así que as notificacións son importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificacións",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usa a imaxe de actividade como fondo de chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11959,6 +11959,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat היא אפליקציית הודעות, ולכן התראות הן חשובות!",
|
||||
"enableNotificationsDesc": "אפשר התראות",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "השתמש בתמונה של הפעילות כרקע לצ'אט",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11995,6 +11995,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea चैट एक टेक्स्टिंग ऐप है इसलिए सूचनाएँ महत्वपूर्ण हैं!",
|
||||
"enableNotificationsDesc": "सूचनाएँ अनुमति दें",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "चैट पृष्ठभूमि के रूप में गतिविधि छवि का उपयोग करें",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11282,6 +11282,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikacija za slanje poruka, stoga su obavijesti važne!",
|
||||
"enableNotificationsDesc": "Dopusti obavijesti",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Koristi sliku aktivnosti kao pozadinu chata",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10911,6 +10911,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "A Pangea Chat egy üzenetküldő alkalmazás, így a értesítések fontosak!",
|
||||
"enableNotificationsDesc": "Értesítések engedélyezése",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Használja az aktivitás képet csevegési háttérként",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11988,6 +11988,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat est un application de messagerie donc les notifications sont importantes !",
|
||||
"enableNotificationsDesc": "Autoriser les notifications",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usa l'immagine dell'attività come sfondo della chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10901,6 +10901,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat adalah aplikasi pesan, jadi notifikasi itu penting!",
|
||||
"enableNotificationsDesc": "Izinkan notifikasi",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Gunakan gambar aktivitas sebagai latar belakang obrolan",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11884,6 +11884,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat é uma aplicação de mensagens, por isso as notificações são importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificações",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Úsáid íomhá gníomhaíochta mar chúlra comhrá",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10913,6 +10913,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat è un'app di messaggistica, quindi le notifiche sono importanti!",
|
||||
"enableNotificationsDesc": "Consenti notifiche",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usa l'immagine dell'attività come sfondo della chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11700,6 +11700,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chatはメッセージアプリなので、通知は重要です!",
|
||||
"enableNotificationsDesc": "通知を許可する",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "アクティビティ画像をチャットの背景として使用",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11940,6 +11940,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat არის ტექსტური აპლიკაცია, ამიტომ შეტყობინებები მნიშვნელოვანია!",
|
||||
"enableNotificationsDesc": "შეტყობინებების დაშვება",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "გამოიყენეთ აქტივობის სურათი ჩეთის ფონად",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11018,6 +11018,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat은 문자 메시지 앱이므로 알림이 중요합니다!",
|
||||
"enableNotificationsDesc": "알림 허용",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "활동 이미지를 채팅 배경으로 사용",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11715,6 +11715,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat yra žinučių programa, todėl pranešimai yra svarbūs!",
|
||||
"enableNotificationsDesc": "Leisti pranešimus",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Naudoti veiklos vaizdą kaip pokalbio foną",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10896,6 +10896,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat ir ziņojumapmaiņas lietotne, tāpēc paziņojumi ir svarīgi!",
|
||||
"enableNotificationsDesc": "Atļaut paziņojumus",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Izmantojiet aktivitātes attēlu kā čata fona",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12003,6 +12003,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat er en tekstmelding-app, så varsler er viktige!",
|
||||
"enableNotificationsDesc": "Tillat varsler",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Bruk aktivitetsbilde som chatbakgrunn",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10910,6 +10910,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat is een berichten-app, dus meldingen zijn belangrijk!",
|
||||
"enableNotificationsDesc": "Sta meldingen toe",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Gebruik activiteit afbeelding als chatachtergrond",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10908,6 +10908,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat to aplikacja do wiadomości, więc powiadomienia są ważne!",
|
||||
"enableNotificationsDesc": "Zezwól na powiadomienia",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Użyj obrazu aktywności jako tła czatu",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12010,6 +12010,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat é um aplicativo de mensagens, então as notificações são importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificações",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usar imagem da atividade como fundo do chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11268,6 +11268,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat é um aplicativo de mensagens, então as notificações são importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificações",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usar imagem da atividade como fundo do chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11939,6 +11939,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat é um aplicativo de mensagens, então as notificações são importantes!",
|
||||
"enableNotificationsDesc": "Permitir notificações",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Usar imagem da atividade como fundo do chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11645,6 +11645,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat este o aplicație de mesagerie, așa că notificările sunt importante!",
|
||||
"enableNotificationsDesc": "Permite notificările",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Folosește imaginea activității ca fundal pentru chat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11018,6 +11018,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat - это приложение для обмена сообщениями, поэтому уведомления важны!",
|
||||
"enableNotificationsDesc": "Разрешить уведомления",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Использовать изображение активности в качестве фона чата",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11994,6 +11994,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikácia na posielanie správ, takže notifikácie sú dôležité!",
|
||||
"enableNotificationsDesc": "Povoliť notifikácie",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Použiť obrázok aktivity ako pozadie chatu",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11991,6 +11991,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikacija za sporočanje, zato so obvestila pomembna!",
|
||||
"enableNotificationsDesc": "Dovoli obvestila",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Uporabi sliko dejavnosti kot ozadje klepeta",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12012,6 +12012,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat je aplikacija za slanje poruka, pa su obaveštenja važna!",
|
||||
"enableNotificationsDesc": "Dozvoli obaveštenja",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Koristi sliku aktivnosti kao pozadinu za čat",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11388,6 +11388,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat är en meddelandeapp så aviseringar är viktiga!",
|
||||
"enableNotificationsDesc": "Tillåt aviseringar",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Använd aktivitetsbild som chattbakgrund",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11134,6 +11134,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "பாஙேஆ சாட் என்பது ஒரு செய்தி அனுப்பும் செயலி ஆகும், எனவே அறிவிப்புகள் முக்கியமானவை!",
|
||||
"enableNotificationsDesc": "அறிவிப்புகளை அனுமதிக்கவும்",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "செயல்பாட்டு படத்தை உரையாடல் பின்னணி ஆக பயன்படுத்தவும்",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11999,6 +11999,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "పాంజియా చాట్ ఒక సందేశం యాప్ కాబట్టి నోటిఫికేషన్లు ముఖ్యమైనవి!",
|
||||
"enableNotificationsDesc": "నోటిఫికేషన్లను అనుమతించండి",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "చాట్ నేపథ్యంగా కార్యకలాప చిత్రాన్ని ఉపయోగించండి",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11968,6 +11968,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat เป็นแอปส่งข้อความ ดังนั้นการแจ้งเตือนจึงสำคัญ!",
|
||||
"enableNotificationsDesc": "อนุญาตการแจ้งเตือน",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "ใช้ภาพกิจกรรมเป็นพื้นหลังแชท",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -11132,6 +11132,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat, bir mesajlaşma uygulamasıdır, bu yüzden bildirimler önemlidir!",
|
||||
"enableNotificationsDesc": "Bildirimlere izin ver",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Etkinlik resmini sohbet arka planı olarak kullan",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10904,6 +10904,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat - це додаток для обміну повідомленнями, тому сповіщення важливі!",
|
||||
"enableNotificationsDesc": "Дозволити сповіщення",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Використовувати зображення активності як фон чату",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -6488,6 +6488,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat là một ứng dụng nhắn tin nên thông báo là rất quan trọng!",
|
||||
"enableNotificationsDesc": "Cho phép thông báo",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "Sử dụng hình ảnh hoạt động làm nền trò chuyện",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -12001,6 +12001,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat 係一個短信應用程式,所以通知非常重要!",
|
||||
"enableNotificationsDesc": "允許通知",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "使用活動圖片作為聊天背景",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10901,6 +10901,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat 是一款短信应用,因此通知非常重要!",
|
||||
"enableNotificationsDesc": "允许通知",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "将活动图像用作聊天背景",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
|
|
@ -10908,6 +10908,16 @@
|
|||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"enableNotificationsTitle": "Pangea Chat 是一個即時通訊應用程式,因此通知非常重要!",
|
||||
"enableNotificationsDesc": "允許通知",
|
||||
"@enableNotificationsTitle": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"@enableNotificationsDesc": {
|
||||
"type": "String",
|
||||
"placeholders": {}
|
||||
},
|
||||
"useActivityImageAsChatBackground": "使用活動圖片作為聊天背景",
|
||||
"@useActivityImageAsChatBackground": {
|
||||
"type": "String",
|
||||
|
|
|
|||
125
lib/pages/onboarding/enable_notifications.dart
Normal file
125
lib/pages/onboarding/enable_notifications.dart
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/authentication/p_logout.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/login/pages/pangea_login_scaffold.dart';
|
||||
import 'package:fluffychat/widgets/local_notifications_extension.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
class EnableNotifications extends StatefulWidget {
|
||||
const EnableNotifications({super.key});
|
||||
|
||||
@override
|
||||
EnableNotificationsController createState() =>
|
||||
EnableNotificationsController();
|
||||
}
|
||||
|
||||
class EnableNotificationsController extends State<EnableNotifications> {
|
||||
Profile? profile;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_setProfile();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Future<void> _setProfile() async {
|
||||
final client = Matrix.of(context).client;
|
||||
try {
|
||||
profile = await client.getProfileFromUserId(
|
||||
client.userID!,
|
||||
);
|
||||
} catch (e, s) {
|
||||
ErrorHandler.logError(
|
||||
e: e,
|
||||
s: s,
|
||||
data: {
|
||||
'userId': client.userID,
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
if (mounted) setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _requestNotificationPermission() async {
|
||||
await Matrix.of(context).requestNotificationPermission();
|
||||
if (mounted) {
|
||||
context.go("/registration/course");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PangeaLoginScaffold(
|
||||
customAppBar: AppBar(
|
||||
title: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 450,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BackButton(
|
||||
onPressed: () => pLogoutAction(
|
||||
context,
|
||||
bypassWarning: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
automaticallyImplyLeading: false,
|
||||
),
|
||||
showAppName: false,
|
||||
mainAssetUrl: profile?.avatarUrl,
|
||||
children: [
|
||||
Column(
|
||||
spacing: 8.0,
|
||||
children: [
|
||||
Text(
|
||||
L10n.of(context).welcomeUser(
|
||||
profile?.displayName ??
|
||||
Matrix.of(context).client.userID?.localpart ??
|
||||
"",
|
||||
),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleLarge
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
L10n.of(context).enableNotificationsTitle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: _requestNotificationPermission,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.primaryContainer,
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.onPrimaryContainer,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(L10n.of(context).enableNotificationsDesc),
|
||||
],
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
child: Text(L10n.of(context).skipForNow),
|
||||
onPressed: () => context.go("/registration/course"),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ import 'package:matrix/matrix.dart';
|
|||
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pages/onboarding/space_code_onboarding.dart';
|
||||
import 'package:fluffychat/pangea/authentication/p_logout.dart';
|
||||
import 'package:fluffychat/pangea/login/pages/pangea_login_scaffold.dart';
|
||||
|
||||
class SpaceCodeOnboardingView extends StatelessWidget {
|
||||
|
|
@ -27,10 +26,7 @@ class SpaceCodeOnboardingView extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BackButton(
|
||||
onPressed: () => pLogoutAction(
|
||||
context,
|
||||
bypassWarning: true,
|
||||
),
|
||||
onPressed: Navigator.of(context).pop,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 40.0,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import 'package:fluffychat/pangea/common/config/environment.dart';
|
|||
import 'package:fluffychat/utils/fluffy_share.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
import 'package:fluffychat/widgets/local_notifications_extension.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../widgets/mxc_image_viewer.dart';
|
||||
import 'settings.dart';
|
||||
|
|
@ -231,6 +232,23 @@ class SettingsView extends StatelessWidget {
|
|||
? theme.colorScheme.surfaceContainerHigh
|
||||
: null,
|
||||
onTap: () => context.go('/rooms/settings/notifications'),
|
||||
// #Pangea
|
||||
trailing: ValueListenableBuilder(
|
||||
valueListenable:
|
||||
Matrix.of(context).notifPermissionNotifier,
|
||||
builder: (context, _, __) => FutureBuilder<bool>(
|
||||
future: Matrix.of(context).notificationsEnabled,
|
||||
builder: (context, snapshot) {
|
||||
return snapshot.data != false
|
||||
? const SizedBox()
|
||||
: Icon(
|
||||
Icons.error_outline,
|
||||
color: theme.colorScheme.error,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
// Pangea#
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.devices_outlined),
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import 'package:fluffychat/widgets/adaptive_dialogs/adaptive_dialog_action.dart'
|
|||
import 'package:fluffychat/widgets/adaptive_dialogs/show_modal_action_popup.dart';
|
||||
import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
import 'package:fluffychat/widgets/local_notifications_extension.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'settings_notifications_view.dart';
|
||||
|
||||
|
|
@ -205,6 +206,11 @@ class SettingsNotificationsController extends State<SettingsNotifications> {
|
|||
value,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> requestNotificationPermission() async {
|
||||
await Matrix.of(context).requestNotificationPermission();
|
||||
if (mounted) setState(() {});
|
||||
}
|
||||
// Pangea#
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'package:fluffychat/config/themes.dart';
|
|||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pages/settings_notifications/push_rule_extensions.dart';
|
||||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import 'package:fluffychat/widgets/local_notifications_extension.dart';
|
||||
import '../../utils/localized_exception_extension.dart';
|
||||
import '../../widgets/matrix.dart';
|
||||
import 'settings_notifications.dart';
|
||||
|
|
@ -49,6 +50,37 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
child: Column(
|
||||
children: [
|
||||
// #Pangea
|
||||
FutureBuilder<bool>(
|
||||
future: Matrix.of(context).notificationsEnabled,
|
||||
builder: (context, snapshot) => AnimatedSize(
|
||||
duration: FluffyThemes.animationDuration,
|
||||
child: snapshot.data != false
|
||||
? const SizedBox()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8.0,
|
||||
),
|
||||
child: ListTile(
|
||||
tileColor: theme.colorScheme.primaryContainer,
|
||||
leading: Icon(
|
||||
Icons.error_outline,
|
||||
color: theme.colorScheme.onPrimaryContainer,
|
||||
),
|
||||
title: Text(
|
||||
L10n.of(context).enableNotificationsTitle,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.onPrimaryContainer,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
L10n.of(context).enableNotificationsDesc,
|
||||
),
|
||||
onTap: controller.requestNotificationPermission,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class CreatePangeaAccountPageState extends State<CreatePangeaAccountPage> {
|
|||
|
||||
if (l2Set) {
|
||||
if (targetLangCode == null) {
|
||||
context.go('/registration/course');
|
||||
context.go('/registration/notifications');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ class CreatePangeaAccountPageState extends State<CreatePangeaAccountPage> {
|
|||
context.go(
|
||||
_spaceId != null
|
||||
? '/rooms/spaces/$_spaceId/details'
|
||||
: '/registration/course',
|
||||
: '/registration/notifications',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,9 +84,15 @@ class BackgroundPush {
|
|||
const InitializationSettings(
|
||||
// #Pangea
|
||||
// android: AndroidInitializationSettings('notifications_icon'),
|
||||
// iOS: DarwinInitializationSettings(),
|
||||
android: AndroidInitializationSettings('@mipmap/ic_launcher'),
|
||||
iOS: DarwinInitializationSettings(
|
||||
requestAlertPermission: false,
|
||||
requestBadgePermission: false,
|
||||
requestSoundPermission: false,
|
||||
requestProvisionalPermission: false,
|
||||
),
|
||||
// Pangea#
|
||||
iOS: DarwinInitializationSettings(),
|
||||
),
|
||||
onDidReceiveNotificationResponse: goToRoom,
|
||||
);
|
||||
|
|
@ -229,19 +235,9 @@ class BackgroundPush {
|
|||
instance.matrix = matrix;
|
||||
// ignore: prefer_initializing_formals
|
||||
instance.onFcmError = onFcmError;
|
||||
// #Pangea
|
||||
instance.fullInit();
|
||||
// Pangea#
|
||||
return instance;
|
||||
}
|
||||
|
||||
// #Pangea
|
||||
Future<void> fullInit() => setupPush();
|
||||
|
||||
void handleLoginStateChanged(_) => setupPush();
|
||||
|
||||
StreamSubscription<LoginState>? onLogin;
|
||||
|
||||
Future<void> cancelNotification(String roomId) async {
|
||||
Logs().v('Cancel notification for room', roomId);
|
||||
await _flutterLocalNotificationsPlugin.cancel(roomId.hashCode);
|
||||
|
|
@ -275,25 +271,16 @@ class BackgroundPush {
|
|||
bool useDeviceSpecificAppId = false,
|
||||
}) async {
|
||||
// #Pangea
|
||||
try {
|
||||
// Pangea#
|
||||
if (PlatformInfos.isIOS) {
|
||||
//<GOOGLE_SERVICES>await firebase?.requestPermission();
|
||||
}
|
||||
if (PlatformInfos.isAndroid) {
|
||||
_flutterLocalNotificationsPlugin
|
||||
.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>()
|
||||
?.requestNotificationsPermission();
|
||||
}
|
||||
// #Pangea
|
||||
} catch (err, s) {
|
||||
ErrorHandler.logError(
|
||||
e: "Error requesting notifications permission: $err",
|
||||
s: s,
|
||||
data: {},
|
||||
);
|
||||
}
|
||||
// if (PlatformInfos.isIOS) {
|
||||
// await firebase.requestPermission();
|
||||
// }
|
||||
// if (PlatformInfos.isAndroid) {
|
||||
// _flutterLocalNotificationsPlugin
|
||||
// .resolvePlatformSpecificImplementation<
|
||||
// AndroidFlutterLocalNotificationsPlugin
|
||||
// >()
|
||||
// ?.requestNotificationsPermission();
|
||||
// }
|
||||
// Pangea#
|
||||
final clientName = PlatformInfos.clientName;
|
||||
oldTokens ??= <String>{};
|
||||
|
|
|
|||
|
|
@ -6,10 +6,12 @@ import 'package:flutter/material.dart';
|
|||
import 'package:collection/collection.dart';
|
||||
import 'package:desktop_notifications/desktop_notifications.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/l10n/l10n.dart';
|
||||
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
||||
import 'package:fluffychat/utils/client_download_content_extension.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
|
|
@ -44,6 +46,9 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
);
|
||||
|
||||
if (kIsWeb) {
|
||||
// #Pangea
|
||||
if (html.Notification.permission != 'granted') return;
|
||||
// Pangea#
|
||||
final avatarUrl = event.senderFromMemoryOrFallback.avatarUrl;
|
||||
Uri? thumbnailUri;
|
||||
|
||||
|
|
@ -122,6 +127,43 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
linuxNotificationIds[roomId] = notification.id;
|
||||
}
|
||||
}
|
||||
|
||||
// #Pangea
|
||||
Future<bool> get notificationsEnabled {
|
||||
return kIsWeb
|
||||
? Future.value(html.Notification.permission == 'granted')
|
||||
: Permission.notification.isGranted;
|
||||
}
|
||||
|
||||
Future<void> requestNotificationPermission() async {
|
||||
try {
|
||||
if (kIsWeb) {
|
||||
await html.Notification.requestPermission();
|
||||
} else {
|
||||
final status = await Permission.notification.request();
|
||||
if (status.isGranted) {
|
||||
// Notification permissions granted
|
||||
} else if (status.isDenied) {
|
||||
// Notification permissions denied
|
||||
} else if (status.isPermanentlyDenied) {
|
||||
// Notification permissions permanently denied, open app settings
|
||||
await openAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
notifPermissionNotifier.value = notifPermissionNotifier.value + 1;
|
||||
} catch (e, s) {
|
||||
final permission = await notificationsEnabled;
|
||||
ErrorHandler.logError(
|
||||
e: e,
|
||||
s: s,
|
||||
data: {
|
||||
'permission': permission,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
// Pangea#
|
||||
}
|
||||
|
||||
enum DesktopNotificationActions { seen, openChat }
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
bool? loginRegistrationSupported;
|
||||
|
||||
BackgroundPush? backgroundPush;
|
||||
// #Pangea
|
||||
ValueNotifier<int> notifPermissionNotifier = ValueNotifier(0);
|
||||
// Pangea#
|
||||
|
||||
Client get client {
|
||||
if (_activeClient < 0 || _activeClient >= widget.clients.length) {
|
||||
|
|
@ -196,7 +199,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
.stream
|
||||
.where((l) => l == LoginState.loggedIn)
|
||||
.first
|
||||
.then((_) {
|
||||
.then((_) async {
|
||||
// #Pangea
|
||||
MatrixState.pangeaController.handleLoginStateChange(
|
||||
LoginState.loggedIn,
|
||||
|
|
@ -213,7 +216,13 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
);
|
||||
_registerSubs(_loginClientCandidate!.clientName);
|
||||
_loginClientCandidate = null;
|
||||
FluffyChatApp.router.go('/rooms');
|
||||
// #Pangea
|
||||
// FluffyChatApp.router.go('/rooms');
|
||||
final isL2Set = await pangeaController.userController.isUserL2Set;
|
||||
FluffyChatApp.router.go(
|
||||
isL2Set ? '/rooms' : '/registration/create',
|
||||
);
|
||||
// Pangea#
|
||||
});
|
||||
// #Pangea
|
||||
candidate.homeserver = Uri.parse("https://${AppConfig.defaultHomeserver}");
|
||||
|
|
@ -636,6 +645,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
// #Pangea
|
||||
_languageListener?.cancel();
|
||||
_uriListener?.cancel();
|
||||
notifPermissionNotifier.dispose();
|
||||
// Pangea#
|
||||
|
||||
super.dispose();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue