Launch my Mac app in case other Mac app was launched - objective-c

I need to write Mac app which will start automatically only in case when another particular app was launched. Could you please provide entry point where to look and what to use. Do I need to have special autostart up process? I am new to Mac app development.

You can add observer using CFNotificationCenterGetDistributedCenter() for example.
Please, take a look at this article, here may be the solution Inter-process communication

Related

Restart android service after reboot device or removed from the recent apps tray

Please, I'm using Android services in my app to launch local notifications, exactly as described here, on Appcelerator Wiki. The services run well as expected but if the application is removed from the recent apps tray or device was rebooted, services stop.
I would like to the service still running after the app is removed from the recent apps tray or restart service after reboot device. How can I do it using classic Titanium.
In iOS version of my app I'm using Ti.App.iOS.scheduleLocalNotification and run very well, even after switching the device off and on. I wish that on Android worked the same way.
Thank You for any help.
(sorry for my bad english)
You can try benCoding.Android.Tools module. check the BootReceiver
you can find an example here if you are using a service for notification you need to install the module and add the receiver to your tiapp.xml as in the example

Monitor User App Usage From Mac OS X App

I am interested in building a Mac OS X application that requires knowing what applications the user has open and when a new one opens, all when my app is running. It doesn't have to be approved by the Mac App Store (If this violates their use terms). An example of an app that does this is the Rescue Time app.
Thank you for any answers,
Michael Truell
Don't know if you're still trying to needs this, but I did some more research on how to solve this and here is what you could look into:
To get notified when applications are opened by a user, use NSWorkspace's notification center, and add an observer for keys like NSWorkspaceDidActivateApplicationNotification. See the documentation NSWorkspace. You can also use NSWorkspace to get all running applications.
If you need to access information about a running application, you should check out Scripting Bridge, and if you don't care about App Store or sandboxing, check you accessibility api, AX

How to detect a docked device in cocoa

I've been searching all over the web and have found solutions to mounted device detection from within a Cocoa App using the NSWorkspace notification system. However this notification doesn't seem to be triggered when an Apple device is docked.
I specifically want my OSX App to detect docked iPads/iPhones, be able asses whether the iOS version of my App is installed and then synchronise files. I realise that the easiest way to do this is using iCloud, but I do not as yet have a developer membership with Apple and would like the option to be able to synchronise files without the internet.
An iTunes like system would be ideal. Any ideas.
Thanks in advance.
Apple don't provide any official APIs for doing what you ask.
Unofficially, you can try the stuff here: https://bitbucket.org/tristero/ipodaccessframework
You can definitely use it to determine whether a particular app is installed (by looking for a match for its bundle-id) and you can read/write files to/fro a particular apps document directory.
Disclaimer: this one is mine. There are definitely other libraries around that achieve similar results.

Does Titanium have method for "didReceiveRemoteNotification" of Objective-C?

I would like to receive remote push notification when the app is on the foreground. I think I can use "didReceiveRemoteNotification" in Objective-C, but how about in Titanium? I've been searching solutions but can't find anything. Does anybody help me out?
Titanium currently only supports local notifications (by default) I believe. You might want to take a look at AppCelerator as a solution.
Sorry, i was wrong last time. It's very hard to find but Titanium supports a way of interacting with PushNotifications.
Please take a look at Ti.Network.registerForPushNotifications. It provides a callback that is executed when you receive a Push Notification.
The other posted solutions below may provide a better integration for titanium so it's up to you what you want to use. But this should answer your original question.
Unfortunately Titanium only supports local notifications on iOS. If
you want to support remote notifications you can use
Urban Airship
ACS (Appcelerator Cloud Services) or
you write your own module that provides "didReceiveRemoteNotifcation" as an app event to your app
As far as i know you can only listen on local notifications by
default but you can try this method if it reacts on remote
notifications..

How to implement a check for update on Mac OS X

I'm trying to create an internal app for my company. I want to provide some kind of "automatic update" feature that give the user a message (with install option) once a new version is available. I know that for windows there is a technology named ClickOnce. Is there some kind of standard implementation for mac os x? Should I write it from scratch? If so, how can I start the install process directly from my application? Should I provide a mpkg?
Sparkle is probably what you want. It's used in many apps and is probably the "norm" of actual automatic update nowadays in mac apps other than the app store itself.