升级SDK版本

This commit is contained in:
v7lin 2021-06-05 18:23:36 +08:00
parent 5c64d1dfda
commit e6dc6cd2f9
13 changed files with 45 additions and 32 deletions

View File

@ -24,6 +24,7 @@ flutter版新浪微博SDK
* [iOS ](https://open.weibo.com/wiki/Sdk/ios) * [iOS ](https://open.weibo.com/wiki/Sdk/ios)
* [Android Github](https://github.com/sinaweibosdk/weibo_android_sdk) * [Android Github](https://github.com/sinaweibosdk/weibo_android_sdk)
* [iOS Github](https://github.com/sinaweibosdk/weibo_ios_sdk) * [iOS Github](https://github.com/sinaweibosdk/weibo_ios_sdk)
* [Universal Links](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content)
## android ## android

View File

@ -1,5 +1,5 @@
group 'io.github.v7lin.weibo_kit' group 'io.github.v7lin.weibo_kit'
version '2.0.1' version '2.0.2'
buildscript { buildscript {
repositories { repositories {
@ -17,9 +17,9 @@ rootProject.allprojects {
google() google()
jcenter() jcenter()
// weibo //
maven { flatDir {
url 'https://dl.bintray.com/thelasterstar/maven/' dirs project(':weibo_kit').file('libs')
} }
} }
} }
@ -53,7 +53,7 @@ android {
} }
dependencies { dependencies {
// v9.12.0 // v10.10.0
vendorImplementation 'androidx.appcompat:appcompat:1.0.0' vendorImplementation 'androidx.appcompat:appcompat:1.0.0'
vendorImplementation 'com.sina.weibo.sdk:core:9.12.0:openDefaultRelease@aar' vendorImplementation(name: 'openDefault-10.10.0', ext: 'aar')
} }

Binary file not shown.

View File

@ -8,13 +8,13 @@ PODS:
- sqflite (0.0.2): - sqflite (0.0.2):
- Flutter - Flutter
- FMDB (>= 2.7.5) - FMDB (>= 2.7.5)
- weibo_kit (2.0.1): - weibo_kit (2.0.2):
- Flutter - Flutter
- weibo_kit/vendor (= 2.0.1) - weibo_kit/vendor (= 2.0.2)
- weibo_kit/vendor (2.0.1): - weibo_kit/vendor (2.0.2):
- Flutter - Flutter
- Weibo_SDK (~> 3.2.7) - Weibo_SDK (~> 3.3.0)
- Weibo_SDK (3.2.7) - Weibo_SDK (3.3.0)
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
@ -42,8 +42,8 @@ SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
weibo_kit: 173edbfbab7b05cc9c64a7c365ea331f3c5c0797 weibo_kit: 4a56eb617b67edb586e294fb52658e67b4285500
Weibo_SDK: 5a4d08f7e1fedbb635435e4585c8c0439c7da089 Weibo_SDK: 7478846cccb43c4785ba76b214115fb7ec9dc0d4
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d

View File

@ -311,7 +311,6 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -389,7 +388,6 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -445,7 +443,6 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;

View File

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

View File

@ -8,6 +8,7 @@ import 'package:image/image.dart' as image;
import 'package:weibo_kit/weibo_kit.dart'; import 'package:weibo_kit/weibo_kit.dart';
const String _WEIBO_APP_KEY = 'your weibo app key'; const String _WEIBO_APP_KEY = 'your weibo app key';
const String _WEIBO_UNIVERSAL_LINK = 'your weibo universal link';
const List<String> _WEIBO_SCOPE = <String>[ const List<String> _WEIBO_SCOPE = <String>[
WeiboScope.ALL, WeiboScope.ALL,
]; ];
@ -16,6 +17,7 @@ void main() {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
Weibo.instance.registerApp( Weibo.instance.registerApp(
appKey: _WEIBO_APP_KEY, appKey: _WEIBO_APP_KEY,
universalLink: _WEIBO_UNIVERSAL_LINK,
scope: _WEIBO_SCOPE, scope: _WEIBO_SCOPE,
); );
runApp(MyApp()); runApp(MyApp());

View File

@ -14,7 +14,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0" version: "2.6.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -239,7 +239,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
sqflite: sqflite:
dependency: transitive dependency: transitive
description: description:
@ -295,7 +295,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19" version: "0.3.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -323,7 +323,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "2.0.1" version: "2.0.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:

View File

@ -29,6 +29,7 @@ static NSString *const METHOD_ONAUTHRESP = @"onAuthResp";
static NSString *const METHOD_ONSHAREMSGRESP = @"onShareMsgResp"; static NSString *const METHOD_ONSHAREMSGRESP = @"onShareMsgResp";
static NSString *const ARGUMENT_KEY_APPKEY = @"appKey"; static NSString *const ARGUMENT_KEY_APPKEY = @"appKey";
static NSString *const ARGUMENT_KEY_UNIVERSALLINK = @"universalLink";
static NSString *const ARGUMENT_KEY_SCOPE = @"scope"; static NSString *const ARGUMENT_KEY_SCOPE = @"scope";
static NSString *const ARGUMENT_KEY_REDIRECTURL = @"redirectUrl"; static NSString *const ARGUMENT_KEY_REDIRECTURL = @"redirectUrl";
static NSString *const ARGUMENT_KEY_TEXT = @"text"; static NSString *const ARGUMENT_KEY_TEXT = @"text";
@ -58,7 +59,8 @@ static NSString *const ARGUMENT_KEY_RESULT_EXPIRESIN = @"expiresIn";
result:(FlutterResult)result { result:(FlutterResult)result {
if ([METHOD_REGISTERAPP isEqualToString:call.method]) { if ([METHOD_REGISTERAPP isEqualToString:call.method]) {
NSString *appKey = call.arguments[ARGUMENT_KEY_APPKEY]; NSString *appKey = call.arguments[ARGUMENT_KEY_APPKEY];
[WeiboSDK registerApp:appKey]; NSString *universalLink = call.arguments[ARGUMENT_KEY_UNIVERSALLINK];
[WeiboSDK registerApp:appKey universalLink:universalLink];
result(nil); result(nil);
} else if ([METHOD_ISINSTALLED isEqualToString:call.method]) { } else if ([METHOD_ISINSTALLED isEqualToString:call.method]) {
result([NSNumber numberWithBool:[WeiboSDK isWeiboAppInstalled]]); result([NSNumber numberWithBool:[WeiboSDK isWeiboAppInstalled]]);
@ -80,7 +82,9 @@ static NSString *const ARGUMENT_KEY_RESULT_EXPIRESIN = @"expiresIn";
request.redirectURI = call.arguments[ARGUMENT_KEY_REDIRECTURL]; request.redirectURI = call.arguments[ARGUMENT_KEY_REDIRECTURL];
request.shouldShowWebViewForAuthIfCannotSSO = YES; request.shouldShowWebViewForAuthIfCannotSSO = YES;
request.shouldOpenWeiboAppInstallPageIfNotInstalled = NO; request.shouldOpenWeiboAppInstallPageIfNotInstalled = NO;
[WeiboSDK sendRequest:request]; [WeiboSDK sendRequest:request completion:^(BOOL success) {
// do nothing
}];
result(nil); result(nil);
} }
@ -89,7 +93,9 @@ static NSString *const ARGUMENT_KEY_RESULT_EXPIRESIN = @"expiresIn";
WBMessageObject *message = [WBMessageObject message]; WBMessageObject *message = [WBMessageObject message];
message.text = call.arguments[ARGUMENT_KEY_TEXT]; message.text = call.arguments[ARGUMENT_KEY_TEXT];
request.message = message; request.message = message;
[WeiboSDK sendRequest:request]; [WeiboSDK sendRequest:request completion:^(BOOL success) {
// do nothing
}];
result(nil); result(nil);
} }
@ -121,7 +127,9 @@ static NSString *const ARGUMENT_KEY_RESULT_EXPIRESIN = @"expiresIn";
message.mediaObject = object; message.mediaObject = object;
} }
request.message = message; request.message = message;
[WeiboSDK sendRequest:request]; [WeiboSDK sendRequest:request completion:^(BOOL success) {
// do nothing
}];
result(nil); result(nil);
} }

View File

@ -4,7 +4,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'weibo_kit' s.name = 'weibo_kit'
s.version = '2.0.1' s.version = '2.0.2'
s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.' s.summary = 'A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.'
s.description = <<-DESC s.description = <<-DESC
A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs. A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.
@ -18,10 +18,10 @@ A powerful Flutter plugin allowing developers to auth/share with natvie Android
s.dependency 'Flutter' s.dependency 'Flutter'
s.platform = :ios, '9.0' s.platform = :ios, '9.0'
# v3.2.7 # v3.3.0
s.static_framework = true s.static_framework = true
s.subspec 'vendor' do |sp| s.subspec 'vendor' do |sp|
sp.dependency 'Weibo_SDK', '~> 3.2.7' sp.dependency 'Weibo_SDK', '~> 3.3.0'
end end
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.

View File

@ -27,6 +27,7 @@ class Weibo {
static const String _METHOD_ONSHAREMSGRESP = 'onShareMsgResp'; static const String _METHOD_ONSHAREMSGRESP = 'onShareMsgResp';
static const String _ARGUMENT_KEY_APPKEY = 'appKey'; static const String _ARGUMENT_KEY_APPKEY = 'appKey';
static const String _ARGUMENT_KEY_UNIVERSALLINK = 'universalLink';
static const String _ARGUMENT_KEY_SCOPE = 'scope'; static const String _ARGUMENT_KEY_SCOPE = 'scope';
static const String _ARGUMENT_KEY_REDIRECTURL = 'redirectUrl'; static const String _ARGUMENT_KEY_REDIRECTURL = 'redirectUrl';
static const String _ARGUMENT_KEY_TEXT = 'text'; static const String _ARGUMENT_KEY_TEXT = 'text';
@ -54,14 +55,17 @@ class Weibo {
Future<void> registerApp({ Future<void> registerApp({
required String appKey, required String appKey,
required String? universalLink,
required List<String> scope, required List<String> scope,
String redirectUrl = String redirectUrl =
_DEFAULT_REDIRECTURL, // -> -> -> -> OAuth2.0 _DEFAULT_REDIRECTURL, // -> -> -> -> OAuth2.0
}) { }) {
assert(!Platform.isIOS || (universalLink?.isNotEmpty ?? false));
return _channel.invokeMethod<void>( return _channel.invokeMethod<void>(
_METHOD_REGISTERAPP, _METHOD_REGISTERAPP,
<String, dynamic>{ <String, dynamic>{
_ARGUMENT_KEY_APPKEY: appKey, _ARGUMENT_KEY_APPKEY: appKey,
_ARGUMENT_KEY_UNIVERSALLINK: universalLink,
_ARGUMENT_KEY_SCOPE: scope.join(','), _ARGUMENT_KEY_SCOPE: scope.join(','),
_ARGUMENT_KEY_REDIRECTURL: redirectUrl, _ARGUMENT_KEY_REDIRECTURL: redirectUrl,
}, },
@ -189,6 +193,7 @@ class Weibo {
} }
/// - /// -
@Deprecated('iOS分享多媒体已经弃用 请不要用相关api')
Future<void> shareWebpage({ Future<void> shareWebpage({
required String title, required String title,
required String description, required String description,

View File

@ -28,7 +28,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.5.0" version: "2.6.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -351,7 +351,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -393,7 +393,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.2.19" version: "0.3.0"
timing: timing:
dependency: transitive dependency: transitive
description: description:

View File

@ -1,6 +1,6 @@
name: weibo_kit name: weibo_kit
description: A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs. description: A powerful Flutter plugin allowing developers to auth/share with natvie Android & iOS Weibo SDKs.
version: 2.0.1 version: 2.0.2
# author: v7lin <v7lin@qq.com> # author: v7lin <v7lin@qq.com>
homepage: https://github.com/rxreader/weibo_kit.git homepage: https://github.com/rxreader/weibo_kit.git