【发布时间】:2014-11-09 21:07:38
【问题描述】:
我使用 Titanium Appcelerator 开发了一个 Android 应用程序。我曾尝试通过 facebook 提要对话框发布文本和图像 .. 但是加载我的本地图片 URL 时出错..
var fileimg = Titanium.Filesystem.getFile(backupDir.nativePath, "myimg.jpg");
var fb_data1 = {
description : "Some good text",
picture : fileimg.nativePath,
link : "www.googlee.com",
};
facebook_qfav.dialog("feed", fb_data1, showRequestResult);
函数 showRequestResult(e) {
var s = '';
if (e.success) {
s = "SUCCESS";
if (e.result) {
s += "; " + e.result;
}
if (e.data) {
s += "; " + e.data;
}
if (!e.result && !e.data) {
s = '"success",but no data from FB.I am guessing you cancelled the dialog.';
}
} else if (e.cancelled) {
s = "CANCELLED";
} else {
s = "FAILED ";
if (e.error) {
s += "; " + e.error;
alert("facebook Share " + s);
}
}
}
错误:“图片网址格式不正确”
文件路径如下: file:///storage/sdcard0/myimg.jpg
但是,如果我将远程 URL 传递给图片属性,则图像会显示在对话框中... 本地 URL 会怎样?
【问题讨论】: