iOS-从App跳转到微信公众号

来源:互联网 发布:linux内存管理机制 编辑:程序博客网 时间:2024/05/16 04:36

本文只对于14年11月6日版本的微信API功能,但之后新版本的API已经去掉此功能,但本人博客一直没有更新,给大家带来不便敬请谅解。


2014年11月6日微信Api新增加的功能,使用时需要更新Api

#pragma mark - JumpToBizProfileReq

/* ! @brief 第三方通知微信,打开指定微信号profile页面

 *

 * 第三方通知微信,打开指定微信号profile页面

 */

@interface JumpToBizProfileReq :BaseReq

/** 跳转到该公众号的profile

 * @attention 长度不能超过512字节

 */

@property (nonatomic,retain)NSString* username;

/** 如果用户加了该公众号为好友,extMsg会上传到服务器

 * @attention 长度不能超过1024字节

 */

@property (nonatomic,retain)NSString* extMsg;

/**

 * 跳转的公众号类型

 * @see WXBizProfileType

 */

@property (nonatomic,assign)int profileType;

@end



使用方法:

    JumpToBizProfileReq *req = [[JumpToBizProfileReqalloc]init];

    req.profileType =WXBizProfileType_Normal;

//    enum WXBizProfileType{

//        WXBizProfileType_Normal = 0, /*普通公众号添加这一段代码 */

//        WXBizProfileType_Device = 1, /*硬件公众号添加这一段代码*/

//    };

    req.username =@"gh_xxxxxxx";/*公众号原始ID*/

//    req.extMsg = @"extMsg"; /*若为服务号或订阅号则本字段为空,硬件号则填写相关的硬件二维码串*/

    [WXApisendReq:req];




0 0
原创粉丝点击