SlideShare a Scribd company logo
1 of 26
2014.07.09
WordPressサイトをiPhoneアプリにしてみた
―構築事例の紹介―
Kiharu Sasaki
Introduction
Kiharu Sasaki
Web Designer
System Engineer
https://www.facebook.com/
kiharu.sasaki
@bump_of_kiharu
http://bump.hatenablog.com/
自己紹介
フリーランスでウェブデザインや
システム開発のお仕事をしています。
Overview 今回お話する内容
WordPressで構築した
NAZOPLA(謎プラ)という
クイズのポータルサイトを
iPhoneアプリにしました。
アプリ化した際の色々を
今回お話します。
NAZOPLA – 謎プラ –
http://nazopla.jp
経緯や背景
How it started ?
Site overview
自作クイズを1枚の画像にして投稿する、画像
投稿サイト。
投稿されたクイズに対して、回答したり、ヒ
ントを見たり、評価を付けてランキングを楽
しむことが出来ます。
NAZOPLA :
クイズを投稿したり、クイズに回
答できる謎のプラットフォーム。
サイトの紹介
Site overview
ソーシャルログイン
評価
クイズの投稿 クイズの回答
Facebook / Twitter
アカウントでの会員登録・
ログイン
投稿されたクイズに対して
「難易度」「面白さ」を評価
クイズ画像の投稿、
ヒントや回答期限の設定など
• 回答者ランキング
• 人気クイズランキング
正解することでポイント獲得
正解順によって獲得ポイント
が変動
週1回のメルマガ発行
NAZOPLAの主な機能
ランキング メールマガジン
サイトの紹介
Site overview
モバイル(タブレット含)のア
クセスは50%、内60%がiOSデバ
イスからのアクセス
サービス開始1年半で、会員
数・PVともに順調に伸びている
が、更なる向上を目指したい
Year-
Month
PV
2014 – 01 130,000
2014 – 02 110,000
2014 – 03 130,000
2014 – 04 120,000
2014 – 05 150,000
2014 – 06 170,000
Mobile:
50%
iOS:
60%
平均月間PV
会員数
サービス期間
13万PV
7,000
16ヶ月
サイトの紹介
Conclusion
スマホアプリ化の検討
モバイルからのアクセスが5割を占めるが、モバイルに最適化
したページ表示が出来ていない。
ページ数が膨大で、レスポンシブ対応に工数がかかる。
モバイルの特生を活用した新たな利用法を模索し、サービスの
拡充をはかりたい。
What is the problem? モバイル対応の課題
As for mobile app
アプリ化について
Point of difference Webとの違い
オフラインでも
利用可能
モバイル特有の機能
(GPS / 傾き・近接センサーなど)
マネタイズ
(有料公開・アプリ内課金)
Webクリエイターが、つい見落としがちな
モバイルアプリとWebアプリの大きな違い。
プッシュ通知を利用して、ユーザーの能動的アク
セスを促せる
モバイルに特化したユーザビリティを提供すること
でUXを高め、回遊率・連続利用時間の向上や、サ
ービス自体の継続利用が見込める
検索エンジンからだけでなく、App Store / Google
Playからの流入が期待できる
新規ユーザーの獲得
アクセス頻度の向上
継続利用の促進
アプリ化のメリットMerit
iOS / Android / WindowMobile など、プラットフォーム別に開発が必要。(※)
さらにバージョン別に継続したエンハンスも必要。
(※ハイブリッドアプリという選択肢もある)
ユーザーニーズを把握できるという良い面もありますが…
アプリの公開・更新には審査が必要。
また、バージョンアップの反映はユーザー次第なので、変更を完全にコントロ
ール出来ない。
公開・更新タイミング
開発コスト
ユーザーによる評価制度
アプリ化のデメリットDemerit
ハイブリッドアプリ
アプリ化する方法
ネイティブコードによる開発
HTML5 / CSS / JavaScriptを利用した
フレームワークでの開発
ネイティブアプリ
Android Java (C / C++ 他)
iOS
Objective-c / Swift
(C / C++ 他)
Windows Mobile 7 XNA / Silverlight
BlackBerry Java
• PhoneGap
• Titanium Mobile
• Monaca など他多数
※その他ゲーム系のアプリ開発では
Unity / Cocos2d / Adobe Air などのフレームワークも有名
Development
ハイブリッド
アプリ
• デバイスの機能を最大限に利用可能
• 処理速度が早い
• ワンソース・マルチデバイスのため
保守性が良い
• 学習コストが低い
• プラットフォームごとの開発が必要な
ため、学習コスト・開発コストが高い
• OSごとに異なるエンハンスが必要なた
め保守性が悪い
• 処理速度やレンダリングなどでネイテ
ィブに劣る
• フレームワークによっては、利用でき
ないデバイスの機能や制限がある
メリット
デメリット
メリット
デメリット
アプリ化する方法Development
ネイティブ
アプリ
WebViewベースアプリ
• アプリ内にブラウザを埋め込んで表示させる
• メインコンテンツはアプリ内ブラウザでWebページを表示
• デバイス機能の呼び出しなど、一部ネイティブで実装
WebView-based app
• WebView部分は即時反映できる。
審査も不要なので、更新の反映とタイ
ミングを完全にコントロールできる
• ネイティブでは表現出来ない、細かい
デザインの実現が可能になる
メリット
【参考】http://el.jibun.atmarkit.co.jp/rails/2012/10/html5-d1ba.html
第3の選択肢: WebView
• オフラインでは使えない
• Appleの審査が厳しくなる
(かもしれない)
デメリット
クックパッドアプリ(Andoroid版)など最近は多い
iOSっぽくないアプリ
それウェブでいいじゃん、
なアプリ
有用性や独自性がないアプリ
単にウェブサイトをバンドルしたもの
デバイスの機能を活かしていないもの
機能が単純、コンテンツが少ないもの
永続した価値を提供しないと判断されるもの
UIがガイドラインに従っていないもの
(ボタンの高さなど細かく指定あり)
WebViewベースのアプリにする場合に
審査が厳しいAppleを基準にして、
アプリ化が不適切なケースを考える。
アプリ化に向かないケースNot suitable case
実装編
Start making app
App overview アプリ紹介
Native
WebView
Native
WebView
Native /Webview ネイティブの範囲 / Webの 範囲
Native
Webで実現している機能
• メインコンテンツの表示全般
• サーバーへのデータアクセス
Native
WebView
Nativeで実現している機能
• 箱の外側(ナビゲーションバー / タブバー)
• オフライン状態の検知と通知
• デバイス機能の呼び出し
(メーラーの起動、SNSへのポスト)
• Cookieの保存 / 破棄
• UserAgentの追加
• 広告表示(今回は iAd を利用)
Native /Webview ネイティブの範囲 / Webの 範囲
ネイティブから、WordPressページに実装された
JavaScriptファンクションをコールしている部分。
ネイティブ側でメソッドが用意されており、簡単に
実現できる。
Native → Web(JS)
Native /Webview ネイティブの範囲 / Webの 範囲
メニューアイコンをクリックした時の動作。
CSS3のアニメーション機能を利用することで
アプリっぽい動きを演出することも可能。
(タップイベント検知のみJavaScriptを使用)
Webからネイティブをコールしている部分。
タップすると、デバイスのメーラーが起動する。
リンク先にカスタムスキームを指定する方法で実現。
CSS3 Animation
Web → Native
※カスタムURLスキームとは
“mailto:” や “tel:” など一般的にもよく使われる
Native /Webview ネイティブの範囲 / Webの 範囲
Twitter Bootstrap
http://getbootstrap.com/
レスポンシブデザインを簡単に実装できる、CSSフレームワーク。
お世話になったものたち
compass
http://compass-style.org/
SASS利用のほか、表示速度向上のため、画像のCSSスプライト化に利用。
Multi Device Switcher
http://wordpress.org/plugins/multi-device-switcher/
デバイスを判断して表示するテーマを切替えることが出来るプラグイン。
今回、PCサイトとはデザインがまったく異なるため、モバイル用に別テーマを作成。
アプリからのアクセスの判別のために独自のUserAgentを追加し、アプリの場合のみ該
当テーマを表示するよう設定した。
Plugin & more
WebViewベースのアプリの場合、「ネットワークに接続されていないと利用が出
来ない」ことを明確に通知し、オフライン状態を常時検知するようにする。
オフライン時の考慮
実装時に考慮すべき点
Native
PCと違い、通信環境・速度が頻繁に変化するため、画面遷移などサーバーとの通
信が発生する時は、ローダーを表示し「処理している感」を示すようにする。
ローダーの表示 Native
URLのリクエスト時はネイティブ側でオンライン状況を確認するが、Web側で完結
するAjaxやAPIなどの通信処理時は、オフライン時の考慮(タイムアウト等のエラー
ハンドリング)を忘れずに行う。
AjaxやAPIコール時の考慮 Web
Attention
WebViewで表示した画面のキャッシュはなかなか消えない。
ネイティブ側で画面読み込み前にクリアする、元々キャッシュさせないようにする
など考慮が必要。
スタイルシートやJSの変更反映のためには、読み込み時にバージョン情報を付加し
たURLにするなどの対応が必須。
キャッシュ問題 WebNative
ユーザー登録して利用するアプリの場合、そのままではアプリを終了するとログ
イン状態が保持されない。WordPressのログイン状態を保持するためには、ネイテ
ィブ側でCookieの保存を行う。(ログアウト時には破棄することも忘れずに)
【参考】http://tech-gym.com/2011/10/objective-c/506.html
ログイン状態の保持 Native
実装時に考慮すべき点Attention
さくらインターネットの
「国外IPのアクセス制限」について
この設定が有効になっていると、WordPressのロ
グイン処理部分で、国外からのアクセス時に404
エラーが発生します。
初期設定が「有効」となっているため、
WordPressで会員制サイトにしている方は、無効
にしましょう。
※Appleのレビュアーは国外です!!
おまけPostscript

More Related Content

What's hot

API Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberAPI Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberKnoldus Inc.
 
Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022David Gómez García
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins IntroductionPavan Gupta
 
APEX Behind the Scenes by Scott Spendolini
APEX Behind the Scenes by Scott SpendoliniAPEX Behind the Scenes by Scott Spendolini
APEX Behind the Scenes by Scott SpendoliniEnkitec
 
Design patterns in test automation
Design patterns in test automationDesign patterns in test automation
Design patterns in test automationMikalai Alimenkou
 
SW 아키텍처 분석방법
SW 아키텍처 분석방법 SW 아키텍처 분석방법
SW 아키텍처 분석방법 YoungSu Son
 
API Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIsAPI Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIsAaronLieberman5
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsJarrod Overson
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD PipelineJames Wickett
 
Cyclomatic and cognitive complexity
Cyclomatic and cognitive complexityCyclomatic and cognitive complexity
Cyclomatic and cognitive complexityHeemeng Foo
 
Laravelの検索機能の実装方法
Laravelの検索機能の実装方法Laravelの検索機能の実装方法
Laravelの検索機能の実装方法yoshitaro yoyo
 
Test Automation Using Python | Edureka
Test Automation Using Python | EdurekaTest Automation Using Python | Edureka
Test Automation Using Python | EdurekaEdureka!
 
Spring MVC to iOS and the REST
Spring MVC to iOS and the RESTSpring MVC to iOS and the REST
Spring MVC to iOS and the RESTRoy Clarkson
 
How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)Shiu-Fun Poon
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API DesignYos Riady
 
The Hacker's Guide to NoSQL Injection
The Hacker's Guide to NoSQL InjectionThe Hacker's Guide to NoSQL Injection
The Hacker's Guide to NoSQL InjectionPatrycja Wegrzynowicz
 

What's hot (20)

API Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+CucumberAPI Automation Testing Using RestAssured+Cucumber
API Automation Testing Using RestAssured+Cucumber
 
Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022Leverage CompletableFutures to handle async queries. DevNexus 2022
Leverage CompletableFutures to handle async queries. DevNexus 2022
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
 
APEX Behind the Scenes by Scott Spendolini
APEX Behind the Scenes by Scott SpendoliniAPEX Behind the Scenes by Scott Spendolini
APEX Behind the Scenes by Scott Spendolini
 
Design patterns in test automation
Design patterns in test automationDesign patterns in test automation
Design patterns in test automation
 
SW 아키텍처 분석방법
SW 아키텍처 분석방법 SW 아키텍처 분석방법
SW 아키텍처 분석방법
 
API Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIsAPI Security - Everything You Need to Know To Protect Your APIs
API Security - Everything You Need to Know To Protect Your APIs
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 
Api security
Api security Api security
Api security
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD Pipeline
 
Selenium ile Web testi.
Selenium ile Web testi.Selenium ile Web testi.
Selenium ile Web testi.
 
Cyclomatic and cognitive complexity
Cyclomatic and cognitive complexityCyclomatic and cognitive complexity
Cyclomatic and cognitive complexity
 
Oracle api gateway overview
Oracle api gateway overviewOracle api gateway overview
Oracle api gateway overview
 
Laravelの検索機能の実装方法
Laravelの検索機能の実装方法Laravelの検索機能の実装方法
Laravelの検索機能の実装方法
 
Test Automation Using Python | Edureka
Test Automation Using Python | EdurekaTest Automation Using Python | Edureka
Test Automation Using Python | Edureka
 
Spring MVC to iOS and the REST
Spring MVC to iOS and the RESTSpring MVC to iOS and the REST
Spring MVC to iOS and the REST
 
How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)How to create a User Defined Policy with IBM APIc (v10)
How to create a User Defined Policy with IBM APIc (v10)
 
Schema-First API Design
Schema-First API DesignSchema-First API Design
Schema-First API Design
 
The Hacker's Guide to NoSQL Injection
The Hacker's Guide to NoSQL InjectionThe Hacker's Guide to NoSQL Injection
The Hacker's Guide to NoSQL Injection
 

WordPressサイトをiPhoneアプリにしてみた

Editor's Notes

  1. http://matome.naver.jp/odai/2133818932667927201 単純にHTMLアプリとしたのでは実現できない機能があります。例えば画像を編集した上でアップロードする仕組みや、カメラ機能の利用などです。Androidの音声検索APIもそうですが、ネイティブアプリとして実装しないと呼び出せないAPIがあります。
  2. http://matome.naver.jp/odai/2133818932667927201 単純にHTMLアプリとしたのでは実現できない機能があります。例えば画像を編集した上でアップロードする仕組みや、カメラ機能の利用などです。Androidの音声検索APIもそうですが、ネイティブアプリとして実装しないと呼び出せないAPIがあります。
  3. 単純にHTMLアプリとしたのでは実現できない機能があります。例えば画像を編集した上でアップロードする仕組みや、カメラ機能の利用などです。Androidの音声検索APIもそうですが、ネイティブアプリとして実装しないと呼び出せないAPIがあります。
  4. https://developer.apple.com/jp/devcenter/ios/library/documentation/userexperience/conceptual/mobilehig/DesigningForiOS7/DesigningForiOS7.html http://www.sirochro.com/note/app-store-review-guidelines/