呼び出される方の話ね。
AppDelegateクラスへ
func application(
app: UIApplication,
openURL url: NSURL,
options: [String : AnyObject]) -> Bool {} を追加する
AppDelegate.swift へ以下を追記
class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var isUsedSocket = true /// このメソッドを追加 func application( app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool { print( "openURL:" + url.description) print( options ) return true } func application( application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]? ) -> Bool { // ... } }
結果は以下
openURL:myapp//?param1=1¶m2=2
["UIApplicationOpenURLOptionsOpenInPlaceKey": 0,
"UIApplicationOpenURLOptionsSourceApplicationKey": jp.co.test.Sample]
["UIApplicationOpenURLOptionsOpenInPlaceKey": 0,
"UIApplicationOpenURLOptionsSourceApplicationKey": jp.co.test.Sample]
ここからゴニュゴにょすればいろいろ出来そう