Giter Site home page Giter Site logo

Comments (6)

droplet-js avatar droplet-js commented on May 28, 2024 1

搞定了,傻吊微博SDK辣么大的更新居然没个文档,你先用 git 方式引入,没问题后我再发布正式版本

              File file = await DefaultCacheManager().getSingleFile(
                  'https://www.baidu.com/img/bd_logo1.png?where=super');
              if (Platform.isAndroid) {
                // 仅支持 Context.getExternalFilesDir(null)/Context.getExternalCacheDirs(null) 路径分享
                // path_provider.getExternalCacheDirectories();
                // path_provider.getExternalStorageDirectory();
                final Directory temporaryDir =
                    await path_provider.getTemporaryDirectory();
                if (path.isWithin(temporaryDir.parent.path, file.path)) {
                  // 复制
                  final File copyFile = File(path.join(
                      (await path_provider.getExternalStorageDirectory())!.path,
                      path.basename(file.path)));
                  if (copyFile.existsSync()) {
                    await copyFile.delete();
                  }
                  await copyFile.writeAsBytes(await file.readAsBytes());
                  file = copyFile;
                }
              }
              await Weibo.instance.shareMultiImage(
                text: 'Share Text',
                imageUris: <Uri>[Uri.file(file.path)],
              );

from weibo_kit.

droplet-js avatar droplet-js commented on May 28, 2024

微博SDK和文档写的和狗屎没差别,我今天更新了一下,多图分享直接跪

from weibo_kit.

droplet-js avatar droplet-js commented on May 28, 2024

路径方式分享功能似乎已经跪的妥妥的 ...

from weibo_kit.

droplet-js avatar droplet-js commented on May 28, 2024

我再试试覆盖**微博SDK的FileProvider,突破一下路径限制

from weibo_kit.

Ucoon avatar Ucoon commented on May 28, 2024

复制了上面的代码,还是不可用,请问还有解决方式吗 @droplet-js

from weibo_kit.

akindone avatar akindone commented on May 28, 2024

搞定了,傻吊微博SDK辣么大的更新居然没个文档,你先用 git 方式引入,没问题后我再发布正式版本

              File file = await DefaultCacheManager().getSingleFile(
                  'https://www.baidu.com/img/bd_logo1.png?where=super');
              if (Platform.isAndroid) {
                // 仅支持 Context.getExternalFilesDir(null)/Context.getExternalCacheDirs(null) 路径分享
                // path_provider.getExternalCacheDirectories();
                // path_provider.getExternalStorageDirectory();
                final Directory temporaryDir =
                    await path_provider.getTemporaryDirectory();
                if (path.isWithin(temporaryDir.parent.path, file.path)) {
                  // 复制
                  final File copyFile = File(path.join(
                      (await path_provider.getExternalStorageDirectory())!.path,
                      path.basename(file.path)));
                  if (copyFile.existsSync()) {
                    await copyFile.delete();
                  }
                  await copyFile.writeAsBytes(await file.readAsBytes());
                  file = copyFile;
                }
              }
              await Weibo.instance.shareMultiImage(
                text: 'Share Text',
                imageUris: <Uri>[Uri.file(file.path)],
              );

这个可以,我测试了华为 mate20(android9);小米10S(android12);但是如果是分享单图的接口shareImage在小米10S(android12)是不行的。

from weibo_kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.