martinfinke / xcall

Call X-Callback-URLs From the macOS Command Line
MIT License
78 stars 14 forks source link

What does 'xcall066958CA://x-callback-url/handle-success' mean? #3

Closed flyingpot closed 5 years ago

flyingpot commented 5 years ago

Hi, your code does help me. But I have a problem with this line. https://github.com/martinfinke/xcall/blob/0d61fea9c509de18be22720ded0d30c9b7ce965f/xcall/AppDelegate.m#L107 It seems that we can get the x-success result from the url? But I don't know why.

martinfinke commented 5 years ago

Hi, thanks for you interest in the script!

It works because the script handles URL events for that URL. The "xcall066958CA://x-callback-url/handle-success" tells the called app to call this URL, and xcall handles that URL (because it's registered in the Info.plist).

The 066958CA is just a random string to make the URL host "more unique" than just naming it "xcall". Of course, nothing prevents another app from registering the same URL, and I think it's undefined which one will get the call in that case.

If the question is how to get the result: The script prints it to stdout.

I hope that helps.