Commit 51c536a4 by pierce

1、修复微信登录异常的问题

2、去除通用弹窗顶部的图片
parent a4f4f9bd
...@@ -51,4 +51,6 @@ public protocol GDSocialCenterSwiftRouter: GDSocialCenterRouter { ...@@ -51,4 +51,6 @@ public protocol GDSocialCenterSwiftRouter: GDSocialCenterRouter {
/// - type: 分享类型 /// - type: 分享类型
/// - completion: 完成回调 /// - completion: 完成回调
func share(with model: GDShareModel, expireTime: CGFloat) func share(with model: GDShareModel, expireTime: CGFloat)
func handlerWithUserActivity(_ userActivity:NSUserActivity) -> Bool
} }
...@@ -235,7 +235,7 @@ public class GDAlertView: BaseView { ...@@ -235,7 +235,7 @@ public class GDAlertView: BaseView {
width: 280, width: 280,
height: 180)) height: 180))
private let bgImageView = UIImageView(image: GDToolBoxBundle.imageNamed("alert_bg")?.resizableImage(withCapInsets: .init(top: 48, left: 24, bottom: 24, right: 24), resizingMode: .stretch)) // private let bgImageView = UIImageView(image: GDToolBoxBundle.imageNamed("alert_bg")?.resizableImage(withCapInsets: .init(top: 48, left: 24, bottom: 24, right: 24), resizingMode: .stretch))
private let titleLabel = YYLabel(frame: .zero) private let titleLabel = YYLabel(frame: .zero)
private let contentLabel = YYLabel(frame: .zero) private let contentLabel = YYLabel(frame: .zero)
private let buttonBgView = UIView(frame: .zero) private let buttonBgView = UIView(frame: .zero)
...@@ -262,13 +262,13 @@ public class GDAlertView: BaseView { ...@@ -262,13 +262,13 @@ public class GDAlertView: BaseView {
bgView.layer.cornerRadius = 15 bgView.layer.cornerRadius = 15
self.addSubview(bgView) self.addSubview(bgView)
bgImageView.contentMode = .scaleToFill // bgImageView.contentMode = .scaleToFill
bgView.addSubview(bgImageView) // bgView.addSubview(bgImageView)
//
bgImageView.snp.makeConstraints { make in // bgImageView.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(-2) // make.left.top.equalToSuperview().offset(-2)
make.right.bottom.equalToSuperview().offset(2) // make.right.bottom.equalToSuperview().offset(2)
} // }
} }
private func makeContentView() { private func makeContentView() {
......
...@@ -50,6 +50,24 @@ public class GDSocialCenterModule: NSObject, GDSocialCenterSwiftRouter { ...@@ -50,6 +50,24 @@ public class GDSocialCenterModule: NSObject, GDSocialCenterSwiftRouter {
public func share(with model: GDShareModel, expireTime: CGFloat) { public func share(with model: GDShareModel, expireTime: CGFloat) {
GDSocialPlatCenter.shared.share(with: model, expireTime: expireTime) GDSocialPlatCenter.shared.share(with: model, expireTime: expireTime)
} }
public func handlerWithUserActivity(_ userActivity:NSUserActivity) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
if let url = userActivity.webpageURL {
let center = GDSocialPlatCenter.shared
if url.absoluteString.contains(GDSDK.gd_wechatAppid) {
// 微信
return center.handle(for: .wechat, userActivity: userActivity)
} else {
// QQ
return center.handle(for: .qq, userActivity: userActivity)
}
}
}
return true
}
} }
extension GDSocialCenterModule: BifrostModuleProtocol { extension GDSocialCenterModule: BifrostModuleProtocol {
...@@ -88,21 +106,4 @@ extension GDSocialCenterModule: BifrostModuleProtocol { ...@@ -88,21 +106,4 @@ extension GDSocialCenterModule: BifrostModuleProtocol {
return true return true
} }
} }
public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
if let url = userActivity.webpageURL {
if url.absoluteString.contains(GDSDK.gd_wechatAppid) {
// 微信
return GDSocialPlatCenter.shared.handle(for: .wechat, userActivity: userActivity)
} else {
// QQ
return GDSocialPlatCenter.shared.handle(for: .qq, userActivity: userActivity)
}
}
}
return true
}
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import UIKit import UIKit
import Bifrost import Bifrost
import GDToolBox import GDToolBox
import GDRouter
@main @main
class AppDelegate: UIResponder, UIApplicationDelegate { class AppDelegate: UIResponder, UIApplicationDelegate {
...@@ -37,7 +38,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +38,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool { func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {
Bifrost.checkAllModules(with: #selector(application(_:continue:restorationHandler:)), arguments: [application, userActivity, restorationHandler])
return GDRouter.SocialCenter?.handlerWithUserActivity(userActivity) ?? true
} }
func applicationDidBecomeActive(_ application: UIApplication) { func applicationDidBecomeActive(_ application: UIApplication) {
......
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