Unity SDK_优惠券功能

如要使用用户输入优惠券即处理为已使用的功能,请使用下列代码。

  • 方式1

    GamePot.coupon(string couponNumber); // 优惠券编号
    
    GamePot.coupon(string couponNumber, string userData);; // 优惠券编号、用户信息
    
    /// 优惠券使用成功
    public void onCouponSuccess() {
    }
    
    /// 优惠券使用失败
    public void onCouponFailure(NError error) {
        // 请使用error.message显示错误消息。
    }

  • 方式2

    GamePot.coupon(string couponNumber, GamePotCallbackDelegate.CB_Common); // 优惠券编号
    
    GamePot.coupon(string couponNumber, string userData, GamePotCallbackDelegate.CB_Common);    // 优惠券编号、用户信息
    
    GamePot.coupon(couponNumber, (success, error) => {
       if(success)
       {
           // 优惠券使用成功
       }
       else
       {
            // 优惠券使用失败
            // 请使用error.message显示错误消息。
       }
    });

发放道具

优惠券使用成功时,向开发商服务器请求发放道具。

详细说明请参考道具发放请求

Last updated