> For the complete documentation index, see [llms.txt](https://docs.gamepot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamepot.io/basics/gamepot-2.0/zhong-wen/ios-sdk/ios-sdk-you-hui-quan-gong-neng.md).

# iOS SDK\_优惠券功能

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

```
#import <GamePot/GamePot.h>

[[GamePot getInstance] coupon:/*用户输入的优惠券*/ handler:^(BOOL _success, NSError *_error) {
    if(_success)
    {
        // message中返回优惠券使用相关结果。请在游戏弹窗显示相应消息。
    }
    else
    {
        // _error中返回优惠券使用失败原因相关信息。
        // 请在游戏弹窗显示[_error localizedDescription]内容。
    }
}];
```

## **发放道具** <a href="#fa-fang-dao-ju" id="fa-fang-dao-ju"></a>

***

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

详细说明请参考[道具发放请求](https://nbase.atlassian.net/wiki/spaces/gamepotGuide/pages/44499433)。
