WXApiObject.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. //
  2. // MMApiObject.h
  3. // Api对象,包含所有接口和对象数据定义
  4. //
  5. // Created by Wechat on 12-2-28.
  6. // Copyright (c) 2012年 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. /*! @brief 错误码
  11. *
  12. */
  13. enum WXErrCode {
  14. WXSuccess = 0, /**< 成功 */
  15. WXErrCodeCommon = -1, /**< 普通错误类型 */
  16. WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */
  17. WXErrCodeSentFail = -3, /**< 发送失败 */
  18. WXErrCodeAuthDeny = -4, /**< 授权失败 */
  19. WXErrCodeUnsupport = -5, /**< 微信不支持 */
  20. };
  21. /*! @brief 请求发送场景
  22. *
  23. */
  24. enum WXScene {
  25. WXSceneSession = 0, /**< 聊天界面 */
  26. WXSceneTimeline = 1, /**< 朋友圈 */
  27. WXSceneFavorite = 2, /**< 收藏 */
  28. WXSceneSpecifiedSession = 3, /**< 指定联系人 */
  29. };
  30. enum WXAPISupport {
  31. WXAPISupportSession = 0,
  32. };
  33. /*! @brief 跳转profile类型
  34. *
  35. */
  36. enum WXBizProfileType{
  37. WXBizProfileType_Normal = 0, //**< 普通公众号 */
  38. WXBizProfileType_Device = 1, //**< 硬件公众号 */
  39. };
  40. /*! @brief 分享小程序类型
  41. *
  42. */
  43. typedef NS_ENUM(NSUInteger, WXMiniProgramType){
  44. WXMiniProgramTypeRelease = 0, //**< 正式版 */
  45. WXMiniProgramTypeTest = 1, //**< 开发版 */
  46. WXMiniProgramTypePreview = 2, //**< 体验版 */
  47. };
  48. /*! @brief 跳转mp网页类型
  49. *
  50. */
  51. enum WXMPWebviewType {
  52. WXMPWebviewType_Ad = 0, /**< 广告网页 **/
  53. };
  54. /*! @brief 应用支持接收微信的文件类型
  55. *
  56. */
  57. typedef NS_ENUM(UInt64, enAppSupportContentFlag)
  58. {
  59. MMAPP_SUPPORT_NOCONTENT = 0x0,
  60. MMAPP_SUPPORT_TEXT = 0x1,
  61. MMAPP_SUPPORT_PICTURE = 0x2,
  62. MMAPP_SUPPORT_LOCATION = 0x4,
  63. MMAPP_SUPPORT_VIDEO = 0x8,
  64. MMAPP_SUPPORT_AUDIO = 0x10,
  65. MMAPP_SUPPORT_WEBPAGE = 0x20,
  66. // Suport File Type
  67. MMAPP_SUPPORT_DOC = 0x40, // doc
  68. MMAPP_SUPPORT_DOCX = 0x80, // docx
  69. MMAPP_SUPPORT_PPT = 0x100, // ppt
  70. MMAPP_SUPPORT_PPTX = 0x200, // pptx
  71. MMAPP_SUPPORT_XLS = 0x400, // xls
  72. MMAPP_SUPPORT_XLSX = 0x800, // xlsx
  73. MMAPP_SUPPORT_PDF = 0x1000, // pdf
  74. };
  75. /*! @brief log的级别
  76. *
  77. */
  78. typedef NS_ENUM(NSInteger,WXLogLevel){
  79. WXLogLevelNormal = 0, // 打印日常的日志
  80. WXLogLevelDetail = 1, // 打印详细的日志
  81. };
  82. /*! @brief 打印回调的block
  83. *
  84. */
  85. typedef void(^WXLogBolock)(NSString * log);
  86. #pragma mark - BaseReq
  87. /*! @brief 该类为微信终端SDK所有请求类的基类
  88. *
  89. */
  90. @interface BaseReq : NSObject
  91. /** 请求类型 */
  92. @property (nonatomic, assign) int type;
  93. /** 由用户微信号和AppID组成的唯一标识,发送请求时第三方程序必须填写,用于校验微信用户是否换号登录*/
  94. @property (nonatomic, retain) NSString* openID;
  95. @end
  96. #pragma mark - BaseResp
  97. /*! @brief 该类为微信终端SDK所有响应类的基类
  98. *
  99. */
  100. @interface BaseResp : NSObject
  101. /** 错误码 */
  102. @property (nonatomic, assign) int errCode;
  103. /** 错误提示字符串 */
  104. @property (nonatomic, retain) NSString *errStr;
  105. /** 响应类型 */
  106. @property (nonatomic, assign) int type;
  107. @end
  108. #pragma mark - WXMediaMessage
  109. @class WXMediaMessage;
  110. #ifndef BUILD_WITHOUT_PAY
  111. /*! @brief 第三方向微信终端发起支付的消息结构体
  112. *
  113. * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果
  114. * @see PayResp
  115. */
  116. @interface PayReq : BaseReq
  117. /** 商家向财付通申请的商家id */
  118. @property (nonatomic, retain) NSString *partnerId;
  119. /** 预支付订单 */
  120. @property (nonatomic, retain) NSString *prepayId;
  121. /** 随机串,防重发 */
  122. @property (nonatomic, retain) NSString *nonceStr;
  123. /** 时间戳,防重发 */
  124. @property (nonatomic, assign) UInt32 timeStamp;
  125. /** 商家根据财付通文档填写的数据和签名 */
  126. @property (nonatomic, retain) NSString *package;
  127. /** 商家根据微信开放平台文档对数据做的签名 */
  128. @property (nonatomic, retain) NSString *sign;
  129. @end
  130. #pragma mark - PayResp
  131. /*! @brief 微信终端返回给第三方的关于支付结果的结构体
  132. *
  133. * 微信终端返回给第三方的关于支付结果的结构体
  134. */
  135. @interface PayResp : BaseResp
  136. /** 财付通返回给商家的信息 */
  137. @property (nonatomic, retain) NSString *returnKey;
  138. @end
  139. #pragma mark - WXOfflinePay
  140. /*! @brief 第三方向微信终端发起离线支付
  141. *
  142. * 第三方向微信终端发起离线支付的消息结构体
  143. */
  144. @interface WXOfflinePayReq : BaseReq
  145. @end
  146. /*! @brief 第三方向微信终端发起离线支付返回
  147. *
  148. * 第三方向微信终端发起离线支付返回的消息结构体
  149. */
  150. @interface WXOfflinePayResp : BaseResp
  151. @end
  152. #endif
  153. #pragma mark - SendAuthReq
  154. /*! @brief 第三方程序向微信终端请求认证的消息结构
  155. *
  156. * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,
  157. * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
  158. * @see SendAuthResp
  159. */
  160. @interface SendAuthReq : BaseReq
  161. /** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
  162. * @see SendAuthResp
  163. * @note scope字符串长度不能超过1K
  164. */
  165. @property (nonatomic, retain) NSString* scope;
  166. /** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。
  167. * @note state字符串长度不能超过1K
  168. */
  169. @property (nonatomic, retain) NSString* state;
  170. @end
  171. #pragma mark - SendAuthResp
  172. /*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。
  173. *
  174. * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。
  175. * 微信终端处理完后会向第三方程序发送一个SendAuthResp。
  176. * @see onResp
  177. */
  178. @interface SendAuthResp : BaseResp
  179. @property (nonatomic, retain) NSString* code;
  180. /** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传
  181. * @note state字符串长度不能超过1K
  182. */
  183. @property (nonatomic, retain) NSString* state;
  184. @property (nonatomic, retain) NSString* lang;
  185. @property (nonatomic, retain) NSString* country;
  186. @end
  187. #pragma mark - SendMessageToWXReq
  188. /*! @brief 第三方程序发送消息至微信终端程序的消息结构体
  189. *
  190. * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息,
  191. * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。
  192. * @see SendMessageToWXResp
  193. */
  194. @interface SendMessageToWXReq : BaseReq
  195. /** 发送消息的文本内容
  196. * @note 文本长度必须大于0且小于10K
  197. */
  198. @property (nonatomic, retain) NSString* text;
  199. /** 发送消息的多媒体内容
  200. * @see WXMediaMessage
  201. */
  202. @property (nonatomic, retain) WXMediaMessage* message;
  203. /** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
  204. @property (nonatomic, assign) BOOL bText;
  205. /** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。
  206. * @see WXScene
  207. */
  208. @property (nonatomic, assign) int scene;
  209. /** 指定发送消息的人,WXSceneSpecifiedSession时有效 */
  210. @property (nonatomic, retain) NSString* toUserOpenId;
  211. @end
  212. #pragma mark - SendMessageToWXResp
  213. /*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。
  214. *
  215. * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。
  216. */
  217. @interface SendMessageToWXResp : BaseResp
  218. @property(nonatomic, retain) NSString* lang;
  219. @property(nonatomic, retain) NSString* country;
  220. @end
  221. #pragma mark - GetMessageFromWXReq
  222. /*! @brief 微信终端向第三方程序请求提供内容的消息结构体。
  223. *
  224. * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体,
  225. * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。
  226. */
  227. @interface GetMessageFromWXReq : BaseReq
  228. @property (nonatomic, retain) NSString* lang;
  229. @property (nonatomic, retain) NSString* country;
  230. @end
  231. #pragma mark - GetMessageFromWXResp
  232. /*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。
  233. *
  234. * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。
  235. */
  236. @interface GetMessageFromWXResp : BaseResp
  237. /** 向微信终端提供的文本内容
  238. @note 文本长度必须大于0且小于10K
  239. */
  240. @property (nonatomic, retain) NSString* text;
  241. /** 向微信终端提供的多媒体内容。
  242. * @see WXMediaMessage
  243. */
  244. @property (nonatomic, retain) WXMediaMessage* message;
  245. /** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
  246. @property (nonatomic, assign) BOOL bText;
  247. @end
  248. #pragma mark - ShowMessageFromWXReq
  249. /*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。
  250. *
  251. * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
  252. * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
  253. */
  254. @interface ShowMessageFromWXReq : BaseReq
  255. /** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容
  256. * @see WXMediaMessage
  257. */
  258. @property (nonatomic, retain) WXMediaMessage* message;
  259. @property (nonatomic, retain) NSString* lang;
  260. @property (nonatomic, retain) NSString* country;
  261. @end
  262. #pragma mark - ShowMessageFromWXResp
  263. /*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。
  264. *
  265. * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
  266. * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
  267. */
  268. @interface ShowMessageFromWXResp : BaseResp
  269. @end
  270. #pragma mark - LaunchFromWXReq
  271. /*! @brief 微信终端打开第三方程序携带的消息结构体
  272. *
  273. * 微信向第三方发送的结构体,第三方不需要返回
  274. */
  275. @interface LaunchFromWXReq : BaseReq
  276. @property (nonatomic, retain) WXMediaMessage* message;
  277. @property (nonatomic, retain) NSString* lang;
  278. @property (nonatomic, retain) NSString* country;
  279. @end
  280. #pragma mark - OpenTempSessionReq
  281. /* ! @brief 第三方通知微信,打开临时会话
  282. *
  283. * 第三方通知微信,打开临时会话
  284. */
  285. @interface OpenTempSessionReq : BaseReq
  286. /** 需要打开的用户名
  287. * @attention 长度不能超过512字节
  288. */
  289. @property (nonatomic, retain) NSString* username;
  290. /** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景
  291. * @attention 长度不能超过32位
  292. */
  293. @property (nonatomic, retain) NSString* sessionFrom;
  294. @end
  295. #pragma mark - OpenTempSessionResp
  296. /*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。
  297. *
  298. * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。
  299. */
  300. @interface OpenTempSessionResp : BaseResp
  301. @end
  302. #pragma mark - OpenWebviewReq
  303. /* ! @brief 第三方通知微信启动内部浏览器,打开指定网页
  304. *
  305. * 第三方通知微信启动内部浏览器,打开指定Url对应的网页
  306. */
  307. @interface OpenWebviewReq : BaseReq
  308. /** 需要打开的网页对应的Url
  309. * @attention 长度不能超过1024
  310. */
  311. @property(nonatomic,retain)NSString* url;
  312. @end
  313. #pragma mark - OpenWebviewResp
  314. /*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果
  315. *
  316. * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示
  317. */
  318. @interface OpenWebviewResp : BaseResp
  319. @end
  320. #pragma mark - WXOpenBusinessWebViewReq
  321. /*! @brief 第三方通知微信启动内部浏览器,打开指定业务的网页
  322. *
  323. *
  324. */
  325. @interface WXOpenBusinessWebViewReq : BaseReq
  326. /** 网页业务类型
  327. * @attention
  328. */
  329. @property (nonatomic, assign) UInt32 businessType;
  330. /** 网页业务参数
  331. * @attention
  332. */
  333. @property (nonatomic, retain) NSDictionary *queryInfoDic;
  334. @end
  335. #pragma mark - WXOpenBusinessWebViewResp
  336. /*! @brief 微信终端向第三方程序返回的WXOpenBusinessWebViewResp处理结果。
  337. *
  338. * 第三方程序向微信终端发送WXOpenBusinessWebViewReq后,微信发送回来的处理结果,该结果用WXOpenBusinessWebViewResp表示。
  339. */
  340. @interface WXOpenBusinessWebViewResp : BaseResp
  341. /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理
  342. * @attention 长度不能超过2k
  343. */
  344. @property (nonatomic, retain) NSString *result;
  345. /** 网页业务类型
  346. * @attention
  347. */
  348. @property (nonatomic, assign) UInt32 businessType;
  349. @end
  350. #pragma mark - OpenRankListReq
  351. /* ! @brief 第三方通知微信,打开硬件排行榜
  352. *
  353. * 第三方通知微信,打开硬件排行榜
  354. */
  355. @interface OpenRankListReq : BaseReq
  356. @end
  357. #pragma mark - OpenRanklistResp
  358. /*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。
  359. *
  360. * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。
  361. */
  362. @interface OpenRankListResp : BaseResp
  363. @end
  364. #pragma mark - JumpToBizProfileReq
  365. /* ! @brief 第三方通知微信,打开指定微信号profile页面
  366. *
  367. * 第三方通知微信,打开指定微信号profile页面
  368. */
  369. @interface JumpToBizProfileReq : BaseReq
  370. /** 跳转到该公众号的profile
  371. * @attention 长度不能超过512字节
  372. */
  373. @property (nonatomic, retain) NSString* username;
  374. /** 如果用户加了该公众号为好友,extMsg会上传到服务器
  375. * @attention 长度不能超过1024字节
  376. */
  377. @property (nonatomic, retain) NSString* extMsg;
  378. /**
  379. * 跳转的公众号类型
  380. * @see WXBizProfileType
  381. */
  382. @property (nonatomic, assign) int profileType;
  383. @end
  384. #pragma mark - JumpToBizWebviewReq
  385. /* ! @brief 第三方通知微信,打开指定usrname的profile网页版
  386. *
  387. */
  388. @interface JumpToBizWebviewReq : BaseReq
  389. /** 跳转的网页类型,目前只支持广告页
  390. * @see WXMPWebviewType
  391. */
  392. @property(nonatomic, assign) int webType;
  393. /** 跳转到该公众号的profile网页版
  394. * @attention 长度不能超过512字节
  395. */
  396. @property(nonatomic, retain) NSString* tousrname;
  397. /** 如果用户加了该公众号为好友,extMsg会上传到服务器
  398. * @attention 长度不能超过1024字节
  399. */
  400. @property(nonatomic, retain) NSString* extMsg;
  401. @end
  402. #pragma mark - WXCardItem
  403. @interface WXCardItem : NSObject
  404. /** 卡id
  405. * @attention 长度不能超过1024字节
  406. */
  407. @property (nonatomic,retain) NSString* cardId;
  408. /** ext信息
  409. * @attention 长度不能超过2024字节
  410. */
  411. @property (nonatomic,retain) NSString* extMsg;
  412. /**
  413. * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
  414. */
  415. @property (nonatomic,assign) UInt32 cardState;
  416. /**
  417. * @attention req不需要填,chooseCard返回的。
  418. */
  419. @property (nonatomic,retain) NSString* encryptCode;
  420. /**
  421. * @attention req不需要填,chooseCard返回的。
  422. */
  423. @property (nonatomic,retain) NSString* appID;
  424. @end;
  425. #pragma mark - WXInvoiceItem
  426. @interface WXInvoiceItem : NSObject
  427. /** 卡id
  428. * @attention 长度不能超过1024字节
  429. */
  430. @property (nonatomic,retain) NSString* cardId;
  431. /** ext信息
  432. * @attention 长度不能超过2024字节
  433. */
  434. @property (nonatomic,retain) NSString* extMsg;
  435. /**
  436. * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
  437. */
  438. @property (nonatomic,assign) UInt32 cardState;
  439. /**
  440. * @attention req不需要填,chooseCard返回的。
  441. */
  442. @property (nonatomic,retain) NSString* encryptCode;
  443. /**
  444. * @attention req不需要填,chooseCard返回的。
  445. */
  446. @property (nonatomic,retain) NSString* appID;
  447. @end
  448. #pragma mark - AddCardToWXCardPackageReq
  449. /* ! @brief 请求添加卡券至微信卡包
  450. *
  451. */
  452. @interface AddCardToWXCardPackageReq : BaseReq
  453. /** 卡列表
  454. * @attention 个数不能超过40个 类型WXCardItem
  455. */
  456. @property (nonatomic,retain) NSArray* cardAry;
  457. @end
  458. #pragma mark - AddCardToWXCardPackageResp
  459. /** ! @brief 微信返回第三方添加卡券结果
  460. *
  461. */
  462. @interface AddCardToWXCardPackageResp : BaseResp
  463. /** 卡列表
  464. * @attention 个数不能超过40个 类型WXCardItem
  465. */
  466. @property (nonatomic,retain) NSArray* cardAry;
  467. @end
  468. #pragma mark - WXChooseCardReq
  469. /* ! @brief 请求从微信选取卡券
  470. *
  471. */
  472. @interface WXChooseCardReq : BaseReq
  473. @property(nonatomic, strong) NSString *appID;
  474. @property(nonatomic, assign) UInt32 shopID;
  475. @property(nonatomic, assign) UInt32 canMultiSelect;
  476. @property(nonatomic, strong) NSString *cardType;
  477. @property(nonatomic, strong) NSString *cardTpID;
  478. @property(nonatomic, strong) NSString *signType;
  479. @property(nonatomic, strong) NSString *cardSign;
  480. @property(nonatomic, assign) UInt32 timeStamp;
  481. @property(nonatomic, strong) NSString *nonceStr;
  482. @end
  483. #pragma mark - WXChooseCardResp
  484. /** ! @brief 微信返回第三方请求选择卡券结果
  485. *
  486. */
  487. @interface WXChooseCardResp : BaseResp
  488. @property (nonatomic,retain) NSArray* cardAry;
  489. @end
  490. #pragma mark - WXChooseInvoiceReq
  491. /* ! @brief 请求从微信选取发票
  492. *
  493. */
  494. @interface WXChooseInvoiceReq : BaseReq
  495. @property (nonatomic, strong) NSString *appID;
  496. @property (nonatomic, assign) UInt32 shopID;
  497. @property (nonatomic, strong) NSString *signType;
  498. @property (nonatomic, strong) NSString *cardSign;
  499. @property (nonatomic, assign) UInt32 timeStamp;
  500. @property (nonatomic, strong) NSString *nonceStr;
  501. @end
  502. #pragma mark - WXChooseInvoiceResp
  503. /** ! @brief 微信返回第三方请求选择发票结果
  504. *
  505. */
  506. @interface WXChooseInvoiceResp : BaseResp
  507. @property (nonatomic, strong) NSArray* cardAry;
  508. @end
  509. #pragma mark - WXSubscriptionReq
  510. @interface WXSubscribeMsgReq : BaseReq
  511. @property (nonatomic, assign) UInt32 scene;
  512. @property (nonatomic, strong) NSString * templateId;
  513. @property (nonatomic, strong) NSString * reserved;
  514. @end
  515. #pragma mark - WXSubscriptionReq
  516. @interface WXSubscribeMsgResp : BaseResp
  517. @property (nonatomic, strong) NSString *templateId;
  518. @property (nonatomic, assign) UInt32 scene;
  519. @property (nonatomic, strong) NSString *action;
  520. @property (nonatomic, strong) NSString * reserved;
  521. @property (nonatomic, strong) NSString * openId;
  522. @end
  523. #pragma mark - WXSubscribeMiniProgramMsg
  524. /** ! @brief 微信返回第三方请求选择发票结果
  525. *
  526. */
  527. @interface WXSubscribeMiniProgramMsgReq : BaseReq
  528. @property (nonatomic, strong) NSString * miniProgramAppid;
  529. @end
  530. #pragma mark - WXSubscriptionReq
  531. @interface WXSubscribeMiniProgramMsgResp : BaseResp
  532. @property(nonatomic, strong) NSString *openId; // 小程序openid
  533. @property(nonatomic, strong) NSString *unionId; // unionId
  534. @property(nonatomic, strong) NSString *nickName; // 用户昵称
  535. @end
  536. #pragma mark - WXinvoiceAuthInsertReq
  537. @interface WXInvoiceAuthInsertReq : BaseReq
  538. @property (nonatomic, strong) NSString *urlString;
  539. @end
  540. #pragma mark - WXinvoiceAuthInsertResp
  541. @interface WXInvoiceAuthInsertResp : BaseResp
  542. @property (nonatomic, strong) NSString * wxOrderId;
  543. @end
  544. #pragma mark - WXNontaxPayReq
  545. @interface WXNontaxPayReq:BaseReq
  546. @property (nonatomic, strong) NSString *urlString;
  547. @end
  548. #pragma mark - WXNontaxPayResp
  549. @interface WXNontaxPayResp : BaseResp
  550. @property (nonatomic, strong) NSString *wxOrderId;
  551. @end
  552. #pragma mark - WXPayInsuranceReq
  553. @interface WXPayInsuranceReq : BaseReq
  554. @property (nonatomic, strong) NSString *urlString;
  555. @end
  556. #pragma mark - WXPayInsuranceResp
  557. @interface WXPayInsuranceResp : BaseResp
  558. @property (nonatomic, strong) NSString *wxOrderId;
  559. @end
  560. #pragma mark - WXMediaMessage
  561. #pragma mark - WXMediaMessage
  562. /*! @brief 多媒体消息结构体
  563. *
  564. * 用于微信终端和第三方程序之间传递消息的多媒体消息内容
  565. */
  566. @interface WXMediaMessage : NSObject
  567. +(WXMediaMessage *) message;
  568. /** 标题
  569. * @note 长度不能超过512字节
  570. */
  571. @property (nonatomic, retain) NSString *title;
  572. /** 描述内容
  573. * @note 长度不能超过1K
  574. */
  575. @property (nonatomic, retain) NSString *description;
  576. /** 缩略图数据
  577. * @note 大小不能超过32K
  578. */
  579. @property (nonatomic, retain) NSData *thumbData;
  580. /**
  581. * @note 长度不能超过64字节
  582. */
  583. @property (nonatomic, retain) NSString *mediaTagName;
  584. /**
  585. *
  586. */
  587. @property (nonatomic, retain) NSString *messageExt;
  588. @property (nonatomic, retain) NSString *messageAction;
  589. /**
  590. * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。
  591. */
  592. @property (nonatomic, retain) id mediaObject;
  593. /*! @brief 设置消息缩略图的方法
  594. *
  595. * @param image 缩略图
  596. * @note 大小不能超过32K
  597. */
  598. - (void) setThumbImage:(UIImage *)image;
  599. @end
  600. #pragma mark - WXImageObject
  601. /*! @brief 多媒体消息中包含的图片数据对象
  602. *
  603. * 微信终端和第三方程序之间传递消息中包含的图片数据对象。
  604. * @note imageData成员不能为空
  605. * @see WXMediaMessage
  606. */
  607. @interface WXImageObject : NSObject
  608. /*! @brief 返回一个WXImageObject对象
  609. *
  610. * @note 返回的WXImageObject对象是自动释放的
  611. */
  612. +(WXImageObject *) object;
  613. /** 图片真实数据内容
  614. * @note 大小不能超过10M
  615. */
  616. @property (nonatomic, retain) NSData *imageData;
  617. @end
  618. #pragma mark - WXMusicObject
  619. /*! @brief 多媒体消息中包含的音乐数据对象
  620. *
  621. * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。
  622. * @note musicUrl和musicLowBandUrl成员不能同时为空。
  623. * @see WXMediaMessage
  624. */
  625. @interface WXMusicObject : NSObject
  626. /*! @brief 返回一个WXMusicObject对象
  627. *
  628. * @note 返回的WXMusicObject对象是自动释放的
  629. */
  630. +(WXMusicObject *) object;
  631. /** 音乐网页的url地址
  632. * @note 长度不能超过10K
  633. */
  634. @property (nonatomic, retain) NSString *musicUrl;
  635. /** 音乐lowband网页的url地址
  636. * @note 长度不能超过10K
  637. */
  638. @property (nonatomic, retain) NSString *musicLowBandUrl;
  639. /** 音乐数据url地址
  640. * @note 长度不能超过10K
  641. */
  642. @property (nonatomic, retain) NSString *musicDataUrl;
  643. /**音乐lowband数据url地址
  644. * @note 长度不能超过10K
  645. */
  646. @property (nonatomic, retain) NSString *musicLowBandDataUrl;
  647. @end
  648. #pragma mark - WXVideoObject
  649. /*! @brief 多媒体消息中包含的视频数据对象
  650. *
  651. * 微信终端和第三方程序之间传递消息中包含的视频数据对象。
  652. * @note videoUrl和videoLowBandUrl不能同时为空。
  653. * @see WXMediaMessage
  654. */
  655. @interface WXVideoObject : NSObject
  656. /*! @brief 返回一个WXVideoObject对象
  657. *
  658. * @note 返回的WXVideoObject对象是自动释放的
  659. */
  660. +(WXVideoObject *) object;
  661. /** 视频网页的url地址
  662. * @note 长度不能超过10K
  663. */
  664. @property (nonatomic, retain) NSString *videoUrl;
  665. /** 视频lowband网页的url地址
  666. * @note 长度不能超过10K
  667. */
  668. @property (nonatomic, retain) NSString *videoLowBandUrl;
  669. @end
  670. #pragma mark - WXWebpageObject
  671. /*! @brief 多媒体消息中包含的网页数据对象
  672. *
  673. * 微信终端和第三方程序之间传递消息中包含的网页数据对象。
  674. * @see WXMediaMessage
  675. */
  676. @interface WXWebpageObject : NSObject
  677. /*! @brief 返回一个WXWebpageObject对象
  678. *
  679. * @note 返回的WXWebpageObject对象是自动释放的
  680. */
  681. +(WXWebpageObject *) object;
  682. /** 网页的url地址
  683. * @note 不能为空且长度不能超过10K
  684. */
  685. @property (nonatomic, retain) NSString *webpageUrl;
  686. @end
  687. #pragma mark - WXAppExtendObject
  688. /*! @brief 多媒体消息中包含的App扩展数据对象
  689. *
  690. * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息,
  691. * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。
  692. * @note url,extInfo和fileData不能同时为空
  693. * @see WXMediaMessage
  694. */
  695. @interface WXAppExtendObject : NSObject
  696. /*! @brief 返回一个WXAppExtendObject对象
  697. *
  698. * @note 返回的WXAppExtendObject对象是自动释放的
  699. */
  700. +(WXAppExtendObject *) object;
  701. /** 若第三方程序不存在,微信终端会打开该url所指的App下载地址
  702. * @note 长度不能超过10K
  703. */
  704. @property (nonatomic, retain) NSString *url;
  705. /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理
  706. * @note 长度不能超过2K
  707. */
  708. @property (nonatomic, retain) NSString *extInfo;
  709. /** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理
  710. * @note 大小不能超过10M
  711. */
  712. @property (nonatomic, retain) NSData *fileData;
  713. @end
  714. #pragma mark - WXEmoticonObject
  715. /*! @brief 多媒体消息中包含的表情数据对象
  716. *
  717. * 微信终端和第三方程序之间传递消息中包含的表情数据对象。
  718. * @see WXMediaMessage
  719. */
  720. @interface WXEmoticonObject : NSObject
  721. /*! @brief 返回一个WXEmoticonObject对象
  722. *
  723. * @note 返回的WXEmoticonObject对象是自动释放的
  724. */
  725. +(WXEmoticonObject *) object;
  726. /** 表情真实数据内容
  727. * @note 大小不能超过10M
  728. */
  729. @property (nonatomic, retain) NSData *emoticonData;
  730. @end
  731. #pragma mark - WXFileObject
  732. /*! @brief 多媒体消息中包含的文件数据对象
  733. *
  734. * @see WXMediaMessage
  735. */
  736. @interface WXFileObject : NSObject
  737. /*! @brief 返回一个WXFileObject对象
  738. *
  739. * @note 返回的WXFileObject对象是自动释放的
  740. */
  741. +(WXFileObject *) object;
  742. /** 文件后缀名
  743. * @note 长度不超过64字节
  744. */
  745. @property (nonatomic, retain) NSString *fileExtension;
  746. /** 文件真实数据内容
  747. * @note 大小不能超过10M
  748. */
  749. @property (nonatomic, retain) NSData *fileData;
  750. @end
  751. #pragma mark - WXLocationObject
  752. /*! @brief 多媒体消息中包含的地理位置数据对象
  753. *
  754. * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。
  755. * @see WXMediaMessage
  756. */
  757. @interface WXLocationObject : NSObject
  758. /*! @brief 返回一个WXLocationObject对象
  759. *
  760. * @note 返回的WXLocationObject对象是自动释放的
  761. */
  762. +(WXLocationObject *) object;
  763. /** 地理位置信息
  764. * @note 经纬度
  765. */
  766. @property (nonatomic, assign) double lng; //经度
  767. @property (nonatomic, assign) double lat; //纬度
  768. @end
  769. @interface WXMiniProgramObject : NSObject
  770. /*! @brief WXMiniProgramObject对象
  771. *
  772. * @note 返回的WXMiniProgramObject对象是自动释放的
  773. */
  774. +(WXMiniProgramObject *) object;
  775. @property (nonatomic, strong) NSString *webpageUrl; //低版本网页链接
  776. @property (nonatomic, strong) NSString *userName; //小程序username
  777. @property (nonatomic, strong) NSString *path; //小程序页面的路径
  778. @property (nonatomic, strong) NSData *hdImageData; // 小程序新版本的预览图 128k
  779. @property (nonatomic, assign) BOOL withShareTicket; //是否使用带 shareTicket 的转发
  780. @property (nonatomic, assign) WXMiniProgramType miniProgramType; // 分享小程序的版本(正式,开发,体验)
  781. @end
  782. #pragma mark - WXLaunchMiniProgramReq
  783. /*! @brief WXLaunchMiniProgramReq对象, 可实现通过sdk拉起微信小程序
  784. *
  785. * @note 返回的WXLaunchMiniProgramReq对象是自动释放的
  786. */
  787. @interface WXLaunchMiniProgramReq : BaseReq
  788. +(WXLaunchMiniProgramReq *) object;
  789. @property (nonatomic, strong) NSString *userName; //拉起的小程序的username
  790. @property (nonatomic, strong) NSString *path; //拉起小程序页面的路径,不填默认拉起小程序首页
  791. @property (nonatomic, assign) WXMiniProgramType miniProgramType; //拉起小程序的类型
  792. @property (nonatomic, strong) NSString *extMsg; //json格式
  793. @end
  794. #pragma mark - WXLaunchMiniProgramResp
  795. /*! @brief 微信终端向第三方程序返回的WXLaunchMiniProgramReq处理结果。
  796. *
  797. * 第三方程序向微信终端发送WXLaunchMiniProgramReq后,微信发送回来的处理结果,该结果用WXLaunchMiniProgramResp表示。
  798. */
  799. @interface WXLaunchMiniProgramResp : BaseResp
  800. @property (nonatomic, retain) NSString *extMsg;
  801. @end
  802. #pragma mark - WXTextObject
  803. /*! @brief 多媒体消息中包含的文本数据对象
  804. *
  805. * 微信终端和第三方程序之间传递消息中包含的文本数据对象。
  806. * @see WXMediaMessage
  807. */
  808. @interface WXTextObject : NSObject
  809. /*! @brief 返回一个WXTextObject对象
  810. *
  811. * @note 返回的WXTextObject对象是自动释放的
  812. */
  813. +(WXTextObject *) object;
  814. /** 地理位置信息
  815. * @note 文本内容
  816. */
  817. @property (nonatomic, retain) NSString *contentText;
  818. @end