怎么判断是苹果设备?

小程序 文章 2022-03-29 09:20 440 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群

相关文章
提示微信版本过低?
我想问问大家微信开发者工具好用(纯属吐槽)吗?
小程序加载h5url的问题?
scroll-view的scrolltop设置太多次后 无法滚动?
是否支持卸载指定的页面?
随便看看
BT面板查看网站入口、账号密码的命令 5901
ucloud海外服务器超级优惠券 3203
根据您的消费情况,您的延停权益已发生变化,变更后的延停权益为延停额度20.00元 5756
为什么我们喜欢迈克尔杰克逊。 4086
阿里云com、cn域名续费优惠码(2020年5月可用) 3511
阿里云com、cn域名续费优惠码(2020年6月可用) 3514
微信公众号开五联增值税发票怎么处理 2888
仙之侠道幻彩衣的合成和属性预览 4250
仙之侠道2.8四象玉的合成和图片属性预览 3858
仙之侠道2.8赤狱战甲合成和属性预览 3204