Wechat direct download APP solution

Keywords: PHP curl

With the increasing number of wechat users, there are 108.25 million wechat users active every month, and 45 billion pieces of information are released every day. From this data, we can see that wechat is a way of life. People's communication, social interaction and reading methods have changed. No matter individuals or businesses, they want to use the most direct way to let everyone know their app. How can wechat directly download it What about APP? Now I will provide a piece of code for you to share:

$url = "http://api.monkeyapi.com";
$params = array(
'appkey' =>'appkey',//APPKEY you applied for
'path' =>'/home',//Route to be switched (not required)
);

$paramstring = http_build_query($params);
$content = monkeyCurl($url, $paramstring);
$result = json_decode($content, true);
if($result) {
    var_dump($result);
}else {
    //Request exception
}

/**
    * Request interface return content
    * @param    string $url [Requested URL address]
    * @param    string $params [Requested parameters]
    * @param    int $ipost [POST or not]
    * @return    string
*/
function monkeyCurl($url, $params = false, $ispost = 0)
{
    $httpInfo = array();
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    if ($ispost) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
        curl_setopt($ch, CURLOPT_URL, $url);
    }else {
        if ($params) {
            curl_setopt($ch, CURLOPT_URL, $url.'?'.$params);
        } else {
            curl_setopt($ch, CURLOPT_URL, $url);
        }
    }

    $response = curl_exec($ch);
        if ($response === FALSE) {
        //echo "cURL Error: " . curl_error($ch);
        return false;
    }

    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $httpInfo = array_merge($httpInfo, curl_getinfo($ch));
    curl_close($ch);
    return $response;
}

We have a special wechat direct jump APP interface for monkey data, which allows you to see that your promoted friends can download the APP directly by clicking, eliminating the tedious steps of confirming the download in the middle, etc., and the direct jump will also make people more trust. A large number of people will have questions when they see that they want to reconfirm. Is this safe? Is it trustworthy? In this way, a considerable number of customers will be lost, so that your promotion will not be maximized. This technology is very practical. Many people have learned and practiced it, and the effect is very good.

More about the technology of direct jump can be + V: mkapi001, Q:1401806571. Monkey data, professional technical operation team, solve problems in time.

Posted by ChaosXero on Mon, 09 Dec 2019 07:47:46 -0800