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
d0471c88
authored
Jul 03, 2026
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复fb分享返回码错误的问题
parent
d328e912
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
67 deletions
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/FUSSocialLogin/FUSThirdAccountLoginHelper.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/ThirdParty/TwitterHelper/FacebookHelper/FUSFacebookHelper.swift
FuSiLive.xcodeproj/project.pbxproj
FuSiLive/AppDelegate.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/FUSSocialLogin/FUSThirdAccountLoginHelper.m
View file @
d0471c88
...
...
@@ -118,6 +118,64 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
@implementation
FUSThirdAccountLoginHelper
/**
刷新第三方登录回调使用的 URL Scheme 配置
*/
-
(
void
)
fus_refreshSocialPlatformURLKeys
{
NSDictionary
*
infoDict
=
[[
NSBundle
mainBundle
]
infoDictionary
];
NSArray
*
urlSchemes
=
[
infoDict
objectForKey
:
@"CFBundleURLTypes"
];
for
(
NSDictionary
*
subDict
in
urlSchemes
)
{
NSArray
*
keyArr
=
[
subDict
objectForKey
:
@"CFBundleURLSchemes"
];
for
(
NSString
*
urlKey
in
keyArr
)
{
NSString
*
lowercasedKey
=
urlKey
.
lowercaseString
;
if
([
lowercasedKey
hasPrefix
:
@"fb"
])
{
self
.
facebookKey
=
urlKey
;
}
if
([
lowercasedKey
containsString
:
@"google"
])
{
self
.
googleKey
=
urlKey
;
}
if
([
lowercasedKey
containsString
:
@"twitter"
])
{
self
.
twitterKey
=
urlKey
;
}
if
([
lowercasedKey
containsString
:
@"line"
])
{
self
.
lineKey
=
urlKey
;
}
if
([
lowercasedKey
containsString
:
@"wx"
])
{
self
.
weixinKey
=
urlKey
;
}
}
}
}
/**
判断回调 URL 是否是 Facebook Scheme
*/
-
(
BOOL
)
fus_isFacebookOpenURL
:
(
NSURL
*
)
url
{
if
(
self
.
facebookKey
.
length
==
0
)
{
[
self
fus_refreshSocialPlatformURLKeys
];
}
NSString
*
scheme
=
url
.
scheme
.
lowercaseString
;
NSString
*
facebookScheme
=
self
.
facebookKey
.
lowercaseString
;
if
(
scheme
.
length
==
0
||
!
[
scheme
hasPrefix
:
@"fb"
])
{
return
NO
;
}
if
(
facebookScheme
.
length
==
0
)
{
return
YES
;
}
return
[
scheme
isEqualToString
:
facebookScheme
];
}
#pragma mark - 获取单例
/**
获取单例
...
...
@@ -674,44 +732,18 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
self
.
googleKey
.
length
==
0
||
self
.
twitterKey
.
length
==
0
||
self
.
lineKey
.
length
==
0
)
{
NSDictionary
*
infoDict
=
[[
NSBundle
mainBundle
]
infoDictionary
];
NSArray
*
urlSchemes
=
[
infoDict
objectForKey
:
@"CFBundleURLTypes"
];
for
(
NSDictionary
*
subDict
in
urlSchemes
)
{
NSArray
*
keyArr
=
[
subDict
objectForKey
:
@"CFBundleURLSchemes"
];
for
(
NSString
*
urlKey
in
keyArr
)
{
if
([
urlKey
hasPrefix
:
@"fb"
])
{
self
.
facebookKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"google"
])
{
self
.
googleKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"twitter"
])
{
self
.
twitterKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"line"
])
{
self
.
lineKey
=
urlKey
;
}
}
}
[
self
fus_refreshSocialPlatformURLKeys
];
}
FUSLogInfo
(
@"第三方企图打开:%@"
,
url
.
absoluteURL
);
if
([
url
.
absoluteString
containsString
:
self
.
googleKey
])
{
// 是
google 的 k
ey
if
([
self
fus_isFacebookOpenURL
:
url
])
{
// 是
Facebook 的 K
ey
return
YES
;
}
if
([
url
.
absoluteString
containsString
:
self
.
facebook
Key
])
{
// 是
Facebook 的 K
ey
if
([
url
.
absoluteString
containsString
:
self
.
google
Key
])
{
// 是
google 的 k
ey
return
YES
;
}
...
...
@@ -725,6 +757,11 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
return
YES
;
}
if
([
url
.
absoluteString
hasPrefix
:
@"fb"
])
{
// 是 Facebook 的 Key
return
YES
;
}
return
NO
;
}
...
...
@@ -804,41 +841,10 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
if
(
self
.
facebookKey
.
length
==
0
||
self
.
googleKey
.
length
==
0
||
self
.
twitterKey
.
length
==
0
||
self
.
lineKey
.
length
==
0
||
self
.
weixinKey
.
length
==
0
)
{
NSDictionary
*
infoDict
=
[[
NSBundle
mainBundle
]
infoDictionary
];
NSArray
*
urlSchemes
=
[
infoDict
objectForKey
:
@"CFBundleURLTypes"
];
for
(
NSDictionary
*
subDict
in
urlSchemes
)
{
NSArray
*
keyArr
=
[
subDict
objectForKey
:
@"CFBundleURLSchemes"
];
for
(
NSString
*
urlKey
in
keyArr
)
{
if
([
urlKey
hasPrefix
:
@"fb"
])
{
self
.
facebookKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"google"
])
{
self
.
googleKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"twitter"
])
{
self
.
twitterKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"line"
])
{
self
.
lineKey
=
urlKey
;
}
if
([
urlKey
containsString
:
@"wx"
])
{
self
.
weixinKey
=
urlKey
;
}
}
}
[
self
fus_refreshSocialPlatformURLKeys
];
}
if
([
url
.
absoluteString
containsString
:
self
.
facebookKey
])
{
if
([
self
fus_isFacebookOpenURL
:
url
])
{
return
FUSSocializedPlatformFacebook
;
}
...
...
@@ -858,6 +864,10 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
return
FUSSocializedPlatformWeChat
;
}
if
([
url
.
absoluteString
hasPrefix
:
@"fb"
])
{
return
FUSSocializedPlatformFacebook
;
}
return
0
;
}
...
...
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Tools/ThirdParty/TwitterHelper/FacebookHelper/FUSFacebookHelper.swift
View file @
d0471c88
...
...
@@ -251,7 +251,7 @@ extension FUSFacebookHelper: SharingDelegate{
public
func
sharerDidCancel
(
_
sharer
:
any
FBSDKShareKit
.
Sharing
)
{
Settings
.
shared
.
appID
=
FUSConfig
.
sharedInstanced
()
.
sdkConfigs
.
facebookShareKey
Settings
.
shared
.
clientToken
=
FUSConfig
.
sharedInstanced
()
.
sdkConfigs
.
facebookShareSecret
share
SuccessHandle
?(
)
share
FailureHandle
?(
true
)
self
.
shareSuccessHandle
=
nil
self
.
shareFailureHandle
=
nil
Settings
.
shared
.
appID
=
FUSConfig
.
sharedInstanced
()
.
sdkConfigs
.
facebookShareKey
...
...
FuSiLive.xcodeproj/project.pbxproj
View file @
d0471c88
...
...
@@ -691,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2026054
6
;
CURRENT_PROJECT_VERSION
=
2026054
7
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
@@ -956,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2026054
6
;
CURRENT_PROJECT_VERSION
=
2026054
7
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
FuSiLive/AppDelegate.m
View file @
d0471c88
...
...
@@ -191,6 +191,11 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
return
[[
FUSThirdAccountLoginHelper
sharedInstanse
]
fus_sociallizedPlatform
:
platform
OpenApplication
:
app
openURL
:
url
options
:
options
];
}
// NSString *urlScheme = url.scheme.lowercaseString;
// if ([urlScheme hasPrefix:@"fb"]) {
// return [[FUSThirdAccountLoginHelper sharedInstanse] fus_sociallizedPlatform:FUSSocializedPlatformFacebook OpenApplication:app openURL:url options:options];
// }
NSString
*
urlDecodingString
=
[
FUSUrlDecode
fus_urlDecodedString
:
url
.
absoluteString
];
//TODO:看看这是要做咩: added By Pidan
if
([
urlDecodingString
containsString
:
@"FusiClub://www.fusiclub.com"
])
{
...
...
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