当前位置:网站首页>h5在微信内自定义分享遇到的坑
h5在微信内自定义分享遇到的坑
2022-07-21 03:20:00 【少年的范儿】
问题:通过微信分享的api(updateAppMessageShareData)来自定义分享模板。
- 分享之后是个链接 ( qq分享正常, 微信分享之后是个链接)
- 预期是这样的
问题刨析:
- 首先确定在分享之前已经通过了微信的 checkJsApi接口 校验,并且走到了 wx.ready() 里面。
- 在移动端开发中,平时调试一个bug的时候,更方便的就是点击链接进入页面进行调试。(此时已经入坑 )
- 当你通过点击链接进入页面进行调试的时候,你会惊奇的发现,qq分享正常,可以得到预期的结果,而微信分享就失效了,分享出来的是个纯链接。
解决:
- 方案一:复制你想要分享的页面的链接到 草料二维码官网 去生成一个二维码,通过扫描二维码进入,再次分享,就可以得到预期的结果。
- 方案二:通过微信公众号分享
- 方案三:通过app分享
总结:总之,调试微信分享的时候,不要直接点击链接进去, 推荐使用方案一进行调试。
边栏推荐
- swift和OC对比,Swift的核心思想:面向协议编程
- JMeter learning notes 003-csv parameterization of JMeter
- 打造高性能应用,持续优化用户体验
- MYSQL06_ Seven join operations and union all of sql99
- Peripheral driver library development notes 44:ddc114 ADC driver
- 手把手教你安装MySQL数据库
- 软件测试面试题:测试计划工作的目的是什么?测试计划文档的内容应该包括什么?其中哪些是最重要的?
- MYSQL07_获取日期函数、聚合函数、字符串函数
- EasyExcel如何在项目中导出文件
- Software testing interview question: what is the task of testers in the process of software development?
猜你喜欢
Translation and interpretation of the paper: anytime bottom up rule learning for knowledge graph completion [anyburr]
过滤器 监听器
分布式.数据库架构
NFS服务配置
Web APIs DOM page special effects element size and position
Filter listener
TiDB 分布式批量解决方案
MYSQL06_sql99的7种JOIN操作、union all
MYSQL09_ Elaborate on database data types
Tutorial (7.0) 03 Forticlient EMS configuration and Management * forticlient EMS * Fortinet network security expert NSE 5
随机推荐
FTP服務配置
2022 software testing skills jmeter+ant+jenkins continuous integration and test report generation tutorial
NFS service configuration
Mapbox GL development tutorial (13): loading 3D surface layers (white mold)
[qt primer] Application of window classes
What is the difference between session and cookies?
Jujube technology he Yifan: what characteristics should NFT infrastructure have?
分布式.CAP理论
软件测试面试题:测试人员在软件开发过程中的任务是什么?
软件测试面试题:如何测试一个纸杯?
Ardunio development - I2C protocol communication - control 2x16lcd
06 JSON string for extracting data
软件测试面试题:测试计划工作的目的是什么?测试计划文档的内容应该包括什么?其中哪些是最重要的?
【LeetCode】1260. 2D mesh migration
[qt beginner] timer qtimer class
plantuml画链路图
Alibaba cloud released the industry's first "best practice map of live video technology"!
软件测试面试题:黑盒测试和白盒测试是软件测试的两种基本方法,请分别说明各自的优点和缺点!
Session 和 Cookies 有什么区别?
Seata之AT模式原理详解(三)