我正在开发 Tizen 应用程序。我在一个真正的三星电视设备上测试它,这个应用程序的功能之一是它应该能够缓存一些文件(文本和媒体)。在调试此功能时,我尝试使用:
tizen.filesystem.getStorage("downloads", onStorage, onStorageError);
但是,这又回到了我的错误函数中。我已经尝试了其他几个潜在的目录,但仍然失败。然后我想测试文件系统是否混乱,并想通过 Tizen-Studio 的设备管理器进行检查,它应该有一个类似于 Android Studio 的文件资源管理器。
我有点难过。我怀疑这可能与 Tizen 特权有关?在我的 config.xml 中,我有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://pavjacko/ReactNativeVanilla" version="0.8.5" viewmodes="maximized">
<access origin="*" subdomains="true"></access>
<tizen:application id="NkVRhWHJST.RNVanillaTV" package="NkVRhWHJST" required_version="2.3"/>
<content src="public/index.html"/>
<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<feature name="http://tizen.org/feature/network.internet"/>
<feature name="http://tizen.org/api/tizen" required="true"/>
<feature name="http://tizen.org/feature/download"/>
<icon src="icon.png"/>
<name>App</name>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/tizen"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
<tizen:privilege name="http://tizen.org/privilege/externalstorage"/>
<tizen:privilege name="http://tizen.org/privilege/unlimitedstorage"/>
<tizen:privilege name="http://tizen.org/privilege/mediastorage"/>
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
<tizen:profile name="tv-samsung"/>
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
</widget>
我错过了什么吗?据我所知,阅读了相当多的 Tizen 文件系统的 api,我应该能够执行此过程,但我不能。任何帮助表示赞赏。
编辑:我也一直在使用 Tizen-Studio 的 Web 应用程序模拟(三星电视),我最近尝试使用tizen.filesystem.listStorages(checkStorage)
to check storage.length
,它返回了一个0
. 不知道我错过了什么。