LoginSignup
6
5

More than 5 years have passed since last update.

iOS8対応-UIWebViewのshouldStartLoadWithRequestメソッド編

Last updated at Posted at 2014-09-23

iOS8対応のハイブリットアプリを作成している際に、shouldStartLoadWithRequestの挙動がかわったことに気づいたのでメモ

変化したところ
・shouldStartLoadWithRequestでは、URLエンコードが必須になった。

iOS8対応の仕方

1:該当部分をURLエンコードする

test.js
location.href='osaction://["ssssssssss":"ssssss"]'

上記を

test.js
location.href='osaction://%5b%22ssssssssss%22%3a%22ssssss%22%5d'

とする
osaction://(各自の処理分けるようの識別子)までは、URLエンコードしない。

2:以上

なお、iOS7でも同じコードで同じ挙動をしました。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5