# Preface
This tutorial is based on the "apifm-wxapi" module and teaches you how to quickly implement small program development, so you may need to understand the following knowledge points first:
["Creating HelloWorld Project"](https://www.yuque.com/apifm/doc/hezlrm)
["Use "apifm-wxapi" to quickly develop small programs"](https://www.yuque.com/apifm/doc/mdldsd)
["Register for free to open the backend and obtain an exclusive domain name"](https://www.yuque.com/apifm/doc/qr6l4m)
In this case, some functions require the user to log in before they can be operated, which means token authorization is required. Please understand first:
["WeChat Mini Program login to obtain openid and third-party tokens"](https://www.yuque.com/apifm/doc/kaygbw)
# Function introduction
Forward to the WeChat group to get reward points, stimulate users to forward, and then expand the communication effect.
**In the same WeChat group and on the same day, the system will only issue rewards once! **
# Configure forwarding rewards
["Points gifting rule settings [registration/consumption/recharge/invite users/shopping and give praise/forward to WeChat group]"](https://www.yuque.com/apifm/doc/etb8s6)
_Set the number of points for forwarding rewards and the upper limit of daily rewards_
#Open ShareTicket
[https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html)
In the onLoad method in the js file of the forwarding page, declare:
```javascript
wx.showShareMenu({
withShareTicket: true
})
```
_In the forwarding link, please bring the uid of the forwarder. Subsequent points rewards will be issued directly to the user of this uid. Therefore, if you do not bring uid data, then you will not know who forwarded this forwarding in the following steps_
# Give away rewards
**If you forward it to the WeChat group, you will not get the reward immediately. This is WeChat's rule; you must wait until someone in the group clicks the sharing link, and then on the small program page that opens, you can write your own program to realize the gift: **
**In the onLaunch or onShow method of the app.js file**, we write this:
```javascript
if (e.shareTicket) {
wx.getShareInfo({
shareTicket: e.shareTicket,
success: res => {
console.log(res)
console.log({
referrer: e.query.inviter_id,
encryptedData: res.encryptedData,
iv: res.iv
})
wx.login({
success (loginRes) {
if (loginRes.code) {
WXAPI.shareGroupGetScore(
loginRes.code,
e.query.inviter_id,
res.encryptedData,
res.iv
).then(_res => {
console.log(_res)
}).catch(err=>{
console.error(err)
})
} else {
console.error('Login failed!' + loginRes.errMsg)
}
}
})
}
})
}
```
# apifm-wxapi method description
```javascript
WXAPI.shareGroupGetScore(referrer, encryptedData, iv)
```
**referrer**
_Sharer’s user ID_
**encryptedData**
_Mini program api:wx.getShareInfo obtained_
**iv**
_Mini program api:wx.getShareInfo obtained_
Looking forward to your progress!
grateful!