Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
iOS開發者或許需要知道的一些網路與網頁前端知識及其combo技並如何在iOS13被摧毀又在i...
Search
YodaWang
December 12, 2019
Programming
360
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOS開發者或許需要知道的一些網路與網頁前端知識及其combo技並如何在iOS13被摧毀又在iOS13.3被修復
YodaWang
December 12, 2019
Other Decks in Programming
See All in Programming
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
13k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
170
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
540
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.7k
さぁV100、メモリをお食べ・・・
nilpe
0
150
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
560
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
6.9k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
150
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
840
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.3k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
580
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
Marketing to machines
jonoalderson
1
5.5k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
A Tale of Four Properties
chriscoyier
163
24k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Unsuck your backbone
ammeep
672
58k
The Limits of Empathy - UXLibs8
cassininazir
1
360
Transcript
在桌⾯建立捷徑 iOS開發者或許需要知道的⼀些網路與網⾴前端知識及其combo 技並如何在iOS13被摧毀⼜在iOS13.3被修復
桌⾯捷徑是啥
None
1. 是個網⾴,最好可以離線使⽤ 2. 被加到桌⾯時看起來要像個APP 3. 需要2種狀態 『提醒使⽤者加到主畫⾯』(很久以前有Private API 可以⽤)
『跳轉到APP』 我們的⽬標
跳轉到APP ‛ Deep Link 被加到桌⾯時看起來要像個APP ‛ ? 最好可以離線使⽤‛ ? 需要2種狀態‛
?
跳轉到APP ‛ Deep Link <a id="deeplink" href=“deeplink://some”></a> <script type="text/javascript"> var
element = document.getElementById(‘deeplink'); var event = document.createEvent('MouseEvents'); event.initEvent('click', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); setTimeout(function() { element.dispatchEvent(event); }, 25); </script> 1. 建立⼀個連結 2. ⽤ javascript 點擊這個連結
被加到桌⾯時看起來要像個APP <link rel="apple-touch-icon" href="/custom_icon.png"> apple-touch-icon Apple Document Configuring Web Applications
<meta name="apple-mobile-web-app-title" content="AppTitle"> apple-mobile-web-app-title
最好可以離線使⽤ Data URI data:[<mediatype>][;base64],<data> mediatype 為⼀ MIME type 字串,例如 JPEG
圖檔為「image/jpeg」,為非必要 參數,若省略的話,默認值為「text/plain;charset=US-ASCII」。 MIME type
需要2種狀態使⽤ <meta name="apple-mobile-web-app-capable" content="yes"> window.navigator.standalone true/false true false 跳轉 提醒
從桌⾯開啟時網⾴會是全螢幕狀態
guard let shortcutPage = URL(string: “data:text/html;base64,PGh0bWwPGh0bWw+Cjx…”) else { return }
UIApplication.shared.open(shortcutPage) 毫無反應 open(url:) 不⽀援 Data URI
About Apple URL Schemes 1. 找個server放個網⾴做轉址 https://swiftrocks.com/adding-deeplink-shortcuts-to-the-ios-home-screen.html 2. ⽤swifter 建
local server
iOS13…. 以上是iOS12之前的事
iOS12 之前在全螢幕模式下每次開啟都會reload並觸發JavaScript iOS13 只有launch時會load內容 iOS13.3 修好了
<meta name="apple-mobile-web-app-capable" content=“no"> ⽤ document.referrer 判斷 ⽅法1 ⽅法2 第⼀次開啟的時候在網址後⾯加 hash
tag,之後判斷 hash tag iOS13 ~ iOS13.2.1 該怎麼辦 不要使⽤全螢幕模式