如何区分安卓与iOS在传递参数的方式上有什么不同?

更新于
2026-09-30 17:58:42
0阅读来源:SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计85个文字,预计阅读时间需要1分钟。

如何区分安卓与iOS在传递参数的方式上有什么不同?

plaintextgistfile1.txt: 为APP推广广告,根据设备类型调用相应方法。如果是Android设备,使用ShareClick.adNew方法;如果是iOS设备,通过webkit.messageHandlers.adNew.postMessage方法。

如何区分安卓与iOS在传递参数的方式上有什么不同?

gistfile1.txt

//给app传广告id if (data.userAgent.indexOf('native_Android') > 0) { window.ShareClick.adNew(data.adBoard.adId, data.adBoard.id); } else if(data.userAgent.indexOf('native_iOS') > -1) { window.webkit.messageHandlers.adNew.postMessage({ adId: data.adBoard.adId, bdId: data.adBoard.id }); }

本文共计85个文字,预计阅读时间需要1分钟。

如何区分安卓与iOS在传递参数的方式上有什么不同?

plaintextgistfile1.txt: 为APP推广广告,根据设备类型调用相应方法。如果是Android设备,使用ShareClick.adNew方法;如果是iOS设备,通过webkit.messageHandlers.adNew.postMessage方法。

如何区分安卓与iOS在传递参数的方式上有什么不同?

gistfile1.txt

//给app传广告id if (data.userAgent.indexOf('native_Android') > 0) { window.ShareClick.adNew(data.adBoard.adId, data.adBoard.id); } else if(data.userAgent.indexOf('native_iOS') > -1) { window.webkit.messageHandlers.adNew.postMessage({ adId: data.adBoard.adId, bdId: data.adBoard.id }); }