@yct/jssdk
v1.0.4
Published
jssdk
Downloads
2
Readme
Installation
npm i -S @yct/jssdk
or
yarn add @yct/jssdk
Example
import { Wechat, WechatAPI } from '@yct/jssdk';
(async () => {
try {
const wechat = new Wechat('Your appId', true, false);
await wechat.ready();
const ticket = 'get js ticket from server';
await wechat.config(ticket, WechatAPI.getLocation, WechatAPI.getNetworkType);
const loc = await wechat.getLocation({
type: 'gcj02',
});
console.log(loc);
const nw = await wechat.getNetworkType();
console.log(nw);
} catch(e) {
console.error(e);
}
})();