Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
477602df
authored
May 26, 2025
by
pidan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改权限弹窗的弹出逻辑
parent
801b60d4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
60 deletions
DevelopmentPods/FUSCommon/FUSCommon/FUSRouter/Routers/UserRouter/FUSUserPublicDefine.h
DevelopmentPods/FUSCommon/FUSCommon/FUSRouter/Routers/UserRouter/FUSUserPublicDefine.m
FuSiLive.xcodeproj/project.pbxproj
FuSiLive/AppDelegate.m
Modules/FUSUserCenterModule/FUSUserCenterModule/Router/FUSUserCenterRouter.m
DevelopmentPods/FUSCommon/FUSCommon/FUSRouter/Routers/UserRouter/FUSUserPublicDefine.h
View file @
477602df
...
...
@@ -15,9 +15,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface
FUSUserUDKeys
:
NSObject
// 第一次允许联网
+
(
NSString
*
)
fus_FIRST_LAUNCH_NETWORK_ALLOW
;
// 自动登录标记
+
(
NSString
*
)
fus_AUTO_LOGIN_MARK_BOOL
;
...
...
DevelopmentPods/FUSCommon/FUSCommon/FUSRouter/Routers/UserRouter/FUSUserPublicDefine.m
View file @
477602df
...
...
@@ -14,11 +14,6 @@
@implementation
FUSUserUDKeys
// 第一次允许联网
+
(
NSString
*
)
fus_FIRST_LAUNCH_NETWORK_ALLOW
{
return
@"FirstLaunchNetworkAllow"
;
}
// 自动登录标记
+
(
NSString
*
)
fus_AUTO_LOGIN_MARK_BOOL
{
return
@"AutoLoginMarkBool"
;
...
...
FuSiLive.xcodeproj/project.pbxproj
View file @
477602df
...
...
@@ -751,7 +751,7 @@
SWIFT_EMIT_LOC_STRINGS
=
NO
;
SWIFT_OBJC_BRIDGING_HEADER
=
"FuSiLive/Classes/FusiLive-Bridging-Header.h"
;
SWIFT_VERSION
=
5.0
;
TARGETED_DEVICE_FAMILY
=
1
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
};
name
=
Debug
;
};
...
...
@@ -1034,7 +1034,7 @@
SWIFT_EMIT_LOC_STRINGS
=
NO
;
SWIFT_OBJC_BRIDGING_HEADER
=
"FuSiLive/Classes/FusiLive-Bridging-Header.h"
;
SWIFT_VERSION
=
5.0
;
TARGETED_DEVICE_FAMILY
=
1
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
};
name
=
Release
;
};
...
...
FuSiLive/AppDelegate.m
View file @
477602df
...
...
@@ -44,15 +44,7 @@ static NSString *const kGtAppSecret = @"OSSSWqbWY0ACJiUv4AHdW7";
// 第一次启动执行
[
self
firstLaunchHandle
];
// 通过 个推平台 分配的appId、 appKey 、appSecret 启动SDK,注:该方法需要在主线程中调用
[
GeTuiSdk
startSdkWithAppId
:
kGtAppId
appKey
:
kGtAppKey
appSecret
:
kGtAppSecret
delegate
:
self
launchingOptions
:
launchOptions
];
[
GeTuiSdk
registerRemoteNotification
:
UNAuthorizationOptionSound
|
UNAuthorizationOptionAlert
|
UNAuthorizationOptionBadge
|
UNAuthorizationOptionProvidesAppNotificationSettings
];
[
GeTuiSdk
runBackgroundEnable
:
NO
];
// [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:UNAuthorizationOptionBadge|UNAuthorizationOptionSound|UNAuthorizationOptionAlert|UNAuthorizationOptionProvidesAppNotificationSettings completionHandler:^(BOOL granted, NSError * _Nullable error) {
// }];
// [UNUserNotificationCenter currentNotificationCenter].delegate = self;
// [UIApplication.sharedApplication registerForRemoteNotifications];
[
self
fus_appStartPermissionCheckWithOptions
:
launchOptions
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
FIRApp
configure
];
...
...
@@ -85,9 +77,65 @@ static NSString *const kGtAppSecret = @"OSSSWqbWY0ACJiUv4AHdW7";
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
FUSLiveUDKeys
.
fus_SHOULD_REMOTE_NOTIFICATION_TIP
];
// 请求sh状态
[
self
fus_checkAppStatus
];
return
YES
;
}
-
(
void
)
fus_appStartPermissionCheckWithOptions
:(
NSDictionary
*
)
launchOptions
{
// 标记是否在一个生命周期内
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
FUSUserUDKeys
.
fus_IS_FIRST_ENTER_APP_CURRENT
];
// 在应用启动时开始监听网络状态,因为我们现在所有接口都需要上传网络状态,之前是在登录成功那里开始监听。这就导致了有一些接口的网络状态监听不到:added by pidan
__block
BOOL
firstLaunchNetworkAllow
=
NO
;
/// 先弹出检测网络弹窗
[
FUSHttpHelper
fus_monitorNetWorkStatus
:
^
(
AFNetworkReachabilityStatus
status
)
{
/// 再弹出检测通知弹窗
[
UNUserNotificationCenter
.
currentNotificationCenter
requestAuthorizationWithOptions
:
UNAuthorizationOptionSound
|
UNAuthorizationOptionAlert
|
UNAuthorizationOptionBadge
|
UNAuthorizationOptionProvidesAppNotificationSettings
completionHandler
:
^
(
BOOL
granted
,
NSError
*
_Nullable
error
)
{
// 通过 个推平台 分配的appId、 appKey 、appSecret 启动SDK,注:该方法需要在主线程中调用
[
GeTuiSdk
startSdkWithAppId
:
kGtAppId
appKey
:
kGtAppKey
appSecret
:
kGtAppSecret
delegate
:
self
launchingOptions
:
launchOptions
];
[
GeTuiSdk
registerRemoteNotification
:
UNAuthorizationOptionSound
|
UNAuthorizationOptionAlert
|
UNAuthorizationOptionBadge
|
UNAuthorizationOptionProvidesAppNotificationSettings
];
[
GeTuiSdk
runBackgroundEnable
:
NO
];
if
(
status
>
0
&&
!
firstLaunchNetworkAllow
)
{
firstLaunchNetworkAllow
=
YES
;
[
self
fus_checkAppStatus
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
FUSAPIDNSManager
fus_checkCurrentDNSAddress
];
[
FUSEventTrack
fus_initial
];
});
}
}];
}];
}
/**
请求APP状态
*/
-
(
void
)
fus_checkAppStatus
{
[
FUSCommonHttpRequest
fus_checkAppStatuWithSuccess
:
^
(
NSString
*
appStatus
)
{
//黑名单帐号登录过
BOOL
isCheckCountLogined
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
FUSUserUDKeys
.
fus_CHECKCOUNT_LOGINED
]
boolValue
];
if
(
isCheckCountLogined
)
{
appStatus
=
@"1"
;
}
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
appStatus
forKey
:
kFUSConfigAppStatusUDKey
];
[
FUSLocalizationHelper
fus_initLocalizationIfNeed
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatusUpdateNotificationKey
object
:
nil
];
}
failure
:
^
(
NSString
*
msg
)
{
[
FUSLocalizationHelper
fus_initLocalizationIfNeed
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatusUpdateNotificationKey
object
:
nil
];
}];
}
// 支付回调, 9.0以后使用新API接口
-
(
BOOL
)
application
:
(
UIApplication
*
)
app
openURL
:
(
NSURL
*
)
url
options
:
(
NSDictionary
<
NSString
*
,
id
>
*
)
options
{
...
...
Modules/FUSUserCenterModule/FUSUserCenterModule/Router/FUSUserCenterRouter.m
View file @
477602df
...
...
@@ -43,6 +43,9 @@
#import "FUSRecieveNotificationHelper.h"
#import "FUSGotBackpackItemAnimView.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h>
#import <UserNotifications/UserNotifications.h>
#import <GTSDK/GeTuiSdk.h>
#import "FUSTaskCenterListModel.h"
#import "FUSUserCenterModule/FUSUserCenterModule-Swift.h"
...
...
@@ -548,28 +551,9 @@
#pragma mark - UIApplicationDelegate
-
(
BOOL
)
application
:
(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:
(
NSDictionary
<
UIApplicationLaunchOptionsKey
,
id
>
*
)
launchOptions
{
[
FUSEventTrack
fus_initial
];
// 标记是否在一个生命周期内
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
FUSUserUDKeys
.
fus_IS_FIRST_ENTER_APP_CURRENT
];
// 在应用启动时开始监听网络状态,因为我们现在所有接口都需要上传网络状态,之前是在登录成功那里开始监听。这就导致了有一些接口的网络状态监听不到:added by pidan
BOOL
firstLaunchNetworkAllow
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
FUSUserUDKeys
.
fus_FIRST_LAUNCH_NETWORK_ALLOW
]
boolValue
];
[
FUSHttpHelper
fus_monitorNetWorkStatus
:
^
(
AFNetworkReachabilityStatus
status
)
{
if
(
status
>
0
&&
!
firstLaunchNetworkAllow
)
{
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
@
(
YES
)
forKey
:
FUSUserUDKeys
.
fus_FIRST_LAUNCH_NETWORK_ALLOW
];
[
self
checkAppStatus
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
FUSAPIDNSManager
fus_checkCurrentDNSAddress
];
[
FUSEventTrack
fus_initial
];
});
}
}];
[
self
fus_startAPPPages
];
// 请求sh状态
[
self
checkAppStatus
];
[[
FUSKeyboardShowHelper
sharedInstance
]
star
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -587,28 +571,6 @@
return
YES
;
}
/**
请求APP状态
*/
-
(
void
)
checkAppStatus
{
[
FUSCommonHttpRequest
fus_checkAppStatuWithSuccess
:
^
(
NSString
*
appStatus
)
{
//黑名单帐号登录过
BOOL
isCheckCountLogined
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
FUSUserUDKeys
.
fus_CHECKCOUNT_LOGINED
]
boolValue
];
if
(
isCheckCountLogined
)
{
appStatus
=
@"1"
;
}
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
appStatus
forKey
:
kFUSConfigAppStatusUDKey
];
[
FUSLocalizationHelper
fus_initLocalizationIfNeed
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatusUpdateNotificationKey
object
:
nil
];
}
failure
:
^
(
NSString
*
msg
)
{
[
FUSLocalizationHelper
fus_initLocalizationIfNeed
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatusUpdateNotificationKey
object
:
nil
];
}];
}
-
(
void
)
fus_startAPPPages
{
// ludy:这里加一个,防止一开始请求checkappversion请求不到
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment