fix ios click on push notifications not working
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2026-05-16 18:24:58 +02:00
parent fe2dd06213
commit d0eee1893e
2 changed files with 26 additions and 14 deletions

View file

@ -36,16 +36,18 @@ import workmanager_apple
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { override func application(
_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
let sharingIntent = SwiftFlutterSharingIntentPlugin.instance let sharingIntent = SwiftFlutterSharingIntentPlugin.instance
if sharingIntent.hasSameSchemePrefix(url: url) { if sharingIntent.hasSameSchemePrefix(url: url) {
return sharingIntent.application(app, open: url, options: options) return sharingIntent.application(app, open: url, options: options)
} }
// Proceed url handling for other Flutter libraries like app_links // Proceed url handling for other Flutter libraries like app_links
return super.application(app, open: url, options:options) return super.application(app, open: url, options: options)
} }
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
@ -58,7 +60,8 @@ import workmanager_apple
NSLog( NSLog(
"Application delegate method userNotificationCenter:didReceive:withCompletionHandler: is called with user info: %@", "Application delegate method userNotificationCenter:didReceive:withCompletionHandler: is called with user info: %@",
response.notification.request.content.userInfo) response.notification.request.content.userInfo)
//... super.userNotificationCenter(
center, didReceive: response, withCompletionHandler: completionHandler)
} }
override func userNotificationCenter( override func userNotificationCenter(

View file

@ -40,7 +40,7 @@ class HomeViewState extends State<HomeView> {
Timer? _disableCameraTimer; Timer? _disableCameraTimer;
final MainCameraController _mainCameraController = MainCameraController(); final MainCameraController _mainCameraController = MainCameraController();
final PageController _homeViewPageController = PageController(initialPage: 1); late final PageController _homeViewPageController;
StreamSubscription<List<SharedFile>>? _intentStreamSub; StreamSubscription<List<SharedFile>>? _intentStreamSub;
StreamSubscription<Uri>? _deepLinkSub; StreamSubscription<Uri>? _deepLinkSub;
@ -53,12 +53,21 @@ class HomeViewState extends State<HomeView> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
var initialPage = widget.initialPage;
if (initialPage == 1 && !userService.currentUser.startWithCameraOpen) {
initialPage = 0;
}
_activePageIdx = initialPage;
_homeViewPageController = PageController(initialPage: initialPage);
_mainCameraController.setState = () { _mainCameraController.setState = () {
if (mounted) setState(() {}); if (mounted) setState(() {});
}; };
_homeViewPageIndexSub = streamHomeViewPageIndex.stream.listen((index) { _homeViewPageIndexSub = streamHomeViewPageIndex.stream.listen((index) {
_homeViewPageController.jumpToPage(index); if (_homeViewPageController.hasClients) {
_homeViewPageController.jumpToPage(index);
}
setState(() { setState(() {
_activePageIdx = index; _activePageIdx = index;
}); });