Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 在谷歌+;通过url_Image_Api_Url_Titanium_Google Plus - Fatal编程技术网

Image 在谷歌+;通过url

Image 在谷歌+;通过url,image,api,url,titanium,google-plus,Image,Api,Url,Titanium,Google Plus,我想通过我的Tianium应用程序在google+上发布图像和视频。以下是我正在使用的url: var webView = Ti.UI.createWebView({ url: 'https://plus.google.com/share?client_id=1234567889.apps.googleusercontent.com&continue='+Ti.App.id+'%3A%2F%2Fshare%2F&text='+textToShare+'&url='+u

我想通过我的Tianium应用程序在google+上发布图像和视频。以下是我正在使用的url:

var webView = Ti.UI.createWebView({
  url: 'https://plus.google.com/share?client_id=1234567889.apps.googleusercontent.com&continue='+Ti.App.id+'%3A%2F%2Fshare%2F&text='+textToShare+'&url='+urlToShare+'&bundle_id='+Ti.App.id+'&gpsdk=1.0.0' 
});

win.add(webView);
谁能告诉我,如何在上面的url中传递图像作为参数

任何帮助都将不胜感激


谢谢

目前无法通过URL、按钮或SDK共享图像

事实上,对于共享URL,您会在Google+stream的共享框中注意到,您不能同时进行链接预览和图像上传,这可能是为什么您正在寻找的共享选项不提供此功能的基础

您可以在Google+上添加/上载图像: 参考链接:

    // Helper function courtesy of https://github.com/guzzle/guzzle/blob/3a0787217e6c0246b457e637ddd33332efea1d2a/src/Guzzle/Http/Message/PostFile.php#L90 

    function getCurlValue($filename, $contentType, $postname) {
          // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
          // See: https://wiki.php.net/rfc/curl-file-upload

    if (function_exists('curl_file_create')) {
        return curl_file_create($filename, $contentType, $postname);
    }

    // Use the old style if using an older version of PHP
    $value = "@{$filename};filename=" . $postname;
    if ($contentType) {
        $value .= ';type=' . $contentType;
    }

    return $value; }   $filename = '/path/to/file.jpg'; $cfile = getCurlValue($filename,'image/jpeg','cattle-01.jpg');   //NOTE: The top level key in the array is important, as some apis will insist that it is 'file'. $data = array('file' => $cfile);   $ch = curl_init(); $options = array(CURLOPT_URL => 'http://your/server/api/upload',
             CURLOPT_RETURNTRANSFER => true,
             CURLINFO_HEADER_OUT => true, //Request header
             CURLOPT_HEADER => true, //Return header
             CURLOPT_SSL_VERIFYPEER => false, //Don't veryify server certificate
             CURLOPT_POST => true,
             CURLOPT_POSTFIELDS => $data
            );