Php WeChat official account js-sdk development application, php letter public js-sdk

Source: Internet
Author: User

Php official account js-sdk development application, php official account js-sdk

Test the js interface function. I use the BAE server instead of the SAE server. Files cannot be written to the SAE server. problems may occur during testing.
What is js-sdk?First, I will demonstrate the specific functions of the js-sdk interface.

I opened a push article as follows:

 

Open the first article

 

The above is our connection article. If we send this article to a friend, the effect is as follows:

Share it with your friends and let's take a look at the results:

Why is the same article connection? The effects on the public number, sent to friends, and sent to the circle of friends are different. The Display Effect of the public account is because the public account calls the message interface when pushing the message, and the other two are because the page calls the sdk Interface related to js-sdk.
Sent to a friend and called the js interface to get the "share to friend" button click status and customize the sharing content interface.
Sent to the circle of friends and called the js interface to obtain the "share to circle of friends" button click status and custom sharing content interface.

The following describes how to call the js-sdk interface:

Step 1: Enter "JS interface Security Domain Name" in "function Settings" of "public account settings" on the public platform ".

For example:

 

Only pages placed under this domain name can call the js interface.

Step 2:Http://demo.open.weixin.qq.com/jssdk/sample.zipconnect to download this address. Open the php folder and you will find four php files.

 

The first three php files are configuration files. Do not touch them. sample. php is the connection page we opened in. On this page, we will compile our page code. The code in this file is different from the original one.

<? Php // echo "nihao"; require_once "jssdk. php"; $ jssdk = new JSSDK ("wxaf471be5d2bc9521", "secret"); // The parameters in JSSDK are appid and appsecret. $ SignPackage = $ jssdk-> GetSignPackage (); // get the configuration parameters.?>
<! DOCTYPE html> 

Test the js interface function. I use the BAE server instead of the SAE server. Files cannot be written to the SAE server. problems may occur during testing.
More functions and details, please visit http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.