Does anyone know what "objc: //" means in url

Does anyone know what this means: objc:// In this line of javascript example code: var invokeString = "objc://planner/openPDF?" + encodeURIComponent(fileName); var invokeString = "objc://planner/openPDF?" + encodeURIComponent(fileName);

+4
source share
2 answers

In this case, objc:// is a user scheme, like http. In addition, it can be used to open an application registered for this protocol on Mac / iOS (I'm not sure if this is supported on Windows or not).

Let's say my ios-app "Planner" is registered to handle objc: // then, when accessing this URL in a browser, the application will open the "Planner" application on my iPhone and transfer the URL to the application in the same way http: // www.google.com opens you the Safari app (or your standard browser) and transfers google.com.

Another example is Apple using itmss:// for links to the iTunes Music Store. By clicking on one of the links, you will open the Music Store in iTines.

Here is an article on registering schemes on iOS . And the wiki about URI schemes

UPDATE

As Sheikh Heyer commented, it can also be used as a way of communication between UIWebView (launching an HTML / JS page) in an objective-c application (iOS / Mac) and a native application.

+3
source

I searched for it and found Objective-C Calling Methods from JavaScript , it says that you can call Objective-C methods by calling URLs with a custom protocol like

 document.location="mycustomprotocolname:functionName?param1=value1&param2=value2..." 

So objc:// looks like a custom protocol for invoking the Objective-C method here.

+3
source

All Articles