This article describes in detail the materials related to the development and application of the php public account js-sdk, which has some reference value. if you are interested, you can refer to the testing of js interface functions, 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.
GetSignPackage (); // Get the configuration parameters.?>
Hello, Tang Sheng.