Is the clipboard officially called "pasteboard" on iOS? - iphone

I am writing an iOS app and I just want to make sure I call it the appropriate thing. I'm used to clipboard but apparently Apple calls it a pasteboard on iOS. Googling doesn't turn anything specific up.
I see the class is called UIPasteboard but I'm just looking to verify the literature/end user communication uses this term as well.

Yes, UIPasteboard is the clipboard (or the service behind the copy and paste feature). Most users are unlikely to know what either pasteboard or clipboard means. If you're describing the feature you should probably use the simple 'copy & paste' terminology.

I have the same question: which string is preferable to show to the user?
"Copy"
"Copy to Clipboard"
"Copy to Pasteboard"
Looking at the standard built-in apps on iOS 12, it looks like the first form ("Copy") is used almost everywhere.
Doing some more research, I googled for pages containing "pasteboard" on site:help.apple.com, and found pages such as https://help.apple.com/voiceover/info/guide/10.7/English.lproj/_1128.html which include text like You can also copy the last spoken phrase to the Clipboard (also called the “Pasteboard”) by pressing VO-Shift-C. But note that this is a page for macOS, not iOS. When I searched for iOS pasteboard site:help.apple.com I got zero results, while searching for iOS clipboard site:help.apple.com got many hits, all of which suggests that Apple doesn't use the term "pasteboard" when addressing users (even though UIPasteboard is the name of the internal API).
Another data point is that the Simulator has a menu command Edit / Automatically Sync Pasteboard although (speculation!) maybe that's meant to be understood by developers not end-users?
I've got a similar problem in that I'm trying to display an error message if the pasteboard contents are "invalid" in the current situation. (In the app, there is a main tweet which has already been loaded in the main part of the window, but I also want to let the user select a second tweet if they've copied a Twitter URL to the pasteboard.) I want to say something like The tweet on the pasteboard could not be downloaded but I assume most users won't know what a "pasteboard" is, and even changing it to The tweet on the clipboard could not be downloaded isn't great IMHO. Removing the on the pasteboard/clipboard phrase is not an option because The tweet could not be downloaded won't work since it sounds like it applies to the main tweet already loaded in the main part of the window, not the tweet on the pasteboard. I could remove the message entirely, but then the user wouldn't know if they successfully copied an invalid link to the pasteboard; they could keep retrying because they think the copy-to-pasteboard failed, not the download-from-twitter failed.
Update 2019-07-20: I wanted to document how Google Chrome does it, because it seems like a good solution. When you tap into the search box to start typing a URL, it provides an extra option immediately below it saying "Link You Copied" followed by the link. I like this because "You Copied" aligns with the action the user took ("Copy") and avoids the whole issue of using "pasteboard" or "clipboard".

from ios development cookbook :
Pasteboards, also known as clipboards on some systems, provide a
central OS feature for sharing data across applications. Users can
copy data to the pasteboard in one application, switch tasks, and then
paste that data into another application. Cut/copy/paste features are
similar to those found in most operating systems. Users can also copy
and paste within a single application, when switching between text
fields or views.
so to answer your question yes, clipboard is called pasteboard in iOS.

Looking at the human interface guidelines, there is a picture of app showing a pop up menu with an option for Copy. So simply say Copy and do not mention pasteboard or clipboard
https://developer.apple.com/ios/human-interface-guidelines/interaction/3d-touch/

Related

Modify OS X app without source code using Swift

The problem is the following.
The title for button FindName is wrong and it should be Search, another thing is that window title is misspelled: "DisplayUsrEmail"
I don't have the source code of the application.
My main requirement is to write the small application that will modify the current application and fix above problems.
I have to write the new app using Swift.
What I did:
1) It is quite simple to change the title of the button without coding. (FindName -> Search) I changed it in the Info.plist file.
2) It is also easy to change the app title (Executable file) in the Info.plist, but in my case, it doesn't change the window's title "DisplayUsrEmail"
3) I opened the apps unix executable file in the hex editor (used https://hexed.it/) and found there the title "DisplayUsrEmail". But the app crashes when I add the byte with symbol 'e'. ("DisplayUsrEmail" -> "DisplayUserEmail") I can just change the title with the same characters count, but it doesn't resolve my problem.
So, is it possible to write the new app that will modify the current one? If yes, what is the workflow?
The app is compiled through xcode and is a known fact that it is not possible to retrieve the source code from the compiled application.
To answer your question: no, it's not possible.
I don't think that this is at all possible. When an app is built, it's also codesigned to prevent any changes to it. If any changes are made, macOS can't (or refuses to) open the app. This is a security feature that prevents people from modifying applications to bypass security measures, licensing, etc. in the app. Since you've modified the app, you are seeing this security feature in action in the form of the app crashing when you attempt to launch it.
That being said, it MIGHT be possible to modify the UI elements only without affecting the executable. In the app's resources folder, there should be a file with a ".nib" extension. This is the compiled user interface which is where the incorrect spelling of the window and button are. If you modify this file ONLY, the UI elements might be correct when you launch the app again. It's also possible that this nib file is part of the codesigned bundle and modifying it will cause a crash, just as if you'd modified the executable.

Is it possible to attach a file to an ios calender event?

In Mac OS it is possible to attach files to a calender event and read that files on the iOS calender.
Question: Is it possible to attach a file to an iOS calender event using the Event Kit framework?
I could not find any hint in the Event Kit documentation
The short answer to your question is no - there is no way to attach a file to an iOS Calendar Event.
Why? Because there is no place to put a file. Looking at the EKEvent Class Reference turns up a short list of properties, none of which would work for our goal of adding a file to the event.
If we go up to the super class EKCalendarItem there are also no place to put a file.
However, what is it you are trying to do exactly?
If you want to attach a file on one device, say a photo of a cat, and then have that photo sync with the event to another device, you are out of luck. The documentation shows no place you could attach a binary blob to a calendar event.
However there are some other tricks you might want to try if you are ok only making it look like a file is attached:
EKCalendarItem has a notes property that stores an NSString. You could try something hacky like putting the file as binary data in a string format in there, but I wouldn't as thats silly and could break in all sorts of ways. If you are trying to just store plain text, though, that could work well.
If you want to link to the file using a URL you can put the URL in the notes property as another comment suggests, but I would suggest you use a different property - the URL property.
As for how you can give the impression there is a file attached to a calendar event (without actually being able to) I would suggest you look into the magic a good URL scheme can provide. I'm not sure what functionality you are looking for, but a URL scheme is an Apple approved way to tell your software to show a 'file' (Well, a view in your app that could be a file) by clicking a URL attached to a Calendar Event. You will still have to take care of getting the file onto the device, but that should get you closer to what you want. Good luck!
No, EventKit does not allow you to add an attachment to an EKEvent.
The only idea I can offer is to use the notes attribute to keep the file's url.
You can add an attachment like a photo in the OS X iCal application. When synced to you iPhone it will be visible in the iOS Calendar App.
Save it to Dropbox, copy the link and paste it to the URL box in Calendar Event. It's kind of wonky but it does work. Maybe Apple would do well to creat the functionality to link to photos, docs etc. It should be pretty straight forward.
I don't know if this was untrue at the time this was asked, but now... you certainly CAN add an attachment such as an image. AND...there are actually SEVERAL file types you can add!!
I wanted to add my mobile concert ticket & barcode image to the my iCal event so everything for the night would be consolidated.
Albeit this is more sort of a work around, because it's not done directly in your iOS iCal, but it's very much possible to do. (and all from your iOS device) You simply go about doing it through your iCloud within a browser.
TO ADD AN ATTACHMENT TO iCAL EVENT:
Open icloud.com in and enter your Apple ID and PW.
Double-click the event to open it (if it isn't open already).
Do any of the following: Click Add File next to “attachments,” locate the file on your computer, then click Choose. Drag the file into your event. ...
Click OK. A paper clip icon appears on the event to indicate there's an attachment.
SOURCE:
https://support.apple.com/kb/ph12080?locale=en_US
It is possible attaching files to your calendar entries! There is a little application for iPhone and iPad you can use (secretary-app.de).

Is it possible for an app to be decompiled?

I need to code in authentication information for specific parts of my website into my app. Is it at all possible for the app to be "decompiled" and the username and password exposed?
NSURL *url = [NSURL URLWithString:#"https://predefinedUsername:predefinedPassword#www.website.com"];
Yes, it is possible. Assume that if you have anything compiled into your app, it can [and will] be discovered by someone somewhere. Even if it isn't possible today, you are creating a frozen record of such information that will be vulnerable to any future attacks, known or unknown.
You really need the user to perform some task that authenticates them. There are a million and one ways to do that, and for every one of those, a million and two ways to do it wrong. :)
Without knowing more about your specific requirements, it is impossible to really say much more outside of "keep it simple and don't store or send anything in clear-text".
As #Hyperbole said, If you store the username and password in plain text it will be visible in the executable. It is extremely trivial to examine the executable for strings, and it's usually the first thing someone with malicious intent will try.
Right click on any app you've downloaded in iTunes and select show in finder. Make a copy of the app on your desktop and rename the app from AppName.ipa to AppName.zip. Double-click to unzip it, and look inside the folder. Navigate to the folder Payload and then right click on the (probably only) file in there called AppName that looks like an application but has a big circle with a cross through it for the icon. Select show package contents. Scroll through until you find a file called AppName with no extension and a blackish rectangle with the green word "exec" as an icon. Open that file in text edit or another text editor. You'll find that most of this ends up being random symbols and other crap, but you should occasionally see some plain text. The compiler takes string constants and embeds them directly in the app when you compile it in most cases.
You asked about what magazine apps and others do to access content - There are a ton of different ways to do it but off the top of my head, after the server verifies your in-app purchase receipt, the server would record an identifier specific to your iTunes account, saying that you've purchased a specific issue of the magazine. Then your app can request that file from the server, adding the identifier to the request in the process. The server would respond with the file once it looks through the database and determines that you've purchased the content.
Other solutions include signing/hashing a unique key.
Your example would expose the username and password without the need to decompile as you send it via plain text in a URL request. Anyone with a sniffer or MITM service yould snatch it out of the air. A better approach would be to make use of SSL via the http*s* protocol. You could go a step further and either prompt at runtime for the credentials and/or store an encrypted version within the app.
This is very bad because it is trivially easy to recover these credentials just by running 'strings' against the app binary without needing to decompile it.
Can't you pop up a dialogue box asking the user to enter the credentials when they first start the app ? Alternatively you could store them encrypted in a file and then ask the user for an alternative credential e.g. Passcode that derives the key but even this will not survive a determined attack unless the Passcode is long.

Can UIPasteBoard be accessed from Safari?

I'd like to copy something from a native application into the paste board. And then read the copied value from the native browser. Is there a way to do this?
Do you mean read it from the pasteboard without having the user actually paste it? If so, then the answer is a definite no -- reading the pasteboard without user input would be a security no-no (suppose you'd just copied your credit card # or SS# in another app?).

Launch my app using email attachement

I want to bind my app to some file extension so when I receive an email with an attached file with the correct extension, clicking on it will launch my app and pass it the attached file.
Is it possible ? How ?
Thx
--G.
As iPhone applications are not allowed to share files on the file system, what you're looking for is not immediately possible (not with the published APIs that I know of, anyway). You might still have a couple of options though.
Either way you'll have to use a custom URL scheme, which is associated with your app, and paste that into your email. This URL might point to some external location, which your app can download the file from.
Or it might contain the actual file contents if it's fairly small. URLs are 'just text' (some restrictions apply), so you're free to put any data you want to in it, as long as it is URL-encoded.
You still need to get the URL into the email though, which might or might not be as easy as attaching a file.
It's not possible to simply associate a file extension with an application on the iPhone.
You could create a custom URL scheme that would launch your app, but probably that won't help you.
This is actually possible, I'm working on this exact same problem and this great tutorial has really helped me.