Adding a Sandboxed app to Login Items - objective-c

I have read through many questions here about launching my app on login. I have followed this awesome tutorial suggested many times. That tutorial does work. BUT...
The one side affect that comes from using a helper app and registering it using SMLoginItemSetEnabled is that my app does not show up inside the user's Login Items in System Preferences.
There are several apps in the App Store (such as PopClip and Dash) that do what I am trying to do. I just can't figure out how...
UPDATE: I found out from the Dash developer that Dash is actually not sandboxed. He also believes that PopClip is not either. This could explain things... https://alpha.app.net/kapeli/post/3975968
UPDATE #2: I just got confirmation from the PopClip dev that it indeed is not sandboxed as well. https://twitter.com/pilotmoon/status/313746294361427968
With the last 2 updates, I guess the answer is clear. As of today, there is no way to accomplish this with Sandboxed apps.

Hope it's not too late.
In Apple's "Daemons and Services Programming Guide":
Adding Login Items
There are two ways to add a login item: using the Service Management framework, and using a shared file list.
Login items installed using the Service Management framework are not visible in System Preferences and can only be removed by the application that installed them.
Login items installed using a shared file list are visible in System Preferences; users have direct control over them. If you use this API, your login item can be disabled by the user, so any other application that communicates with it it should have reasonable fallback behavior in case the login item is disabled.

In sandboxed environment, only Helper applications can be installed in login items. You need to create one, stored in the Contents/Library/LoginItems folder of the main application.
Then you can used SMLoginItemSetEnabled to set the helper as login item and ask the login item to start the main application.

Related

Authentication with Vue/Electron Application

I'm building an application with Vue and Electron, and I'm wondering what the best approach is for authenticating users.
I'm using JSStore as a wrapper for IndexedDB as my database. I'm familiar with using bcryptjs as a means for authenticating users when I create Node backend and have traditional /login or /signup routes.
But this is where I'm starting to get confused. Do I need to set up a Node server to start up when my application starts up? Because given that I'm using IndexedDB, I don't know that it makes sense to have a process of Sign Up --> Request to Node Server --> Send data back to browser
Would I be better served using a different type of database? Could I do something such as adding bcryptjs to the Vue prototype, so that's it's accessible where I need it to work with JS Store? Are there security concerns that I should be aware of with an approach like that?
At this point I'm stuck, and have more questions than answers. I've done some looking around for articles, and I find a lot of content about setting up authentication with Vue, but not within the context of an Electron application. I'm not sure how that variable changes things.
Any advice or direction would be greatly appreciated.
JsStore is client side technology, which means if you are setting up authentication in client side, it will be available only to that device.
Let's understand it more by use case -
Say your application named My Awesome app has authenticaion implemented. User register it and then they are able to use it after registration. They are logging out and signing in again with registration data and everything is working normal.
Here is what wrong with this approach -
User buys another pc and installed application My Awesome app, he tries to login but unable to login because registration data does not exist on their new PC.
Due to some issue, user hard disk crashed & he installed new hard disk. Same thing as above he is not able to log in.
So it is recommended to implement the signin on some server & keep data there.

Is there a way to uninstall BigCommerce app for app owner?

I'm setting up two BC applications and here's a scenario when I need to remove one of them from users store. Is there a way for app owner to initiate uninstall process?
In docs I saw only user-initiated uninstall
There isn't really a method for an app to be "force uninstalled" from the app creator's end apart from invalidating the token by essentially deleting the app. We can definitely take that as a feature request, though. If you're able to share any additional details about your scenario for needing to uninstall an app from your end, that would be helpful context for our team.

How do I password protect a page using UWP Windows Authetication

I am developing a UWP application which has a settings page for configuring account information need to run the application. Since the page has sensitive information and the app is a public Kiosk, I need prevent non-administrator principals from accessing the page.
What API(s) are available for UWP to authenticate a user as an administrator? I do not need to store the information.
Have you checked out the guidance for creating a kiosk app?
If the kiosk app is meant to run both above lock in assigned access and also in the unlocked Windows context, you may want to create a different page to render above lock, and another page for under the lock. This will allow you to avoid showing sensitive information in kiosk mode, since kiosk mode usually means anonymous access. Here are the steps you'd follow to use two different pages, one for under the lock and one for above the lock:
Inside the override of the OnLaunched function in App.xaml.cs, try to obtain an instance of the LockApplicationHost class before rootFrame navigation.
If the call fails, the kiosk app should launch normally, under the lock.
If the call succeeds, the kiosk app should launch above the lock running in assigned access mode. You may want this version of the kiosk app to have a different main page to hide sensitive information.
There are further details and sample code if you follow the link as well as other tips and best practices for kiosk apps.

How Can I Launch The App-store App Directly from my Application

I want to place a button or a link in my app with which the user can start the app-store and buy my app if the app is in trial mode.
I can not find any relavant Information on this. How can I implement this?
MSDN documentation: Creating links with the Windows Store protocol. Alternatively, the URI for the app in the store can be accessed using the Windows.ApplicationModel.Store.CurrentApp.LinkUri property.
You can then open a link to your app in the store using Windows.System.Launcher.LaunchUriAsync.

On a Mac how to determine a user logout is occuring

I am very new to the Mac platform and Objective-C in general and in my application I would like to know how to determine that a user is logging out and perform some actions prior to this. Any info or pointers for this?
The official way to put the hook at logging in / logging out is described in these Apple documents Customizing Login and Logout and Tech Note 2228. But I'm afraid that the log-out hook was no longer directly supported.
So, the second best way is to run a headless Cocoa app, and receive a notification from the system using NSWorkspace, see the document and the list of available notifications.
To make a headless Cocoa app, you need to set an entry in its Info.plist called LSUIElement, see here. By setting LSUIElement to be yes, the app don't appear in the dock, but perform various operation in the background.
Take a look at Receiving Workspace Notifications in this Workspace Services document.
NSWorkspaceWillPowerOffNotification
Posted when the user has requested a
logout or that the machine be powered
off.