From 7226ff6da6dcded3a26ab1b50449cdf5f6147f0a Mon Sep 17 00:00:00 2001 From: Sean Date: Wed, 12 Jun 2024 10:51:14 +0800 Subject: [PATCH] noty3 --- .../ExtensionApi/Location/FATExt_chooseLocation.m | 10 ++++++++-- .../ExtensionApi/Location/FATExt_getLocation.m | 14 +++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_chooseLocation.m b/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_chooseLocation.m index d292165..5561dcd 100644 --- a/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_chooseLocation.m +++ b/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_chooseLocation.m @@ -44,8 +44,10 @@ } } - [[NSNotificationCenter defaultCenter] postNotificationName:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE_GET" object:NULL userInfo:NULL]; - + [[NSNotificationCenter defaultCenter]removeObserver:self]; + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(handleNotification:) name:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE_END" object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE" object:NULL userInfo:@{@"type":@"chooseLocation"}]; + [[FATClient sharedClient] fat_requestAppletAuthorize:FATAuthorizationTypeLocation appletId:self.appletInfo.appId complete:^(NSInteger status) { if (status == 0) { [[FATExt_locationAuthManager shareInstance] fat_requestAppletLocationAuthorize:self.appletInfo isBackground:NO withComplete:^(BOOL status) { @@ -96,4 +98,8 @@ [topVC presentViewController:nav animated:YES completion:nil]; } +- (void)handleNotification:(NSNotification *)notification { + NSLog(@"sean=========handleNotification"); +} + @end diff --git a/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_getLocation.m b/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_getLocation.m index 3fe1435..991e645 100644 --- a/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_getLocation.m +++ b/ios/Classes/FinAppletExt/ExtensionApi/Location/FATExt_getLocation.m @@ -53,9 +53,11 @@ self.success = success; self.failure = failure; -// FATAppletInfo *appInfo = [[FATClient sharedClient] currentApplet]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE_GET" object:NULL userInfo:NULL]; - + [[NSNotificationCenter defaultCenter]removeObserver:self]; + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(handleNotification:) name:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE_END" object:nil]; + // FATAppletInfo *appInfo = [[FATClient sharedClient] currentApplet]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"PHIZ_NOTIFICATION_LOCATION_AUTHORIZE" object:NULL userInfo:@{@"type":@"gteLocation"}]; + [[FATClient sharedClient] fat_requestAppletAuthorize:FATAuthorizationTypeLocation appletId:self.appletInfo.appId complete:^(NSInteger status) { if (status == 0) { //定位功能可用 @@ -141,4 +143,10 @@ } } + +- (void)handleNotification:(NSNotification *)notification { + NSLog(@"sean=========handleNotification"); +} + + @end