修复分享闪退问题
This commit is contained in:
3
Podfile
3
Podfile
@@ -60,12 +60,13 @@ target 'YuMi' do
|
||||
pod 'GKCycleScrollView', '~> 1.2.0'
|
||||
pod 'SVGAPlayer'
|
||||
|
||||
pod 'GoogleSignIn', '6.2.4'
|
||||
pod 'GoogleSignIn'
|
||||
pod 'mob_linksdk_pro'
|
||||
pod 'mob_sharesdk'
|
||||
pod 'mob_sharesdk/ShareSDKPlatforms/Apple'
|
||||
pod 'mob_sharesdk/ShareSDKPlatforms/Line'
|
||||
pod 'mob_sharesdk/ShareSDKExtension'
|
||||
pod 'mob_sharesdk/ShareSDKPlatforms/Facebook_Lite'
|
||||
|
||||
pod 'UMCommon'
|
||||
pod 'UMDevice'
|
||||
|
@@ -130,6 +130,7 @@
|
||||
18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404BA2760982000A6C548 /* ChatLimitModel.m */; };
|
||||
18F404C3276098F100A6C548 /* Api+Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404C2276098F100A6C548 /* Api+Message.m */; };
|
||||
18F404C927609A4300A6C548 /* MessagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 18F404C827609A4300A6C548 /* MessagePresenter.m */; };
|
||||
2323E0372ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 2323E0362ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m */; };
|
||||
232C43E52AB074AD00D4B2ED /* SudMGP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 232C43E42AB074AD00D4B2ED /* SudMGP.framework */; };
|
||||
232C43E72AB0755200D4B2ED /* SudMGP.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 232C43E42AB074AD00D4B2ED /* SudMGP.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
232C43EA2AB15F4100D4B2ED /* XPRoomTarrowBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 232C43E92AB15F4100D4B2ED /* XPRoomTarrowBannerView.m */; };
|
||||
@@ -1654,6 +1655,8 @@
|
||||
18F404C6276099DF00A6C548 /* MessageProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageProtocol.h; sourceTree = "<group>"; };
|
||||
18F404C727609A4300A6C548 /* MessagePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessagePresenter.h; sourceTree = "<group>"; };
|
||||
18F404C827609A4300A6C548 /* MessagePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessagePresenter.m; sourceTree = "<group>"; };
|
||||
2323E0352ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "FBSDKSettings+PISDKSettings.h"; path = "YuMi/Appdelegate/FBSDKSettings+PISDKSettings.h"; sourceTree = SOURCE_ROOT; };
|
||||
2323E0362ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "FBSDKSettings+PISDKSettings.m"; path = "YuMi/Appdelegate/FBSDKSettings+PISDKSettings.m"; sourceTree = SOURCE_ROOT; };
|
||||
232C43E42AB074AD00D4B2ED /* SudMGP.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SudMGP.framework; sourceTree = "<group>"; };
|
||||
232C43E82AB15F4100D4B2ED /* XPRoomTarrowBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTarrowBannerView.h; sourceTree = "<group>"; };
|
||||
232C43E92AB15F4100D4B2ED /* XPRoomTarrowBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTarrowBannerView.m; sourceTree = "<group>"; };
|
||||
@@ -6659,6 +6662,8 @@
|
||||
children = (
|
||||
189DD52C26DE255300AB55B1 /* AppDelegate.h */,
|
||||
189DD52D26DE255300AB55B1 /* AppDelegate.m */,
|
||||
2323E0352ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.h */,
|
||||
2323E0362ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m */,
|
||||
E81C27AC26EF39AB0031E639 /* AppDelegate+ThirdConfig.h */,
|
||||
E81C27AD26EF39AB0031E639 /* AppDelegate+ThirdConfig.m */,
|
||||
);
|
||||
@@ -10859,6 +10864,7 @@
|
||||
E81366F626F0C0DF0076364C /* LoginFullInfoPresenter.m in Sources */,
|
||||
E8A30BEE28534AB1003B4873 /* XPSessionFindNewPresenter.m in Sources */,
|
||||
9BDA3E7727FD41C200517FE6 /* XPAnchorFansTeamViewController.m in Sources */,
|
||||
2323E0372ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m in Sources */,
|
||||
23E9EAAD2A84C9B800B792F2 /* XPMineUserInfoTagItemView.m in Sources */,
|
||||
18A61BE8274F9CF000A09A54 /* SessionListViewController.m in Sources */,
|
||||
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */,
|
||||
|
@@ -14,6 +14,9 @@
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
#import <AppTrackingTransparency/AppTrackingTransparency.h>
|
||||
#import "ClientConfig.h"
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
#import "GULAppDelegateSwizzler.h"
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
@import Firebase;
|
||||
UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
|
||||
@@ -40,6 +43,8 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
}
|
||||
[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
|
||||
[FIRApp configure];
|
||||
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -119,12 +124,19 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if([url.absoluteString containsString:@"fb1266232494209868"]){
|
||||
return [[FBSDKApplicationDelegate sharedInstance] application:app
|
||||
openURL:url
|
||||
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
|
||||
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
|
||||
}
|
||||
|
||||
return [GIDSignIn.sharedInstance handleURL:url];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Core Data stack
|
||||
@synthesize managedObjectContext = _managedObjectContext;
|
||||
|
16
YuMi/Appdelegate/FBSDKSettings+PISDKSettings.h
Normal file
16
YuMi/Appdelegate/FBSDKSettings+PISDKSettings.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// FBSDKSettings+PISDKSettings.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/22.
|
||||
//
|
||||
|
||||
#import <FBSDKCoreKit/FBSDKCoreKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FBSDKSettings (PISDKSettings)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
YuMi/Appdelegate/FBSDKSettings+PISDKSettings.m
Normal file
19
YuMi/Appdelegate/FBSDKSettings+PISDKSettings.m
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// FBSDKSettings+PISDKSettings.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by duoban on 2023/9/22.
|
||||
//
|
||||
|
||||
#import "FBSDKSettings+PISDKSettings.h"
|
||||
#import "GULAppDelegateSwizzler.h"
|
||||
|
||||
|
||||
@implementation FBSDKSettings (PISDKSettings)
|
||||
///必须为FBSDKSettings添加setAutoLogAppEventsEnabled方法,不然分享时会闪退
|
||||
+(void)setAutoLogAppEventsEnabled:(BOOL)is{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -39,7 +39,19 @@
|
||||
#pragma mark - Life Style
|
||||
- (instancetype)initWithItems:(NSArray<XPShareItem *> *)items itemSize:(CGSize)itemSize shareInfo:(XPShareInfoModel *)shareInfo {
|
||||
if (self = [super init]) {
|
||||
self.items = items;
|
||||
|
||||
NSMutableArray *itemList = [NSMutableArray array];
|
||||
for (XPShareItem * item in items) {
|
||||
if (item.type == XPShareItemTagAppFriends || item.type == XPShareItemTagCopyLink) {
|
||||
item.disable = YES;
|
||||
} else {
|
||||
item.disable = [self isInstallClient:[self getSharePlatformType:item.type]];
|
||||
}
|
||||
if(item.disable == YES){
|
||||
[itemList addObject:item];
|
||||
}
|
||||
}
|
||||
self.items = itemList;
|
||||
self.itemSize =itemSize;
|
||||
self.shareInfo = shareInfo;
|
||||
[self initSubViews];
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#import "YUMINNNN.h"
|
||||
#import <GoogleSignIn/GoogleSignIn.h>
|
||||
#import <GoogleSignIn/GIDGoogleUser.h>
|
||||
#import <GoogleSignIn/GIDAuthentication.h>
|
||||
#import <GoogleSignIn/GoogleSignIn-umbrella.h>
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LoginPresenter : BaseMvpPresenter
|
||||
|
@@ -186,11 +186,8 @@
|
||||
}];
|
||||
}
|
||||
-(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration{
|
||||
|
||||
[GIDSignIn.sharedInstance signInWithConfiguration:configuration
|
||||
presentingViewController:presentingViewController
|
||||
callback:^(GIDGoogleUser * _Nullable user,
|
||||
NSError * _Nullable error) {
|
||||
[GIDSignIn sharedInstance].configuration = configuration;
|
||||
[GIDSignIn.sharedInstance signInWithPresentingViewController:presentingViewController completion:^(GIDSignInResult * _Nullable signInResult, NSError * _Nullable error) {
|
||||
if (error != nil) {
|
||||
if (error.code == kGIDSignInErrorCodeCanceled){
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
@@ -199,11 +196,11 @@
|
||||
}
|
||||
} else {
|
||||
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
|
||||
NSString * openid = user.userID;
|
||||
NSString * access_token = user.authentication.idToken.length > 0 ? user.authentication.idToken : @"";
|
||||
NSString * unionid = user.userID;
|
||||
userInfo.userName = user.profile.name;
|
||||
userInfo.avatarUrl = [[user.profile imageURLWithDimension:60] absoluteString];
|
||||
NSString * openid = signInResult.user.userID;
|
||||
NSString * access_token = signInResult.user.idToken.tokenString.length > 0 ? signInResult.user.idToken.tokenString : @"";
|
||||
NSString * unionid = signInResult.user.userID;
|
||||
userInfo.userName = signInResult.user.profile.name;
|
||||
userInfo.avatarUrl = [[signInResult.user.profile imageURLWithDimension:60] absoluteString];
|
||||
userInfo.openid = openid;
|
||||
userInfo.access_token = access_token;
|
||||
userInfo.unionid = unionid;
|
||||
@@ -212,6 +209,8 @@
|
||||
[self loginWithThirdGoogle];
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)loginWithThirdGoogle{
|
||||
|
@@ -1099,6 +1099,7 @@
|
||||
"XPMoreMenuPresenter23" = "发佈广播";
|
||||
"XPMoreMenuPresenter24" = "红包";
|
||||
"XPMoreMenuPresenter25" = "扬声器";
|
||||
"XPMoreMenuPresenter26" = "PK中...";
|
||||
"XPMoreMenuPresenter27" = "关闭礼物值";
|
||||
"XPMoreMenuPresenter28" = "关闭我的特效";
|
||||
"XPMoreMenuPresenter29" = "相亲中..";
|
||||
|
@@ -1106,6 +1106,7 @@
|
||||
"XPMoreMenuPresenter23" = "發佈廣播";
|
||||
"XPMoreMenuPresenter24" = "紅包";
|
||||
"XPMoreMenuPresenter25" = "揚聲器";
|
||||
"XPMoreMenuPresenter26" = "PK中...";
|
||||
"XPMoreMenuPresenter27" = "關閉禮物值";
|
||||
"XPMoreMenuPresenter28" = "關閉我的特效";
|
||||
"XPMoreMenuPresenter29" = "相親中..";
|
||||
|
Reference in New Issue
Block a user