Posts

Showing posts from May, 2020

Cordova Status Bar blank

由於之前因為 WKWebView 的關係 所以升級到 c ordova-ios @5(後來發現跟 io5 似乎沒關係) 但卻也造成 Status Bar 一片白的問題,只會出現綠色的電量 原本會出現日期等資訊 1. 請安裝 cordova-plugin-statusbar 套件 $ cordova plugin add cordova-plugin-statusbar 2. 將下方加入 config.xml         <preference name="StatusBarOverlaysWebView" value="false" />         <preference name="StatusBarBackgroundColor" value="#000000" />         <preference name="StatusBarStyle" value="lightcontent" />         <preference name="StatusBarDefaultScrollToTop" value="false" /> 3. 重新 build $ cordova platform rm ios $ cordova platform add ios@5 請注意,一定要使用 5 的版本 不然會無效喔 參考資訊 Status bar is always white #109

使用 acme.sh 搭配 Let's encrypt 申請 wildcard ssl 憑證

Image
之前一直都是使用 certbot 套件 不過換到 CentOS 8 後 這個套件到今天(2020.05.28)為止還沒支援就是 由於 certbot 是用 pythlon 開發的 所以安裝時會安裝一堆相依的套件 這也是我一直不喜歡用 certbot 的原因 會間接搞亂我的環境 後來找到 acme.sh 是使用 shell script 撰寫的 相對來說單純很多 安裝也很簡單 這個範例是搭配 Cloudflare DNS 做設定 安裝 acme.sh 我是使用 root 執行安裝的 curl  https://get.acme.sh | sh 所以安裝完會出現 /root/.acme.sh 這個資料夾 取得 Cloudflare 的 key 登入你的 cloudflare 帳號後 到這個頁面  https://dash.cloudflare.com/profile/api-tokens 點選下方「Global API Key」右邊的 View 認證完後會取得一組 Key 申請 SSL 憑證 在 /root/ 下新增一個 ssl_cert.sh 檔案 其中 yourdomain.tld 為你自己的網域名稱,如 google.com 因為有指定目錄於 /etc/letsencrypt 中 所以憑證應該會出現在 /etc/letsencrypt/yourdomain.tld 下 由於是 wildcard 的關係,所以會指定兩個 domain 分別為 yourdomian.tld 及 *.yourdomain.tld 請注意,務必讓 yourdomain.tld 在第一個,如果讓 *.yourdomain.tld 在前面的話,你的資料夾就會是 *.yourdomain.tld export CF_Key="your global api key" export CF_Email="你的 cloudflare 登入的帳號(信箱)" /root/.acme.sh/acme.sh --issue -d yourdomain.tld -d *.yourdomain.tld --cert-home /etc/letsencrypt --keylength 2048 --dns dns_cf \ --reloadcmd "system

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability.

Image
我的環境是 Cordova 8.1.2 Cordova 4.5.5 由於 Apple 之前已經有預告 2020.4.30 後不支援 UIWebView 需改成 WKWebView 如果沒改的話就會出現下面的錯誤 且上傳自動審核時會直接踢掉 然後直接發如上圖那封信給你 ITMS-90809: Deprecated API Usage  - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more ( https://developer.apple.com/ documentation/uikit/uiwebview ) . 只要依照下面幾個步驟就可以解決這個問題 1. 安裝 cordova-plugin-wkwebview-engine 套件 # cordova plugin add cordova-plugin-wkwebview-engine 2. 使用 cordova-ios 5 的版本(我的環境預設是 4,所以要手動) # cordova platform rm ios # cordova platform add ios@5 3. 修改 config.xml <platform name= "ios" > <preference name= "WKWebViewOnly" value= "true" /> <feature name= "CDVWKWebViewEngine" > <param name= "ios-package" value= "CDVWKWebViewEngine" /> </feature> <preference name= "CordovaWebViewEngine" value= &qu