How to allow permission for user's Home folder in cocoa application for mac - objective-c

I am having a mac app in which I am deleting some data from user's Home directory.
My app is rejected saying the below reason.
The app only finds files in the ~/Downloads folder. It would be appropriate to have the user grant access to the Home folder.
So I used NSOpenPanel for asking the access from the user but I have no idea about how to give access to user's hidden folders.
EDIT
I have successfully enabled sandboxing for my app but now on allow button, what should I do?
Please guide me on this...
Any help will be highly appreciated.
Thanks in advance...

I spent some time researching this and I can say that if you want an easy solution for being able to access files outside your app's sandbox, it's just not going to be possible.
And even if you were willing to work on a tougher, more technical solution, it is still likely to not be possible.
You should look at this section in the Apple's App Sandbox Design Guide entitled "Accessing User Data", specifically this bit:
If your app requires access to the user’s home directory in order to
function, let Apple know about your needs using the Apple bug
reporting system. In addition, be sure to follow the guidance
regarding entitlements provided on the iTunes Connect website.
The next paragraph says the same thing about other app's preferences. Since you're trying to manipulate -- or delete -- other app's files, you're going to have to ask Apple for permission and/or guidance to do this.
If this were my problem, the only workaround I might possibly attempt would be to come up with might involve Security-Scoped Bookmarks and Persistent Resource Access, but as you can see from the linked documentation, it's not trivial to setup.
Summed up: if you want your app to remain sandboxed, you may need to rethink what you are trying to accomplish.
More information can be found in this related question.

Related

Syncing Route 53 static website to github website repository (allowing offline/destop editing)

I have had a github.io website for quite some time, and want to move it over to it's own domain name. Currently, I have transferred all the files to the right S3 bucket and I can access the website all the same as I can my Github. However, I want to be able to edit individual files in a desktop app (such as SubEthaEdit or Brackets), like you can in Github, which to my knowledge you cant.
I would like to be able to migrate the Github website over to the domain name, so that when I edit, save, and push a commit from the Github desktop using SubEthaEdit, it would be automatically updated on the domain website (ideally). Either this, or they share a library that is still accessible from the Github desktop app. I really just hate editing files using S3's editor, or having to download and re-upload any document I am working on.
Im quite new to any sort of coding or programming languages other than a little bit of javascript, apologies if the language I used is, shall I say, sub-par.
Got It!
#ceejayoz helped to point me in the right direction.
after some fiddling, I got a CNAME record that points towards my github website, while maintaining https.

How to program a sandboxed application in Yosemite

I was trying to program a simple TODO app for Yosemite with sandboxing. Apple has its tutorials for the same but they are not very elaborate. I wanted to know sandbox APIs like sandbox_init() and APIs for console logs (heard sandboxed apps use some special APIs). Could someone please point me to some open source app with sandboxing on Yosemite, so that I could see the APIs that it is using.
You don't need to use sandbox_init() etc. in order to create a sandboxed app.
Roughly, you need to understand:
Use the APIs to find well known directories and don't assume that /Users/username/Documents is the Documents folder, for example.
The app has no access to user files and must gain access via NSOpenPanel.
If the app wants to retain access it has already gained then it needs to create and store bookmark URLs, which can be reloaded during a later invocation.
If the sandboxed app spawns a child process, then that child process needs it's own set of entitlements.
Once you understand that it's normally just a case of setting Use Sandbox in the app capabilities and you're off.

Apps that do not perform as advertised by the developer will be rejected when sandbox mode

My app is rejected by
2.3 Apps that do not perform as advertised by the developer will be rejected
It said that the file copied into "~/Library/Fonts" failed.
It works when test by myself, I find that it will get permission fail when using the sandbox mode, did Apple reviewer will accept this feedback?
thanks
Apps must work in the sandbox no exceptions allowed.
A sandboxed application cannot write to ~/Library/Fonts.
Either store the font in the app bundle and use it from there, or put up a standard file dialog asking the user to grant permission to write to ~/Library/Fonts by selecting it.
If you get stuck doing either of those ask a specific question on them showing what you've tried. Such a question is unlikely to be seen as off topic.
HTH

How to transfer disabled app

lately my facebook account got disabled as a 'bad app developer' without any warning. The thing is all of the apps, where I was listed as an admin got disabled, even though they didn't have any negative feedback. Some applications, where my collegues were listed as admins can be restored from their accounts (and they got enabled as they are working correctly). But there is one, where only I was listed as admin, and I can't find a way to send an appeal. There is a notice about a transfer process in the mail I received saying
For more information on recovering or transferring these applications, please visit our FAQ page: http://www.facebook.com/help?faq=17556
But the FAQ page says it can't be found.
Please can somebody point to a tutorial or step-by-step guide how to transfer the app to another account, so I can get enabled again.
Thanks many times.
As far as I am aware there is no way to recover/transfer the app to another account. All you can really do is set up a new app and point it to the same web address. That being said your account was disabled for a reason, so I would read up on the terms and conditions to find out exactly what you did wrong.

Prevent 'the world' from accessing members PDFs in an Umbraco CMS

I am new to Umbraco and have inherited an existing site 3-4 years old. One of our users has just come to me and asked why her members only PDFs are freely available if Googled by name, but their containing folder in Umbraco is not - ie she has to log in to get to the folder.
Within the Umbraco Admin system I can see how to set permissions for the pages but not for individual files
Can I set permissions within Umbraco so that this cannot happen, or is it basic file permissions on the server of some sort?
I have posted this on the Umbraco forum but so far had no replies!
Hopefully somebody has an answer
Best regards
Dave
this is the exact reason why I submited an issue tracker.
Umbraco as far as 4.5.1 goes has no File Permission controls. The files are stored in the Media Folder, and therefore are always publicly available.
I have created a HTTPModule that allows you to control the permission on those media files. Please take a look here. Click here.
Only problem with this method is:
1) Only work on IIS7
2) The application pool has to run on Integrated Mode.
Please note that is not the full implementation. If you need help to get it working, feel free to ask me for more help here.