Closed karimbutt closed 2 years ago
The main app window is hidden/closed by default. In the app delegate you probably need to call showWindow(). initialUrl will probably not work since that is thought for mobile apps where the app might be silently killed in the background, whereas for macOS sol will not work if it is not actually running.
@ospfranco thanks! Where would you call showWindow()? You have that in the appDelegate at the end of the applicationDidFinishLaunching . Can't seem to get any URL data to feed into the app or to even trigger making it visible.
Makes sense re: initialURL use case being very different.
I don't quite understand what you want, you should call showWindow wherever you are handling the notification. This is what the official documentation says for iOS:
I haven't built anything for the JS side to handle URLs yet. You seem to be going for the RN APIs, so calling showWindow is the first step to get the app to be visible, and then setting a listener with some of the RN APIs seems the way to go. The official documentation sets up this listener:
In any case, if you really want oauth then you are building this yourself from scratch
Thanks @ospfranco ! Managed to resolve the issue so closing this. The initial code did work; it's just I had two versions of the app running with same URL scheme. I'll look into a way to get it working in the task bar to see the instances of the app running next :) Thanks again for your help!
You just need to remove the applicationIsUIAgent in the info.plist
Hey @ospfranco - thank you SO much for your work on Sol. What an incredible application - finally able to tweak and customize the command palette like I could not do with other apps like Alfred.
I have a question for you - I'm looking to extend Sol a bit by adding authentication (right now using Auth0). Auth requires essentially the ability to send the user out of the Sol application and then back in with an access_token (i.e., similar to most MacOS apps).
For example, when I go into Safari and type in
raycast://
it will open the command palette, indicating that it is responsive to any routing INTO the app that is happening.With Sol, I've done the following:
sol://
in the info tab for the appHowever, I'm not able to hit any of my logging points here when I try hitting sol:// in Safari. The URL is recognized (i.e., it sees that there is an app that has that scheme registered); however, none of my logging points are hit AND Sol does not reopen in the same way that Raycast does. My gut is telling me that it is likely because the application is hidden/in the background that none of these triggers are hit and that I need to do something like Raycast where it launches when called.
Essentially, the end goal is to be able to catch the details of the URL as a "deep link" because it will contain information to log users in via services like Auth0 or others where you have to route the user out to web auth. Do you know what I'm doing wrong here?
Super appreciative in advance.