Android: update weibo sdk (#41)

* update weibo sdk

* update version

* fix iwbapi update method params
This commit is contained in:
akindone 2021-12-02 15:29:13 +08:00 committed by GitHub
parent b403712396
commit c7a6645c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -16,11 +16,6 @@ rootProject.allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
//
flatDir {
dirs project(':weibo_kit').file('libs')
}
} }
} }
@ -55,5 +50,5 @@ android {
dependencies { dependencies {
// v10.10.0 // v10.10.0
vendorImplementation 'androidx.appcompat:appcompat:1.0.0' vendorImplementation 'androidx.appcompat:appcompat:1.0.0'
vendorImplementation(name: 'openDefault-10.10.0', ext: 'aar') vendorImplementation 'io.github.sinaweibosdk:core:11.11.2@aar'
} }

Binary file not shown.

View File

@ -133,7 +133,7 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
switch (requestCode) { switch (requestCode) {
case 32973: case 32973:
if (iwbapi != null) { if (iwbapi != null) {
iwbapi.authorizeCallback(requestCode, resultCode, data); iwbapi.authorizeCallback(activityPluginBinding.getActivity(), requestCode, resultCode, data);
} }
return true; return true;
case 10001: case 10001:
@ -199,7 +199,7 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
private void handleAuthCall(@NonNull MethodCall call, @NonNull Result result) { private void handleAuthCall(@NonNull MethodCall call, @NonNull Result result) {
if (iwbapi != null) { if (iwbapi != null) {
iwbapi.authorize(new WbAuthListener() { iwbapi.authorize(activityPluginBinding.getActivity(), new WbAuthListener() {
@Override @Override
public void onComplete(Oauth2AccessToken token) { public void onComplete(Oauth2AccessToken token) {
final Map<String, Object> map = new HashMap<>(); final Map<String, Object> map = new HashMap<>();
@ -249,7 +249,7 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
message.textObject = object; message.textObject = object;
if (iwbapi != null) { if (iwbapi != null) {
iwbapi.shareMessage(message, false); iwbapi.shareMessage(activityPluginBinding.getActivity(), message, false);
} }
result.success(null); result.success(null);
} }
@ -287,7 +287,7 @@ public class WeiboKitPlugin implements FlutterPlugin, ActivityAware, PluginRegis
} }
if (iwbapi != null) { if (iwbapi != null) {
iwbapi.shareMessage(message, false); iwbapi.shareMessage(activityPluginBinding.getActivity(), message, false);
} }
result.success(null); result.success(null);
} }