mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 04:25:15 +00:00
fix: Enable gotify recommendations
This commit is contained in:
parent
5801cc0d41
commit
26a07d1849
6 changed files with 112 additions and 55 deletions
|
@ -1573,6 +1573,7 @@
|
|||
"type": "text",
|
||||
"placeholders": {}
|
||||
},
|
||||
"link": "Link",
|
||||
"serverRequiresEmail": "This server needs to validate your email address for registration.",
|
||||
"optionalGroupName": "(Optional) Group name",
|
||||
"@optionalGroupName": {
|
||||
|
|
|
@ -1,62 +1,37 @@
|
|||
---
|
||||
layout: default
|
||||
title: F-Droid Repository
|
||||
title: Push
|
||||
lang: en
|
||||
---
|
||||
# F-Droid Repository
|
||||
# Enable Push Notifications without Google Services
|
||||
|
||||
## Add Repository to F-Droid
|
||||
You have two options to receive push notifications on FluffyChat without Google Services.
|
||||
|
||||
Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
|
||||
1. Unified Push
|
||||
2. MicroG
|
||||
|
||||
{::nomarkdown}
|
||||
<a href="fdroidrepos://fdroid.fluffychat.im/?fingerprint=8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB" >
|
||||
<img src="{{site.assets}}/images/qr-code.svg" width="300" height="300"/>
|
||||
</a>
|
||||
{:/}
|
||||
## 1. Unified Push
|
||||
|
||||
UnifiedPush is specifications and tools that let the user choose how push notifications are delivered. All in a free and open source way.
|
||||
|
||||
### If the QR-Code doesn't work:
|
||||
### Use hosted (easy)
|
||||
|
||||
First check if you have f-droid installed. If not you can get it from: [https://f-droid.org/](https://f-droid.org/).
|
||||
After you made sure you installed it and you didn't have it installed before you can try again the QR-Code.
|
||||
If this still isn't working follow the next steps:
|
||||
1. Go to: https://gotify1.unifiedpush.org/
|
||||
2. Register an account with a username+password
|
||||
3. Download UP-Gotify from F-Droid: https://f-droid.org/de/packages/com.github.gotify.up/
|
||||
4. Login on https://gotify1.unifiedpush.org/ with your username+password
|
||||
5. Restart FluffyChat
|
||||
|
||||
1. Open the f-droid App
|
||||
2. Go to the `Settings` Tab in the Bottom bar
|
||||
3. Click the `Repositories` Action
|
||||
4. Click on the plus sign at the top.
|
||||
5. Fill in `https://fdroid.fluffychat.im` into the top field and `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB` in the bottom field.
|
||||
From now on all push notifications will go through unified push.
|
||||
|
||||
## What is the fingerprint?
|
||||
### Self-host (hard)
|
||||
|
||||
The fingerprint of the Repository is: `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB`
|
||||
For more privacy and protection of your meta data you can self host Gotify for unified push.
|
||||
|
||||
# Nightly Repository
|
||||
Learn more about it here: https://unifiedpush.org/users/distributors/gotify/
|
||||
|
||||
## Add Repository to F-Droid
|
||||
## 2. MicroG
|
||||
|
||||
Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
|
||||
You can use Firebase Cloud Messaging without Google Services using MicroG.
|
||||
|
||||
{::nomarkdown}
|
||||
<a href="fdroidrepos://nightly.fdroid.fluffychat.im/?fingerprint=21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D" >
|
||||
<img src="{{site.assets}}/images/qr-code-nightly.svg" width="300" height="300"/>
|
||||
</a>
|
||||
{:/}
|
||||
|
||||
|
||||
### If the QR-Code doesn't work:
|
||||
|
||||
First check if you have f-droid installed. If not you can get it from: [https://f-droid.org/](https://f-droid.org/).
|
||||
After you made sure you installed it and you didn't have it installed before you can try again the QR-Code.
|
||||
If this still isn't working follow the next steps:
|
||||
|
||||
1. Open the f-droid App
|
||||
2. Go to the `Settings` Tab in the Bottom bar
|
||||
3. Click the `Repositories` Action
|
||||
4. Click on the plus sign at the top.
|
||||
5. Fill in `https://nightly.fdroid.fluffychat.im` into the top field and `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D` in the bottom field.
|
||||
|
||||
## What is the fingerprint?
|
||||
|
||||
The fingerprint of the Repository is: `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D`
|
||||
Learn more about it here: https://microg.org/
|
62
docs/en/push.md
Normal file
62
docs/en/push.md
Normal file
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
layout: default
|
||||
title: F-Droid Repository
|
||||
lang: en
|
||||
---
|
||||
# F-Droid Repository
|
||||
|
||||
## Add Repository to F-Droid
|
||||
|
||||
Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
|
||||
|
||||
{::nomarkdown}
|
||||
<a href="fdroidrepos://fdroid.fluffychat.im/?fingerprint=8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB" >
|
||||
<img src="{{site.assets}}/images/qr-code.svg" width="300" height="300"/>
|
||||
</a>
|
||||
{:/}
|
||||
|
||||
|
||||
### If the QR-Code doesn't work:
|
||||
|
||||
First check if you have f-droid installed. If not you can get it from: [https://f-droid.org/](https://f-droid.org/).
|
||||
After you made sure you installed it and you didn't have it installed before you can try again the QR-Code.
|
||||
If this still isn't working follow the next steps:
|
||||
|
||||
1. Open the f-droid App
|
||||
2. Go to the `Settings` Tab in the Bottom bar
|
||||
3. Click the `Repositories` Action
|
||||
4. Click on the plus sign at the top.
|
||||
5. Fill in `https://fdroid.fluffychat.im` into the top field and `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB` in the bottom field.
|
||||
|
||||
## What is the fingerprint?
|
||||
|
||||
The fingerprint of the Repository is: `8E2637AEF6697CC6DD486AF044A6EE45B1A742AE3EF56566E748CDE8BC65C1FB`
|
||||
|
||||
# Nightly Repository
|
||||
|
||||
## Add Repository to F-Droid
|
||||
|
||||
Easiest way to add the Repository is to either scan the QR-Code or if you are on your phone directly click it.
|
||||
|
||||
{::nomarkdown}
|
||||
<a href="fdroidrepos://nightly.fdroid.fluffychat.im/?fingerprint=21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D" >
|
||||
<img src="{{site.assets}}/images/qr-code-nightly.svg" width="300" height="300"/>
|
||||
</a>
|
||||
{:/}
|
||||
|
||||
|
||||
### If the QR-Code doesn't work:
|
||||
|
||||
First check if you have f-droid installed. If not you can get it from: [https://f-droid.org/](https://f-droid.org/).
|
||||
After you made sure you installed it and you didn't have it installed before you can try again the QR-Code.
|
||||
If this still isn't working follow the next steps:
|
||||
|
||||
1. Open the f-droid App
|
||||
2. Go to the `Settings` Tab in the Bottom bar
|
||||
3. Click the `Repositories` Action
|
||||
4. Click on the plus sign at the top.
|
||||
5. Fill in `https://nightly.fdroid.fluffychat.im` into the top field and `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D` in the bottom field.
|
||||
|
||||
## What is the fingerprint?
|
||||
|
||||
The fingerprint of the Repository is: `21A469657300576478B623DF99D8EB889A80BCD939ACA60A4074741BEAEC397D`
|
|
@ -16,6 +16,7 @@ abstract class AppConfig {
|
|||
static const Color secondaryColor = Color(0xFF41a2bc);
|
||||
static String _privacyUrl = 'https://fluffychat.im/en/privacy.html';
|
||||
static String get privacyUrl => _privacyUrl;
|
||||
static const String enablePushTutorial = 'https://fluffychat.im/en/push.html';
|
||||
static const String appId = 'im.fluffychat.FluffyChat';
|
||||
static const String appOpenUrlScheme = 'im.fluffychat';
|
||||
static String _webBaseUrl = 'https://fluffychat.im/web';
|
||||
|
|
|
@ -51,8 +51,7 @@ class BackgroundPush {
|
|||
BuildContext context;
|
||||
GlobalKey<VRouterState> router;
|
||||
String _fcmToken;
|
||||
LoginState _loginState;
|
||||
void Function(String errorMsg) onFcmError;
|
||||
void Function(String errorMsg, {Uri link}) onFcmError;
|
||||
L10n l10n;
|
||||
Store _store;
|
||||
Store get store => _store ??= Store();
|
||||
|
@ -95,7 +94,7 @@ class BackgroundPush {
|
|||
|
||||
factory BackgroundPush(
|
||||
Client _client, BuildContext _context, GlobalKey<VRouterState> router,
|
||||
{final void Function(String errorMsg) onFcmError}) {
|
||||
{final void Function(String errorMsg, {Uri link}) onFcmError}) {
|
||||
final instance = BackgroundPush.clientOnly(_client);
|
||||
instance.context = _context;
|
||||
instance.router = router;
|
||||
|
@ -109,7 +108,6 @@ class BackgroundPush {
|
|||
}
|
||||
|
||||
void handleLoginStateChanged(LoginState state) {
|
||||
_loginState = state;
|
||||
setupPush();
|
||||
}
|
||||
|
||||
|
@ -217,7 +215,7 @@ class BackgroundPush {
|
|||
|
||||
Future<void> setupPush() async {
|
||||
await setupLocalNotificationsPlugin();
|
||||
if (_loginState != LoginState.loggedIn ||
|
||||
if (client.loginState != LoginState.loggedIn ||
|
||||
!PlatformInfos.isMobile ||
|
||||
context == null) {
|
||||
return;
|
||||
|
@ -250,9 +248,15 @@ class BackgroundPush {
|
|||
}
|
||||
if (await store.getItemBool(SettingKeys.showNoGoogle, true)) {
|
||||
await loadLocale();
|
||||
onFcmError?.call(PlatformInfos.isAndroid
|
||||
? l10n.noGoogleServicesWarning
|
||||
: l10n.oopsPushError);
|
||||
if (PlatformInfos.isAndroid) {
|
||||
onFcmError?.call(
|
||||
l10n.noGoogleServicesWarning,
|
||||
link: Uri.parse(
|
||||
AppConfig.enablePushTutorial,
|
||||
),
|
||||
);
|
||||
}
|
||||
onFcmError?.call(l10n.oopsPushError);
|
||||
|
||||
if (null == await store.getItem(SettingKeys.showNoGoogle)) {
|
||||
await store.setItemBool(SettingKeys.showNoGoogle, false);
|
||||
|
|
|
@ -519,8 +519,22 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
client,
|
||||
context,
|
||||
widget.router,
|
||||
onFcmError: (errorMsg) => ScaffoldMessenger.of(context)
|
||||
.showSnackBar(SnackBar(content: Text(errorMsg))),
|
||||
onFcmError: (errorMsg, {Uri link}) => Timer(
|
||||
Duration(seconds: 1),
|
||||
() {
|
||||
final banner = SnackBar(
|
||||
content: Text(errorMsg),
|
||||
duration: Duration(seconds: 30),
|
||||
action: link == null
|
||||
? null
|
||||
: SnackBarAction(
|
||||
label: L10n.of(context).link,
|
||||
onPressed: () => launch(link.toString()),
|
||||
),
|
||||
);
|
||||
ScaffoldMessenger.of(navigatorContext).showSnackBar(banner);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue