Incentive configuration interface
The demo of the incentive lottery interface is in LotteryActivity.java
Business description
Lottery method:
Supports the following lottery methods
1. Free lottery: that is, users can participate in the lottery for free
2. Consumption lottery : That is, you need to consume mall points for the lottery
3. Mixed lottery: free lottery first, and then consumptive lottery after the free times are used up
4. Consumption lottery: When users purchase goods, they can return prizes according to the configured probability (no need for APP docking to achieve this)
Lottery strategy:
Probability-based lottery: Configure a lottery with a certain probability
Description of prizes:
1) Virtual goods
Jifenbao, red envelopes (all network or designated products), vouchers, gold coins, Tmall points, mall points, movie tickets, lottery tickets, APP gift packs
2 ) Physical prizes
Free products: Physical prizes with or without Tmall/Taobao stores can be issued.
Discounted products: Users can purchase discounted products by scanning the QR code; the discount rate can be configured in the background.
Other instructions:
1) eventKey
is used in APP to define events that satisfy the lottery. Each eventKey corresponds to a lottery activity and activity strategy. If eventKey is added to the incentive background configuration, the APP generally needs to update the installation package.
2) Incentive background
- The incentive background can configure corresponding lottery activities according to the needs of the APP, and each activity corresponds to an eventKey.
- After the lottery expires, even if the APP calls the eventKey again for the lottery, you will not win.
- If there are multiple lottery activities in an APP, multiple eventKeys need to be created, and the lottery event times with the same eventKey cannot overlap.
- For consumer lottery, no APP configuration is required, just put forward the requirements to the number Entertainment operations, configure the operation background to
Get the incentive information list
Interface description:
Get the lottery activity information list, display the activity information or perform corresponding processing according to the results in the listener.
The returned data includes the lottery type, points consumed by the lottery, and the number of free draws, etc.
Preconditions:
None
Function prototype:
public static void getActivitesInfo(String eventKey, IReceiveActivitesListener listener)
Parameter description:
eventKey: Get the activity information corresponding to this ID. If null is passed, get the information of all available activities
Listener: Activity information return listener, the return type is ActivityInfoModel.
Request example:
AliTvSdk.Lottery.getActivitesInfo (eventKey, new IReceiveActivitesListener() { @Override public void onResult(ActivityInfoModel activies) { ArrayList<ActivityInfoItem> items = model.obtainActivities(); if(items != null){ ActivityInfoItem item = items.get(0); //抽奖类型,1.免费型2.消耗型3.混合型 int luckyType = item.getLuckyType(); //抽奖一次需要消耗的积分,若免费型抽奖为0 int consumeAmount = item.getConsumeAmount()); //抽奖次数(免费或混合型抽奖初始化设置免费抽奖次数) int accessAmount = item.getAccessAmount()); AwardsList awardsList = item.getAwards(); for(int j = 0;j < awardItems.size();j++){ //根据活动信息绘制UI,详见Demo。 } } @Override public void onError(int errCode, String errMsg) { } });
Return description
Name | Type | Description |
activityId | String | ##activityID |
fventKey | String | EventKey |
name | String | Activity name |
startTime | String | Activity start time |
endTime | String | Event end time |
ActivityInfoAwardItem |
| The event award objectYou can view the award list |
Int | This activity consumes digital entertainment points each time | If it is 0, it will not Consumption |
#Int | The number of free draws for this event | |
Int | Lottery type Free lottery: 1 Consumption lottery: 2 Mixed lottery: 3 | |
activityUrl
| String | Returns the activity URL, which can be used for CP production QR code, the H5 page will be displayed on the mobile phone after the user scans the code |
AwardInfoItemListDefinition
##Field | Type | ##Description |
Number | activityid | |
String | ##Award Name | ##Id |
Number | Award ID | ##typeName |
Prize type name | Returned prize name, such as M coins, digital entertainment points, etc. |
|
Award Code | Such as 1, 2, 3, 4, 5, 6, 7, 8, 9, 10th grade |
|
Amount of awards | Unit | |
Award unit Note, individual, Zhang | price | |
Prize value unit points | hyperlinkUrl | |
Custom hyperlink URL ( Such as discount QR code, business jump, etc.) | ||
hyperlinkDesc | String | Hyperlink copy description |
Interface Incentive
Interface Description:Get the lottery results. The UI in the APP is displayed by CP.
Precondition:
Requires authorization, if not authorized, an unauthorized error code will be returned
Function Prototype:
public static void getLotteryResultWithPermission(String eventKey, String confirmKey, String behaviorKey, IReceiveAwardResultListener listener)
Parameter description:
eventKey : Corresponding activity keyword
listener: The lottery result id is returned to the listener, and the data bit is returned ActivityAwardModel
behaviorKey (optional): Key name of the behavioral lottery
confirmKey ( Optional): Confirm the secret key. This secret key is a secret key string that CP obtains from Alibaba and then calculates it through an algorithm. Please refer to the demo for the secret key algorithm. For the sake of algorithm security, this confirmation key needs to be generated by the cp server and sent back to the client.
Request example:
AliTvSdk.Lottery.getLotteryResultWithPermission (eventKey, String confirmKey, new IReceiveAwardResultListener() { @Override public void onResult(ActivityAwardModel activies) { if(model != null){ if(model.isResult()){ ActivityAwardItem item = model.getAward(); //提示中奖 }else{ //未中奖 } //数娱积分/金牌余额 int totalAmount = model.getTotalAmount()); //可用抽奖次数(免费) int accessAmount = model.getAccessAmount()); }else{//未中奖 } } @Override public void onError(int errCode, String errMsg) { } });
Return description:
Name | Type | ##Description |
isLucky | Boolean | Whether to win the prize, true means winning, false means not winning |
activityAwardItem | ActivityAwardItem | Win: See belowNot Winning: Empty |
totalAmount | Long | User remaining pointsIf it is a negative number, it is an invalid value |
accessAmount | Int | The number of free draws remaining for the user |
##Field | Type | Description |
activityId | ##NumberActivityid | |
String | Award Name | |
Number | Award id | |
String | The returned award name | |
Number | Award Code | Such as 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, etc. |
Number | Number of awards | ##Unit |
String | Award units note, individual, Zhang | ##Price |
##Award value unit points | simpleDesc | |
Award short description | fullDesc | |
Full description of the award | ||
hyperlinkUrl | String | Customized hyperlink URL (such as discount QR code, business jump, etc.) |
hyperlinkDesc | String | Hyperlink copy description |
##Consumption Incentive
Prerequisites: Submit configuration requirements to the data entertainment operation interface person, and the data entertainment background configuration will take effect. No need for APP docking
Access method:
Normal payment The returned rewards can be configured for specific products without any need for the access party to do anything Configuration and UI, all configuration and display are implemented by Digital Entertainment. The prizes that can be issued after payment are as follows (users need to log in to pay)1 Virtual prizes:
- In-platform prizes: Mall Points, App gift packs Off-platform prizes: Jifenbao, red envelopes, vouchers, gold coins, Tmall points, movie tickets, lottery tickets; user2 physical prizes:
- Supports physical products from Tmall or Taobao stores Supports physical products without Tmall or Taobao stores