TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2018 |
Maintained by youran1024, Mr.Yanhu.
###云账户红包SDK接入指南(iOS)
回调时机:
@interface YZHRedpacketBridge : NSObject
@property (nonatomic, weak) id <YZHRedpacketBridgeDelegate> delegate;
- (void)redpacketFetchRegisitParam:(FetchRegisitParamBlock)fetchBlock withError:(NSError *)error;
将一下方式的任一实体通过typedef void (^FetchRegisitParamBlock)(RedpacketRegisitModel *model); 传入SDK
Token注册方式(共三种)
1. 签名方式 签名方法见:云账户REST API文档
+ (RedpacketRegisitModel *)signModelWithAppUserId:(NSString *)appUserId // App的用户ID
signString:(NSString *)sign // 当前用户的签名
partner:(NSString *)partner // 在云账户注册的合作者
andTimeStamp:(NSString *)timeStamp; // 签名的时间戳
2. 环信方式
+ (RedpacketRegisitModel *)easeModelWithAppKey:(NSString *)appkey // 环信的注册商户Key
appToken:(NSString *)appToken // 环信IM的Token
andAppUserId:(NSString *)appUserId; // 环信IM的用户ID
3. 容联云方式
+ (RedpacketRegisitModel *)rongCloudModelWithAppId:(NSString *)appId // 容联云的AppId
appUserId:(NSString *)appUserId; // 容联云的用户ID
@interface YZHRedpacketBridge : NSObject
@property (nonatomic, weak) id <YZHRedpacketBridgeDataSource>dataSource;
@protocol YZHRedpacketBridgeDataSource <NSObject>
- (RedpacketUserInfo *)redpacketUserInfo;
-
@end
单聊红包(仅限单聊)
+ (void)presentRedpacketViewController:RPRedpacketControllerTypeSingle
fromeController:#CurrentController#
groupMemberCount:0
withRedpacketReceiver:#接收者信息#
andSuccessBlock:#发送成功后的回调#
withFetchGroupMemberListBlock:nil
小额随机红包(仅限单聊)
+ (void)presentRedpacketViewController:RPRedpacketControllerTypeRand
fromeController:#CurrentController#
groupMemberCount:0
withRedpacketReceiver:#接收者信息#
andSuccessBlock:#发送成功后的回调#
withFetchGroupMemberListBlock:nil
转账(仅限单聊)
+ (void)presentRedpacketViewController:RPRedpacketControllerTypeTransfer
fromeController:#CurrentController#
groupMemberCount:0
withRedpacketReceiver:#接收者信息#
andSuccessBlock:#发送成功后的回调#
withFetchGroupMemberListBlock:nil
普通群聊红包(仅限群聊)
+ (void)presentRedpacketViewController:RPRedpacketControllerTypeGroup
fromeController:#CurrentController#
groupMemberCount:0
withRedpacketReceiver:#接收者信息#
andSuccessBlock:#发送成功后的回调#
withFetchGroupMemberListBlock:nil
专属红包(仅限群聊)
+ (void)presentRedpacketViewController:RPRedpacketControllerTypeGroup
fromeController:#CurrentController#
groupMemberCount:0
withRedpacketReceiver:#接收者信息#
andSuccessBlock:#发送成功后的回调#
withFetchGroupMemberListBlock:#获取群成员列表的回调#
RedpacketMessageModel
中的redpacketMessageModelToDic
生成需要在消息通道中传递的数据RedpacketMessageModel
中的redpacketMessageModelWithDic
转换成MessageModel
然后调用下列方法+ (void)redpacketTouchedWithMessageModel:#上文中生成的MessageModel#
fromViewController:#CurrentController#
redpacketGrabBlock:#抢红包成功后的回调#
advertisementAction:nil
广告红包
+ (void)redpacketTouchedWithMessageModel:#上文中生成的MessageModel#
fromViewController:#CurrentController#
redpacketGrabBlock:#抢红包成功后的回调#
advertisementAction:#广告红包抢红包成功后的行为回调(分享,取消)#
+ (void)presentChangePocketViewControllerFromeController:#CurrentController#;
三方支付回调
请在集成Demo 中查找AppDelegate+Redpacket
,在工程中引入即可
回调地址(默认为Bundle Identifier
)
请在工程中的Info.plist中添加此回调地址
Other Link Flag(引入类别)
请在工程中的BuildSetting中搜索OtherLinkFlag
并添加-ObjC
标记
三方集成文档(如果遇到了集成困难可以查询此文档) 支付宝集成链接
集成帮助 集成Demo
联系我们:
客服热线: 400-6565-739 业务咨询: [email protected] 客服 QQ : 4006565739 技术QQ群: 366135448