我使用 Titanium Appcelerator 开发了一个 Android 应用程序。我曾尝试通过 Facebook 提要对话框发布文本和图像 .. 但是加载我的本 map 片 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);
function 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);
}
}
}
错误:“图像 URL 格式不正确”
文件路径如下: file:///storage/sdcard0/myimg.jpg
但是如果我将远程 URL 传递给图片属性,图像就会显示在对话框中... 本地 URL 会怎样?
最佳答案
我认为唯一的问题是 nativepath
中有大写字母 P。所以,它的:nativePath
所以 picture : fileimg.nativepath
应该是 picture : fileimg.nativePath,
希望对您有所帮助。
关于android - 钛安卓 : Facebook dialog image URL not properly formatted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25863304/