How to handle with a default URL scheme

前端 未结 5 448
花落未央
花落未央 2020-11-27 13:23

I want to build URI (or URL scheme) support in my app.

I do a LSSetDefaultHandlerForURLScheme() in my + (void)initialize and I setted the s

5条回答
  •  醉酒成梦
    2020-11-27 14:28

    You can define the “get URL” command in a scripting terminology SDEF and implement the corresponding method. For example, Terminal’s SDEF contains the following command definition for handling URLs

    
    

    and declares that the application responds to it:

    
        
        
            
        
    
    

    The TTApplication class (a subclass of NSApplication) defines the method:

    - (void)handleGetURLScriptCommand:(NSScriptCommand *)command { … }
    

提交回复
热议问题