怎么判断是苹果设备?

小程序 文章 2022-03-29 09:20 465 0 全屏看文

AI助手支持GPT4.0

怎么判断是苹果设备?How can you tell if it's an Apple device?

怎么判断是苹果设备?
wx.getSystemInfo({  success(res) {	if (res.platform == "ios" || res.system.indexOf('os') > 0 || res.system.indexOf('OS') > 0) {        	console.log('苹果')				} else {		console.log('安卓')			}    }})我的代码是这样判断苹果设备的,但是提交审核后,不在苹果中展示的业务,审核员端还是展示出来了,请问正确的判断方式是什么?

wx. getSystemInfo({ success(res) { if (res.platform == "ios" || res.system.indexOf('os') > 0 || res.system. indexOf('OS') > 0) { console. Log ('apple ') } else { console. Log ('android ') } }}) My code judges Apple Devices in this way, but after submitting for audit, the business that is not displayed in apple is still displayed on the auditor side. What is the correct judgment method?

回答:

brave:
  isDev() {    return wx.getSystemInfoSync().platform.toLowerCase().indexOf("devtools") > -1  }  isIOS() {    return wx.getSystemInfoSync().platform.toLowerCase().indexOf("ios") > -1  }  isAndroid() {    return wx.getSystemInfoSync().platform.toLowerCase().indexOf("android") > -1  }  isIPad() {    return wx.getSystemInfoSync().platform.toLowerCase().indexOf("ipad") > -1  }
老张:
initSys: function () {    console.log(app.globalData.systemInfo = wx.getSystemInfoSync())    app.globalData.isIOS = app.globalData.systemInfo.system.substring(0, 3) == 'iOS'  },
鲈鱼🐳:

审核人员用的是真机,还是模拟器?

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
高于2.10.4基础库也不支持getUserProfile?
企业微信目前有支持服务端程序生成企业微信个人二维码的API接口吗?
今天(2021.12.9)调用图片鉴黄接口一直失败,是微信这边服务爆掉了吗?
请问下,青蛙Pro小程序里面的这个背屏导航栏和背屏桌面图标 如何自行编辑样式、名称、图片、链接地址?
在小程序后台,哪里可以查询已经配置过的URL Scheme?
随便看看
2.12.2基础库更新 会导致自定义组件里面的 live-pusher 不被销毁 682
我就想做一个留言的小程序!行吗? 639
微信小程序消息推送启用后,网页客服和微信客服工具均无法收到消息 1128
原有微信小程序,如何更换成微信小商店? 1593
文章看了不能留言,请问怎么设置? 645
前端无法显示云存储的图片 690
自己想开发小程序,有哪位大神帮帮忙,想自己动手学学.好学吗? 564
前端image图片的URL是否包含云存储的FileID 668
非服务商如何获取access token? 595
小程序Image组件网络图片不显示,如何处理? 851