OS X Background Fetch Equivalent - macos

I'm familiar with the Background Fetch in UIKit but I was wondering if there is an equivalent for OS X apps.
My application is bundled with a Safari App Extension that needs to update frequently. Auto update does not look like it's supported from what I've read in the forums on the App Extensions since it's bundled to the OS X app. I have a shared data storage between the app and the extension so my ideal solution would be having the app run (in the background wether the user has it open or not) periodically check for the latest version. Then when the user is actually engaging with my extension it will notify the user of the update. This is why a solution like Sparkle is not desired.
I have everything down, but I'm lost on running the background process. Appreciate any help or creative solutions!

Related

In-house OS X app updater - handling of "signature folder"?

I am in the process of adapting our custom (auto-)updater to work with OS X apps. (These OS X apps will be distributed outside of the Mac App Store.)
After the new bundle is downloaded, I am selectively overwriting certain files. However, it is unclear to me whether there is a situation where I should also overwrite the _CodeSignature folder in the "old" app with the newer one.
As (currently) the Gatekeeper checks a downloaded app only the first time it is run, the above becomes a non-issue (again: for the time being).

Create an OS X today widget without a host app

Is it possible to create an OS X Yosemite Today Widget without a host app, like the builtin Weather, Stocks and World Clock apps?
You can not do that simply because your executable is still running in the companion app rather in the extension. It means that codes are actually belonged to the companion app. So, you must have your companion app.
Info from the official documentation:
An app extension is different from an app. Although you must use an
app to contain and deliver your extensions, each extension is a
separate binary that runs independent of the app used to deliver it.

OSX Sandbox: Launch a different executable based on OS version

I have an application in the Mac App Store. I'm trying to support users going back to Snow Leopard but this is becoming increasingly difficult.
Recently I've hit a roadblock due to the iTunesLibrary.framework, this framework must be linked to the main executable and yet doing so will always trigger a crash on load when running in Snow Leopard.
To workaround this problem, I want to compile a version of my app that doesn't use features and frameworks from newer versions of OSX. The problem is, how can I launch the compatibility build automatically?
I'm considering trying to make the main executable point to a shell script, but I don't really like that idea. I've also thought of the main executable being a helper that simply launches the full app and then exits. I expect this would work, but I worry about it getting approved by Apple. Finally, I'm wondering if the app bundle format itself can support this kind of setup, maybe via an advanced used of CFBundleExecutable that I'm unaware of.
Has anyone been down this road, what would you suggest?
Try weak linking the frameworks, more information about Weak Linking and Apple Frameworks here. Then also check in your code for the OS version or - (BOOL)respondsToSelector:(SEL)aSelector of any NSObject to determine what you can call and what not.
To have Snow Leopard as Base SDK you'll need an old Xcode and will have troubles submitting to Mac App Store.

Google Chrome App filesystem events, shell/finder integration

For a new desktop app project I'm researching if it's feasible to create a cross-platform implementation instead of native Windows and OS X apps. Chrome Apps seemed promising, but after browsing through the Chrome APIs there are some things I didn't see that I'll need in my app:
Notifications on changes to files in the local filesystem. (File System Events API on OS X, FileSystemWatcher on Windows.) At first I thought the syncFileSystem API might help with this, but it's apparently only for syncing with Google Drive, which is not what I need. I guess I could workaround this by scanning the directories I'm watching on a timer, but that won't perform well if there are a lot of directories and/or files.
Ability to add context menus in Windows shell and OS X Finder, as I would be able to with a Windows shell extension or OS X Finder plugin.
Ideally (although probably not a hard requirement) get the app into the Windows System Tray / OS X Menu Bar (NSStatusItem).
Can anyone confirm whether it's possible to access this functionality with a Chrome App? If not, can you recommend an alternative cross-platform tool for building an app with these features?
All of the listed features have bugs logged, but no real progress at the moment:
Watch: https://code.google.com/p/chromium/issues/detail?id=148873
File manager integration: https://code.google.com/p/chromium/issues/detail?id=130455
Sys tray: https://code.google.com/p/chromium/issues/detail?id=142450
The first of these to be made available will probably be file manager integration, which is being worked on now.
We'd love to improve watching but it is a significant task to support this on all operating systems and we don't have anyone working on it now.
Sys tray support is something we have no plans to release soon as we're not sure how we want to support this on ChromeOS.
I could not find anything close to the items you have mentioned. I did however find this product: node-webkit that likely would get you onto both your target platforms, use the same basic code-base (HTML5/CSS/JS) and allow some possible per-OS customization. There is even a 'watch' project under NPM that covers your first bullet point. Check node-webkit/wiki for notes on how to add C/C++ extensions to their node build (under using-node-modules.) Project seems active and appears to be backed by Intel (they re-built their XDK product on it to do cross platform.)

Capturing system information in AIR apps

could you tell me plz - is it possible (and how if yes) to capture following information in AIR application:
Operation System
Laptop model and vendor (if laptop)
Installed applications with versions
thanks a lot!!
With the current version of AIR, AFAIK only the first part is possible. Version 2 is in beta and should let you get much more info from the underlying system.
Operation System:
It's possible to detect the operation system using flex 3, you need to use Actionscript flash.system.Capabilities (see here for the flex reference).
Laptop model and vendor
Installed applications and versions
I don't think that is possible using just AIR.
A way around this is to call a third-party app first that does the work for you (and which is run first and then calls your AIR app). The app will need to write the necessary information to an XML file / sqlite db somewhere where your AIR app can read and process it.

Resources