SocialSDK
升级SDK
المقدمة: تنفيذ وظائف تسجيل الدخول والمشاركة في Sina WeChat QQ
SocialSDK | ف ف (SDK) | سينا (SDK) | ويشات (SDK) |
---|---|---|---|
0.0.3 | 3.1.3 | 3.1.4 | 1.7.5 |
0.0.4 | 3.2.1 | 3.1.4 | 1.7.7 |
0.0.5 | 3.3.3 | 3.1.4 | 1.8.2 |
منصة | يشارك | تسجيل الدخول | يدفع |
---|---|---|---|
سينا | √ | √ | × |
ف ف | √ | √ | × |
ويشات | √ | √ | × |
قناة | نص عادي | صورة واحدة | الرابط العادي | رابط الصوت | رابط الفيديو |
---|---|---|---|---|---|
سينا | √ | √ | √ | √ | √ |
ف ف | √ | √ | √ | √ | √ |
كيوزون | √ | √ | √ | √ | √ |
WechatSession | √ | √ | √ | √ | √ |
WechatTimeLine | √ | √ | √ | √ | √ |
تنقسم كتابة podfile
إلى حالتين: هل use_frameworks!
1. إذا use_frameworks!
pod 'SocialSDK'
2. استخدم use_frameworks!
pod 'SocialSDK_UF'
pod 'SocialSDK_R'
اسحب ملف الفئات مباشرة إلى مشروعك الخاص وأضف ملفات الموارد في الموارد (يوصى باستخدام CocoaPods).
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>sina.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
</dict>
<key>weibo.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
</dict>
<key>weibo.com</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
< true />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
</dict>
<key>sinaimg.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
< true />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
</dict>
<key>sinajs.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
< true />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
</dict>
<key>sina.com.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
< true />
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
< true />
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1 .0 </string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
< false />
</dict>
</dict>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<!-- 微信 URL Scheme 白名单-->
<string>wechat</string>
<string>weixin</string>
<!-- 新浪微博 URL Scheme 白名单-->
<string>sinaweibohd</string>
<string>sinaweibo</string>
<string>weibosdk</string>
<string>weibosdk2 .5 </string>
<!-- QQ、Qzone URL Scheme 白名单-->
<string>mqqapi</string>
<string>mqq</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqconnect</string>
<string>mqqopensdkdataline</string>
<string>mqqopensdkgrouptribeshare</string>
<string>mqqopensdkfriend</string>
<string>mqqopensdkapi</string>
<string>mqqopensdkapiV2</string>
<string>mqqopensdkapiV3</string>
<string>mqqopensdkapiV4</string>
<string>mqzoneopensdk</string>
<string>wtloginmqq</string>
<string>wtloginmqq2</string>
<string>mqqwpa</string>
<string>mqzone</string>
<string>mqzonev2</string>
<string>mqzoneshare</string>
<string>wtloginqzone</string>
<string>mqzonewx</string>
<string>mqzoneopensdkapiV2</string>
<string>mqzoneopensdkapi19</string>
<string>mqzoneopensdkapi</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
</array>
قم بإجراء التكوين التالي في AppDelegate.m
# import " GSPlatformParamConfigManager.h "
# import " GSSocialManager.h "
- ( BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions
{
[[GSPlatformParamConfigManager share ] addSinaPlatformConfigAppKey: @" " redirectURI: @" " ];
[[GSPlatformParamConfigManager share ] addQQPlatformConfigAppID: @" " ];
[[GSPlatformParamConfigManager share ] addWeChatPlatformConfigAppID: @" " secret: @" " ];
return YES ;
}
- ( BOOL )application:(UIApplication *)app openURL:( NSURL *)url options:( NSDictionary <UIApplicationOpenURLOptionsKey, id > *)options
{
BOOL res = [[GSSocialManager share ] handleOpenURL: url];
if (!res) {
//做其他SDK回调处理
}
return res;
}
- ( BOOL )application:(UIApplication *)application handleOpenURL:( NSURL *)url
{
BOOL res = [[GSSocialManager share ] handleOpenURL: url];
if (!res) {
//做其他SDK回调处理
}
return res;
}
# import " GSSelectView.h "
# import " GSShareChannelType.h "
# import " GSLoginManager.h "
[GSSelectView showShareViewWithChannels: @[
@(GSShareChannelTypeSina),
@(GSShareChannelTypeQQ),
@(GSShareChannelTypeQzone),
@(GSShareChannelTypeWechatSession)
] completionBlock: ^( BOOL isCancel, GSLogoReourcesType reourcesType) {
if (isCancel) {
} else {
id <GSLoginProtocol> login = [[GSLoginManager share ] getShareProtocolWithChannelType: [GSLoginManager getShareChannelTypeWithLogoReourcesType: reourcesType]];
[login setLoginCompletionBlock: ^( id <GSLoginResultProtocol> result) {
}];
[login doLogin ];
}
}];
# import " GSSelectView.h "
# import " GSShareChannelType.h "
# import " GSShareManager.h "
[GSSelectView showShareViewWithChannels: @[
@(GSShareChannelTypeSina),
@(GSShareChannelTypeQQ),
@(GSShareChannelTypeQzone),
@(GSShareChannelTypeWechatSession)
] completionBlock: ^( BOOL isCancel, GSLogoReourcesType reourcesType) {
if (isCancel) {
} else {
id <GSShareProtocol> share = [[GSShareManager share ] getShareProtocolWithChannelType: [GSShareManager getShareChannelTypeWithLogoReourcesType: reourcesType]];
[share shareSimpleText: @" good day " ];
[share setShareCompletionBlock: ^( id <GSShareResultProtocol> result) {
}];
}
}];
س: 470058952
حسابي على وي شات:
SocialSDK موجود ضمن WTFPL، يمكنك أن تفعل ما تريد باستخدام SocialSDK، راجع ملف الترخيص لمزيد من المعلومات.