我正在开发一个Cocoa应用程序,它使用自定义方案的URL启动/激活,该方案在Info.plist文件中注册,如下所示:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Open myscheme:// URLs</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myscheme</string>
</array>
</dict>
</array>
Run Code Online (Sandbox Code Playgroud)
我的问题是,一旦应用程序启动或激活,我该如何判断启动应用程序的URL是什么?在iOS上,使用-application:openURL:sourceApplication:annotation:UIApplicationDelegate上的方法很容易,因为它传递了NSURL实例.
我希望能够通过myscheme:// do/something/awesome等URL将数据传入我的应用程序