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,7 +36,9 @@ import workmanager_apple
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
if sharingIntent.hasSameSchemePrefix(url: url) {
@ -58,7 +60,8 @@ import workmanager_apple
NSLog(
"Application delegate method userNotificationCenter:didReceive:withCompletionHandler: is called with user info: %@",
response.notification.request.content.userInfo)
//...
super.userNotificationCenter(
center, didReceive: response, withCompletionHandler: completionHandler)
}
override func userNotificationCenter(

View file

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