mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 05:22:13 +00:00
fix ios click on push notifications not working
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
fe2dd06213
commit
d0eee1893e
2 changed files with 26 additions and 14 deletions
|
|
@ -36,7 +36,9 @@ 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) {
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
if (_homeViewPageController.hasClients) {
|
||||||
_homeViewPageController.jumpToPage(index);
|
_homeViewPageController.jumpToPage(index);
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_activePageIdx = index;
|
_activePageIdx = index;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue