Create OS X Today Extension without containing app - macos

On the Apple Developer website it states:
To deliver an OS X app extension, it’s recommended that you submit
your containing app to the App Store, but it’s not required.
However, to make a Today Extension from what I understand: I must create a Cocoa OS X application then add a "Today Extension" as a target. However, I do not want/need this main containing app. All I need is the extension.
So, how do I create an extension without a containing app? Even though technically I need to develop the containing app to create an extension target.

I think you are misreading this: what they are saying is that an OS X app extension may be distributed OUTSIDE the app store - if you continue reading, you will see the following:
If you distribute an OS X app extension outside of the Mac App Store, Gatekeeper prevents the extension from running until the user opens and approves the containing app. Further, if you code sign with a certificate other than your Developer ID, users must explicitly override Gatekeeper to open the containing app to make your extension available.
All extensions, at this writing, must be part of a container app and Apple devotes a large number of pages describing how, why, etc. My understanding (and work on extensions) is that all extensions must be part of a containing application. If there is a way to do so without the container app, Apple has not indicated it.

Related

can we use Applescript in mac development

current I am using some applescripts to the commands in mac machine.is apple allow applescripts in reviewing process or I have to look on alternatives but applescripts is working fine as for my requiremnts
Yes. Apple allows AppleScript in the Mac OS app development. You just need to add sandboxing in side your project and list all the app for you are using in AppleScript inside your apps entitlements file.
If you not added any entitlements then it will not allowed by apple. Try your app in sandboxing mode and you can see AppleScript not working because of no entitlements added for app.
Note : Some of the app not allowed to access using AppleScript. You app will be rejected by apple review team
To use AppleScript:
ON App sandbox in project.
Add all entitlements required for AppleScript access.
(Only If you wish to deploy through Mac App Store)
Few things before starting your work I suggests that you should go through this links in order to be sure that after your hard work you get want to want.
Determine Whether Your App Is Suitable for Sandboxing
Enabling App Sandbox
App Sandbox Temporary Exception Entitlements
Apple script doesn't work in Sandbox (As far as I know)
Your app should have a temporary exception (Doc mentions it)
Determine Whether Your App Is Suitable for Sandboxing
Sending Apple events to arbitrary apps With App Sandbox, you can
receive Apple events and respond to Apple events, but you cannot send
Apple events to arbitrary apps.
However, for applications that specifically provide scripting access
groups, you can send appropriate Apple events to those apps if your
app includes a scripting targets entitlement.
For other applications, by using a temporary exception entitlement,
you can enable the sending of Apple events to a list of specific apps
that you specify, as described in Entitlement Key Reference.
Finally, your app can use the subclasses of NSUserScriptTask class to
run user-provided AppleScript scripts out of a special directory,
NSApplicationScriptsDirectory (~/Library/Application
Scripts/code-signing-identifier/). Although your app can read files
within this directory, it cannot write files into this directory; the
user must manually place scripts here. For details, see the
documentation for NSUserScriptTask and WWDC 2012: Secure Automation
Techniques in OS X.
A complimentary
A Strategy for UI Scripting in AppleScript
Scripting from a Sandbox

OSX Today Extension without containing app

I'm not understanding if a containing app is needed alongside a Today Extension for OSX. I have a very simple and straightforward widget, it does not need nor rely on a main or containing app. With that said, how can I create an Today Extension without a containing app.
What I have so far is that I have a blank app with a today extension.
You cannot create a today extension without having an app. They don't work that way. All iOS app extensions are just that-- extensions to an app. There must be an app, and it must do something to be accepted into the app store (Apple rejects apps for "minimal functionality"). Extensions cannot exist on iOS outside of an app bundle, until or unless Apple decides to change things in the future.
A container app is not needed. Read up the Apple documentation on it. It says:
To deliver an OS X app extension, it’s recommended that you submit your containing app to the App Store, but it’s not required.

Timeline for mac sandbox entitlements and related features

I understand that sandbox was introduced in Mac OS X Lion (10.7) but temporary exception entitlements, specifically com.apple.security.temporary-exception.files.home-relative-path.read-write, were introduced in a later 10.7.x update (which one?)
Similarly security scoped bookmarks were introduced in 10.7.3.
My Mac app (not currently sandboxed) is a document based app that creates documents that have references to pictures on users' mac. Once a user uses some pictures in his document we simply save the path (for eg. /Users/myname/Desktop/pic.jpg) of used picture in that document. When a user quits the app and reopens the saved document, our app can simply get access to the picture using the path from the document. Since our app is not sandboxed this works on all versions 10.6.x, 10.7.x, and 10.8.x
We would now like to sandbox our app and ensure that it continues to work on all versions (10.6.x, 10.7.x, and 10.8.x) of Mac OS X. To achieve this, we will
Ask for a temporary exception entitlement, specifically com.apple.security.temporary-exception.files.absolute-path.read-write and this will enable random file access for 10.7.3 onwards. But what do we do for 10.7, 10.7.1, and 10.7.2?
Beyond 10.7.3 we will start using security scoped bookmarks.

Mac OS Sandbox: Launching main application from helper

I have create in sandbox, an app which use a helper to start at login, as presented here.
It works ok, but the next messages are logged in the console:
lsboxd[1560]: Not allowing process 15208 to launch "/Applications/SandboxApp.app/Contents/Library/LoginItems/SandboxHelper.app" because it has not been launched previously by the user
lsboxd[1560]: Not allowing process 15208 to register app "/Applications/SandboxApp.app/Contents/Library/LoginItems/SandboxHelper.app" for launch.
I see that this messages are about the helper, but I don't know what to do, to prevent them.
My only concern is that Apple may reject the app because of this messages.
Is someone who prevent the raise of those sandbox messages, or is someone who sent an app, which raise sandbox messages, to Apple and was accepted on Appstore?
See http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/ - according to this it is a code-signing issue that probably won't be an issue with the AppStore build as the AppStore build gets resigned.
This should work in the final build. According to Apple Documentation (Section “Launching Helpers with Launch Services”):
Launching Helpers with Launch Services
A sandboxed app is allowed to
launch a helper using Launch Services if at least one of these
conditions has been met:
Both the app and helper pass the Gatekeeper assessment. By default
that means both are signed by the Mac App Store or with a Developer
ID. Note: This does not include your development ("Mac Developer") or
distribution ("3rd Party Mac Developer Application") signing
identities.
The app is installed in /Applications and the app bundle
and all contents are owned by root.
The helper has been (manually) run
at least once by the user.
The first and/or second one should cover your case when your app was installed through the Mac App Store.

How to deploy a FireMonkey Application for Mac OSX?

I can run a FireMonkey Application on Mac OSX with PAServer. But now, I would like to deploy the application Mac OS (something like MSI under Windows). How can I do this?
You'll want to read more about Application Bundles.
Using the application bundle that Delphi creates and deploys via PAServer
Since you're using the PAServer, you'll find that it has already created an application bundle for you. After you run the program via the PAServer, look in the following folder on the Mac for the application bundle:
/Users/[username]/Applications/Embarcadero/PAServer/scratch-dir/[profilename]
If your project is named Project1, you'll see an application bundle in that folder named Project1.
If you read the above wiki article, you'll know that Project1 has a "hidden" extension of .app, and the whole thing is really a folder with all of the required files to run the application.
Go ahead and run this application bundle directly on the Mac. If it complains about missing dylibs, such as libmidas.dylib, simply copy them from the PAServer folder into the application bundle's MacOS folder.
To the Mac OS user, the application bundle appears as a single program file, complete with an icon. The user can double-click the application bundle to run the application, drag it to their dock, etc.
Changing the icon
The application bundle will have the Delphi icon by default, but you can replace it with your own icon. On the Mac, simply right-click on the application bundle in Finder, and select Show Package Contents. In there, look in the Contents/Resources folder for the .icns file.
Use the Icon Composer application that was installed with XCode to create your .icns icon file from existing image files.
Peeking inside the bundle
Peek around inside at the rest of the contents. You'll see the required dylib, your program file, and the Info.plist file, which is a text file with things like application IDs, signatures, and other important things.
More about deployment
If your application can be self contained in an app bundle, the standard method is to put the application bundle inside a disk image .dmg file, which allows the user to drop the application into the applications folder.
If your application requires the installation of additional files, libraries, databases, or frameworks, etc., you should create a package. You can utilize PackageMaker to do this. A package is similar to the "msi" installer on Windows that you mention.
When the user double-clicks the package, it's run by Installer. It has a wizard style interface and walks the user through installing the application. You can also sign the package with your code signing certificate.
If you want to include your application bundle in the app store, you'll need to sign it. You'll also need to sandbox it.
Sandboxing and the Mac App Store - Nov 2, 2011
The vast majority of Mac users have been free from malware and we're
working on technologies to help keep it that way. As of March 1, 2012
all apps submitted to the Mac App Store must implement sandboxing.
Sandboxing your app is a great way to protect systems and users by
limiting the resources apps can access and making it more difficult
for malicious software to compromise users' systems. Learn more by
visiting the App Sandbox page.
You must create an Application Bundle in order to deploy you app on a OSX System .
Check these links for more information
Deploying Your Application (Mac OS X installers )
Application Bundle
Building Fancy DMG Images on Mac OS X

Resources