add to share menu #366

This commit is contained in:
otsmr 2026-01-23 00:34:12 +01:00
parent 76c56b06fe
commit 1b72ec5649
5 changed files with 23 additions and 12 deletions

View file

@ -33,6 +33,21 @@
<data android:scheme="http" android:host="me.twonly.eu" /> <data android:scheme="http" android:host="me.twonly.eu" />
<data android:scheme="https" /> <data android:scheme="https" />
</intent-filter> </intent-filter>
<!-- Allow other apps to share links -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="*" />
</intent-filter>
<!-- Allow other apps to share links via plain text -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />

View file

@ -109,10 +109,10 @@ func getPushNotificationData(pushData: String) -> (
} else if pushUser != nil { } else if pushUser != nil {
return ( return (
pushUser!.displayName, pushUser!.displayName,
getPushNotificationText(pushNotification: pushNotification, true).0, pushUser!.userID getPushNotificationText(pushNotification: pushNotification, userKnown: true).0, pushUser!.userID
) )
} else { } else {
let content = getPushNotificationText(pushNotification: pushNotification, false) let content = getPushNotificationText(pushNotification: pushNotification, userKnown: false)
return ( return (
content.1, content.0, 1 content.1, content.0, 1
) )
@ -205,7 +205,7 @@ func readFromKeychain(key: String) -> String? {
return nil return nil
} }
func getPushNotificationText(pushNotification: PushNotification, userKnown: bool) -> (String, String) { func getPushNotificationText(pushNotification: PushNotification, userKnown: Bool) -> (String, String) {
let systemLanguage = Locale.current.language.languageCode?.identifier ?? "en" // Get the current system language let systemLanguage = Locale.current.language.languageCode?.identifier ?? "en" // Get the current system language
var pushNotificationText: [PushKind: String] = [:] var pushNotificationText: [PushKind: String] = [:]
@ -274,7 +274,7 @@ func getPushNotificationText(pushNotification: PushNotification, userKnown: bool
var content = pushNotificationText[pushNotification.kind] ?? "" var content = pushNotificationText[pushNotification.kind] ?? ""
if (content == "") { if (content == "") {
title = noTranslationFoundTitle title = noTranslationFoundTitle
body = noTranslationFoundBody content = noTranslationFoundBody
} }
if pushNotification.hasAdditionalContent { if pushNotification.hasAdditionalContent {

View file

@ -22,6 +22,8 @@
<key>NSExtensionActivationRule</key> <key>NSExtensionActivationRule</key>
<dict> <dict>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key> <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer> <integer>1</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key> <key>NSExtensionActivationSupportsImageWithMaxCount</key>

@ -1 +1 @@
Subproject commit 20f3c2f0a49e4c9be452ecbc84d98054c92974e1 Subproject commit 9d04e9e1d0cdba8f1be4b0cbba341706c3cffac9

View file

@ -4,7 +4,6 @@ import 'dart:io';
import 'package:camera/camera.dart'; import 'package:camera/camera.dart';
import 'package:clock/clock.dart'; import 'package:clock/clock.dart';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_android_volume_keydown/flutter_android_volume_keydown.dart'; import 'package:flutter_android_volume_keydown/flutter_android_volume_keydown.dart';
@ -353,12 +352,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
sendToGroup: widget.sendToGroup, sendToGroup: widget.sendToGroup,
mediaFileService: mediaFileService, mediaFileService: mediaFileService,
mainCameraController: mc, mainCameraController: mc,
// previewLink: mc.sharedLinkForPreview, previewLink: mc.sharedLinkForPreview,
previewLink: kDebugMode
? Uri.parse(
'https://mastodon.social/@islieb/115883317936171927',
)
: mc.sharedLinkForPreview,
), ),
transitionsBuilder: (context, animation, secondaryAnimation, child) { transitionsBuilder: (context, animation, secondaryAnimation, child) {
return child; return child;