Commit 6e7bdeed by pidan

1、开放ipad

2、修复ATT弹窗弹不出来的问题
parent 801b60d4
......@@ -15,9 +15,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSUserUDKeys : NSObject
// 第一次允许联网
+ (NSString *)fus_FIRST_LAUNCH_NETWORK_ALLOW;
// 自动登录标记
+ (NSString *)fus_AUTO_LOGIN_MARK_BOOL;
......
......@@ -14,11 +14,6 @@
@implementation FUSUserUDKeys
// 第一次允许联网
+ (NSString *)fus_FIRST_LAUNCH_NETWORK_ALLOW {
return @"FirstLaunchNetworkAllow";
}
// 自动登录标记
+ (NSString *)fus_AUTO_LOGIN_MARK_BOOL {
return @"AutoLoginMarkBool";
......
......@@ -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;
};
......
......@@ -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
{
......
......@@ -43,6 +43,7 @@
#import "FUSRecieveNotificationHelper.h"
#import "FUSGotBackpackItemAnimView.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h>
#import "FUSTaskCenterListModel.h"
#import "FUSUserCenterModule/FUSUserCenterModule-Swift.h"
......@@ -548,28 +549,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 +569,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请求不到
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment