在flutter应用程序中支持自定义文件扩展名(在flutter中打开扩展名为.abc的文件) [英] Support custom file extension in a flutter app ( Open file with extension .abc in flutter )

查看:160
本文介绍了在flutter应用程序中支持自定义文件扩展名(在flutter中打开扩展名为.abc的文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我要导出在应用程序中创建的扩展名为.abc的文件

So I am exporting a file created in my application with extension .abc

现在,如果用户在whatsapp或电报或任何其他平台上共享文件,并且当其他用户尝试打开文件时,打开方式"对话框应与我的应用程序一起出现在列表中.

Now, if the user shares the file on whatsapp or telegram or any other platform and when other user tries to open the file, the "open with" dialog should appear with my application in the list.

我尝试了以下方法,但这种方法行不通,而且仅适用于Android,并且正在为此寻求多平台解决方案.

I have tried following approach which does not work plus it is only for Android and I am looking for multi-platform solution to this.

我能够使用上述方法编译应用程序,但无法使用我的应用程序名称填充打开方式"对话框

I was able to compile the app using above method but could not populate "Open with" dialog with my app's name

谢谢您的时间.

因此,我已经为Android成功添加了此功能,但我仍在尝试为我的iPhone用户添加相同的功能.

So I have successfully added this functionality for android but I am still trying to add the same functionality for my iPhone users.

有人可以在iOS的快速代码部分帮助我吗?我不熟悉快速的语言,但是我希望我的用户能够在两个平台上使用相同的功能.

Can someone please help me with swift code part in iOS ?? I am not familiar with swift language but I want my users to be able to use same functionality on both platforms.

推荐答案

我找到了适用于iOS的解决方案:

I have found a solution for iOS:

您可以使用 Uni Links 软件包将通知发送到Flutter应用中.然后,您需要在XCode项目的Info.plist中手动添加文件类型.您可以在此处找到说明..

You can use the Uni Links package to get the notifications into your Flutter app. You then need to manually add the file types in the Info.plist for the XCode project. You can find an explanation for example here.

这篇关于在flutter应用程序中支持自定义文件扩展名(在flutter中打开扩展名为.abc的文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆