提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。
windvane 在客户端中,会将原始UA后面跟上 WindVane/WindVaneSDK的版本号,你可以通过判断UA的方式来检查环境 其中,淘宝主客户端1212版本(IOS 3.4.5 ANDROID 3.9.5)后格式为
| #!/usr/bin/env php | |
| <?php | |
| function fetch_page($url, $timeout = 5) { | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); | |
| $data = curl_exec($ch); | |
| curl_close($ch); |
提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。
windvane 在客户端中,会将原始UA后面跟上 WindVane/WindVaneSDK的版本号,你可以通过判断UA的方式来检查环境 其中,淘宝主客户端1212版本(IOS 3.4.5 ANDROID 3.9.5)后格式为
| import Promise from 'bluebird' | |
| import MongoDB from 'mongodb' | |
| Promise.promisifyAll(MongoDB) | |
| async function findEveryone(db) { | |
| const people = db.collection('people') | |
| const everyone = await people.find().toArrayAsync() | |
| return everyone.map( x => x.name ) | |
| } |
| var session | |
| if (window.ApplePaySession) { | |
| var merchantIdentifier = 'merchant.com.canine-clothing' | |
| ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier) | |
| .then(function (canMakePayments) { | |
| if (canMakePayments) { | |
| showApplePayButtons() | |
| } | |
| }); | |
| } |