chore: Update UP and automatically re-register UP on startup

This commit is contained in:
Christian Pauly 2021-04-30 16:59:26 +02:00
parent f2295f7fe6
commit aa3348e72e
4 changed files with 11 additions and 11 deletions

View File

@ -85,7 +85,7 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "net.zetetic:android-database-sqlcipher:4.4.0" // needed for moor_ffi w/ sqlcipher implementation "net.zetetic:android-database-sqlcipher:4.4.0" // needed for moor_ffi w/ sqlcipher
implementation 'com.github.UnifiedPush:android-connector:1.0.0-beta3' // needed for unifiedpush implementation 'com.github.UnifiedPush:android-connector:1.1.0' // needed for unifiedpush
} }
if(file("google-services.json").exists()){ if(file("google-services.json").exists()){

View File

@ -319,6 +319,11 @@ class BackgroundPush {
await _newUpEndpoint( await _newUpEndpoint(
await store.getItem(SettingKeys.unifiedPushEndpoint)); await store.getItem(SettingKeys.unifiedPushEndpoint));
} }
// re-register the app without a dialog. This should be safe,
// and allows recovering from app deletion in gotify, for instance
Logs().i('[Push] UnifiedPush registration found, re-registering');
await UnifiedPush.registerApp();
} }
Future<void> _onFcmMessage(Map<dynamic, dynamic> message) async { Future<void> _onFcmMessage(Map<dynamic, dynamic> message) async {

View File

@ -1113,12 +1113,10 @@ packages:
unifiedpush: unifiedpush:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." name: unifiedpush
ref: main url: "https://pub.dartlang.org"
resolved-ref: a75da94b9b6687abd24951579a13644ed2a62a28 source: hosted
url: "https://github.com/UnifiedPush/flutter-connector.git" version: "1.0.2"
source: git
version: "1.0.1"
universal_html: universal_html:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -65,10 +65,7 @@ dependencies:
sqflite: ^2.0.0+3 # Still used to obtain the database location sqflite: ^2.0.0+3 # Still used to obtain the database location
sqlite3: ^1.0.0 sqlite3: ^1.0.0
swipe_to_action: ^0.1.0 swipe_to_action: ^0.1.0
unifiedpush: unifiedpush: ^1.0.2
git:
url: https://github.com/UnifiedPush/flutter-connector.git
ref: main
universal_html: ^2.0.8 universal_html: ^2.0.8
url_launcher: ^6.0.3 url_launcher: ^6.0.3