Merge pull request #406 from twonlyapp/dev
Some checks failed
Publish on Github / build_and_publish (push) Has been cancelled

- Fix: Issue with push notifications on Android
This commit is contained in:
Tobi 2026-05-10 00:02:16 +02:00 committed by GitHub
commit 3e49e293f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 51 additions and 5 deletions

View file

@ -1,5 +1,9 @@
# Changelog
## 0.2.10
- Fix: Issue with push notifications on Android
## 0.2.9
- Improved: Make contact avatars clickable

View file

@ -133,7 +133,11 @@ class _AppMainWidgetState extends State<AppMainWidget> {
Future<void> initAsync() async {
Log.info('AppWidgetState: initAsync started');
if (userService.isUserCreated) {
unawaited(FirebaseMessaging.instance.requestPermission());
try {
unawaited(FirebaseMessaging.instance.requestPermission());
} catch (e) {
Log.error(e);
}
if (_isTwonlyLocked) {
// do not change in case twonly was already unlocked at some point
_isTwonlyLocked = userService.currentUser.screenLockEnabled;

View file

@ -9,18 +9,24 @@ class AppEnvironment {
static late final String cacheDir;
static late final String supportDir;
static bool _isInitialized = false;
// will be loaded in the main_camera_controller.dart
static List<CameraDescription> cameras = [];
static Future<void> init() async {
if (_isInitialized) return;
cacheDir = (await getApplicationCacheDirectory()).path;
supportDir = (await getApplicationSupportDirectory()).path;
Log.init();
_isInitialized = true;
}
static void initTesting() {
if (_isInitialized) return;
cacheDir = '/tmp/twonly_cache';
supportDir = '/tmp/twonly_support';
_isInitialized = true;
}
}

@ -1 +1 @@
Subproject commit 781626f66c5f992ffad861abb7b4937f82319392
Subproject commit fccd366e119671b96730cb09d8bb8aa1057bd1c5

View file

@ -100,9 +100,9 @@ Future<void> incFlameCounter(
final contacts = await twonlyDB.groupsDao.getGroupContact(
group.groupId,
);
if (contacts.length == 1) {
for (final contact in contacts) {
await twonlyDB.contactsDao.updateContact(
contacts.first.userId,
contact.userId,
ContactsCompanion(
mediaReceivedCounter: Value(
contacts.first.mediaReceivedCounter + (received ? 1 : 0),

View file

@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
publish_to: 'none'
version: 0.2.9+118
version: 0.2.10+119
environment:
sdk: ^3.11.0

32
rust/src/key_manager.rs Normal file
View file

@ -0,0 +1,32 @@
struct TwonlyIdentity {}
struct NostrIdentity {}
struct KeyManager {
main_key: [u8; 32],
}
impl KeyManager {
fn try_from_keychain() -> KeyManager {
todo!();
}
fn create_new() {
// generates main_key
// generates signal identity
// generates nostr identity
}
fn get_signal_identity() {}
fn recover_from_trusted_friends() {
//
}
fn generate_backup_key() {}
fn recover_from_backup() {
//
}
}