Test JS interface function, I use the BAE server is not SAE server. The SAE server could not write to the file and the test would be problematic.
what is called Js-sdk, I first demonstrate the concrete function of the JS-SDK interface.
I open a piece of micro-letter to push the article the following figure:
Click to open the first article
Above is our connection article, if we send this article to a friend, the display effect is as follows:
Share to the circle of friends we'll see the effect:
Why is the same article connection, in the public number, sent to friends, sent to the circle of friends to show the effect of the interface is not the same. The public number was displayed because the micro-credit public account was invoked at the time of the push, and both were due to the JS-SDK associated SDK interface called by the page.
Send a friend to call the JS interface to get "share to Friends" button click State and custom sharing content interface.
Sent to the circle of friends to call the JS interface to get "share to Friend Circle" button click State and custom sharing content interface.
Let's implement the steps to invoke the JS-SDK interface:
The first step: micro-trust public platform into the "Public number settings" in the "Functional settings" fill in the "JS interface security Domain name."
The following figure:
Only pages placed under the domain name can call the JS interface.
Step Two:Http://demo.open.weixin.qq.com/jssdk/sample.zip connect this address to download, open inside the PHP folder, you found 4 php files
The first 3 PHP files are the configuration files, do not move it, sample.php is the Connection page we opened in the micro-letter, in this page we write our page code. This file I used to test, the inside of the code is different from the original.
<?php
//echo "Nihao";
Require_once "jssdk.php";
$JSSDK = new Jssdk ("wxaf471be5d2bc9521", "93F5C3817074D43E7A7AB3F403CC72DD"), and the parameters in//jssdk are AppID and Appsecret.
$signPackage = $jssdk->getsignpackage ();//Get configuration parameters.
?>
Test JS interface function, I use the BAE server is not SAE server. The SAE server could not write to the file and the test would be problematic.
For more features and more information, please visit http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.