mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 03:42: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
|
|
@ -13,7 +13,7 @@ import workmanager_apple
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
UNUserNotificationCenter.current().delegate = self
|
UNUserNotificationCenter.current().delegate = self
|
||||||
|
|
||||||
if let registrar = self.registrar(forPlugin: "VideoCompressionChannel") {
|
if let registrar = self.registrar(forPlugin: "VideoCompressionChannel") {
|
||||||
VideoCompressionChannel.register(with: registrar.messenger())
|
VideoCompressionChannel.register(with: registrar.messenger())
|
||||||
}
|
}
|
||||||
|
|
@ -32,20 +32,22 @@ import workmanager_apple
|
||||||
WorkmanagerPlugin.registerBGProcessingTask(
|
WorkmanagerPlugin.registerBGProcessingTask(
|
||||||
withIdentifier: "eu.twonly.processing_task"
|
withIdentifier: "eu.twonly.processing_task"
|
||||||
)
|
)
|
||||||
|
|
||||||
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(
|
||||||
|
|
@ -86,4 +89,4 @@ import workmanager_apple
|
||||||
completionHandler([.alert, .sound])
|
completionHandler([.alert, .sound])
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue