美文网首页iOS Developer
iOS微信分享检测

iOS微信分享检测

作者: 字母大师 | 来源:发表于2017-01-04 21:21 被阅读0次

import "AppDelegate.h"

- (void)onResp:(BaseResp *)resp
{
    
    /*
     WXSuccess           = 0,   成功
     WXErrCodeCommon     = -1,   普通错误类型
     WXErrCodeUserCancel = -2,   用户点击取消并返回
     WXErrCodeSentFail   = -3,    发送失败
     WXErrCodeAuthDeny   = -4,   授权失败
     WXErrCodeUnsupport  = -5,    微信不支持
     */
    NSString * strMsg = [NSString stringWithFormat:@"errorCode: %d",resp.errCode];
    NSLog(@"strMsg: %@",strMsg);
    
    NSString * errStr       = [NSString stringWithFormat:@"errStr: %@",resp.errStr];
    NSLog(@"errStr: %@",errStr);
    
    
    NSString * strTitle;
    //判断是微信消息的回调 --> 是支付回调回来的还是消息回调回来的.
    if ([resp isKindOfClass:[SendMessageToWXResp class]])
    {
        
        // 判断errCode 进行回调处理
        if (resp.errCode == 0)
        {
            strTitle = [NSString stringWithFormat:@"分享成功"];
        }
    }
    
//发出通知 从微信回调回来之后,发一个通知,让请求支付的页面接收消息,并且展示出来,或者进行一些自定义的展示或者跳转
    NSNotification * notification = [NSNotification notificationWithName:@"WXShare" object:@(resp.errCode)];
    [[NSNotificationCenter defaultCenter] postNotification:notification];
}

文件中

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getOrderPayResult:) name:@"WXShare" object:nil];

- (void)getOrderPayResult:(NSNotification *)notification
{}

相关文章

  • iOS微信分享检测

    import "AppDelegate.h" 文件中

  • iOS 微信编译速度优化分享

    iOS 微信编译速度优化分享iOS 微信编译速度优化分享

  • 卡顿检测资料

    微信iOS卡顿监控系统 卡顿方案思考 卡顿检测 移动端监控体系之技术原理 iOS性能检测

  • 2020-10-29

    ios从app分享到微信然后微信再分享到微信出现分享标题、图片、描述设置了但是没有生效的问题 通过观察发现ios中...

  • CocosCreator-【微信SDK】IOS平台-IOS微信分

    在android平台的微信分享后是ios平台的微信分享,ios分享也不复杂,原理和android 一样,js客户端...

  • iOS通过runloop监控卡顿

    质量监控-卡顿检测iOS实时卡顿监控基于Runloop简单监测iOS卡顿的demo微信iOS卡顿监控系统iOS-R...

  • 博文

    iOS微信特殊字符保护方案微信团队分享:MMKV--基于 mmap 的 iOS 高性能通用 key-value 组件

  • 分享:在iOS上自动检测内存泄露

    分享:在iOS上自动检测内存泄露 分享:在iOS上自动检测内存泄露

  • MobShareSDK 分享

    1.iOS 微信好友和微信朋友圈分享 桥接头部添加 具体微信分享 遇到弹框显示本地化问题

  • 【转载】微信分享填坑指南

    11月17日更新微信分享ios和安卓的区别 转载自 微信分享填坑指南 准备工作 如果想要是使用微信的分享功能,需要...

网友评论

    本文标题:iOS微信分享检测

    本文链接:https://www.haomeiwen.com/subject/uvdavttx.html