handoff from safari
Post on 29-Nov-2014
506 Views
Preview:
DESCRIPTION
TRANSCRIPT
Fly to iOS
UIKit
Yuichi YoshidaChief engineer, DENSO IT Laboratory, Inc.
#yidev20140927
@sonson_twit
© 2014 Yuichi Yoshida, all rights reserved. Redistribution or public display not permitted without written permission from Yuichi Yoshida.
Handoff from Safari
自己紹介2tchの中の人
• iOS好きです • 2tch(2ちゃんねるビューア) • iOS SDK Hacksなど
• 研究 • コンピュータビジョン • 機械学習
• 研究・開発 • 画像検索サービス • 車向けのサービスやハードウェア
自己紹介2tchの中の人
• 6年・・・・ • 41,200行 • 463ファイル • 3472コミット
What is Handoff?継続って訳すのやめて欲しい
DemoSafariで試す
Handoffの種類
• Safariを呼ぶ • URLを渡すだけ
• ネイティブアプリケーション • 受信側にコードが必要 • インストールされていれば自動起動する
• Safariからネイティブアプリケーションを呼ぶ • 署名した対応アプリ一覧JSONが必要
準備• 対応ハードウェアを買う
• MacBook Air (Mid 2011以降) • MacBook Pro (Mid 2012以降) • Retina MacBook Pro (全機種) • iMac (Late 2012以降) • Mac Mini (Mid 2011以降) • Mac Pro (Late 2013以降)
• http://www.ipadmod.netより • iOS
• iPhone 5以降、iPad(第4世代)、iPad Air、iPad mini、iPad
mini Retinaディスプレイモデル、iPod touch(第5世代)
準備
• iCloudに登録する • Bluetoothをオンにする • Wi-Fiをオンにする
準備
• iCloudに登録する • Bluetoothをオンにする • Wi-Fiをオンにする
SafariからのHandoff
• ブラウザからHandoff経由でアプリを起動する • Webページ閲覧中にiOSデバイスのアプリを起動
手順いろいろ
• iOS側のentitlementにサーバのドメインを追加 • JSONを作る • JSONに署名する
• iOSの持つリストに入ってる認証局の証明書が必要 • 実はApple自身が認証局になってる • なのでAppleの開発者の署名でおk
• httpsで通信できるサーバにJSONを置く • ファイル名 apple-app-site-association • ルートに置く必要がある
Associated Domainsの設定
• Xcode • Associated Domains
さらに手順サーバサイドと署名
• キーチェーンから"iPhone Distribution: <Your name>
(XXXXXXXXXX)" を dist.p12 として書き出す. • 秘密鍵,証明書を作成 • echo '{"activitycontinuation":{"apps":
["XXXXXXXXXX.com.example.myApp"]}}' > json.txt • 秘密鍵と証明書で署名 • ファイル名をapple-app-site-associationにする • ドメインのルートにコピーする
認証局
https
署名
同じ証明書じゃなくておk
JSON ファイル
サーバ:example.com
associated domains example.com
DemoHandoff from Safari
まとめYou get to try it.
• Handoffについて • 使えるデバイスは限定される • SafariからiOSのアプリケーションを起動するHandoff
More Information
Yuichi Yoshidahttp://github.com/sonsongithub/@sonson_twit
sonson.jphttp://sonson.jp
Apple Handoff プログラミングガイドhttps://developer.apple.com/jp/devcenter/ios/library/ documentation/HandoffProgrammingGuide.pdf
Getting started with Handoffhttp://www.slideshare.net/yoshidayuichi1/yidevSlideShare - yoshidayuichi1
top related