I have one custom action (add) and two custom objects (favorites list) and (tv show). I want to add TV shows to Favorites List and register it with the Facebook Timeline. I.E. these two objects are attached to the same action.
I would like the news feed to read:
"[Joe] added [Modern Family] to his [Favorites List]."
I can't seem to figure out how to attach two objects to the same action and have them display in the timeline together. I can either do one or the other.
Anyone have any experience in this? Is this possible?
I have also been searching for a way of doing this, and I've not been able to find anything useful.
I noticed that Spotify does this without issue (straight from the feed of a friend): [user] listened to [song] by [artist] on Spotify, though looking at the 'types' documentation on open graph: http://ogp.me/#types looks like it is a custom feature for listening to music.
Should favorites list really be an Open Graph object?
Can a user have several favorites lists with different names?
If each user only has one favorites list (called "Favorites list") there is no reason to have it defined as an Open Graph object.
Perhaps a descriptive App name could be used to make the aggregations readable.
[User] added [TV show] to [AppName]:
Joe added Modern Family to MyFavoritesList.
Joe added Modern Family and 3 other TV shows to MyFavoritesList.
Joe, Bob and 3 others added Modern Family to MyFavoritesList.
Change your action from [add] to [Favorite] and have [Favorite] inherit from [like] rather than [action]
Add [Favorites List] as a custom property on [Favorite]
The title will still come up with only the object and action so:
"[Joe] favorited [Modern Family] with YourApp"
However then in the Configure Story Attachment you can add a few extra bits to the attachment in a caption e.g.:
[Modern Family] added to their [Favorites List].
Though obviously with curly braces :-)
You can set [Favorite List] to be a property instead of a Connected Object Type and use braces on "Configure Sentences" to display it the way you want it
Related
In my app I want the user to type names into a UITextField (or equivalent) and then when they press return, it will put that word(s) in a blue bubble that's usually associated with tags. The cursor then moves to the end where they can add more "tags".
This can be seen when adding contacts in the To, CC & BCC fields in the Mail app, and also when selecting contacts in the Messages app.
How is this done? Is it something that's provided in the UIKit or available somewhere else?
Many thanks,
Michael
Venmo just open sourced their token field.
https://github.com/venmo/VENTokenField.git
edited:
The equivalent control in desktop Cocoa is an NSTokenField, but there doesn't seem to be an equivalent for Cocoa Touch.
Since iOS 13 there exists UISearchTextField.
https://developer.apple.com/documentation/uikit/uisearchtextfield
You can see that component in action in the Photos App.
That should fit for many use cases. By removing the leftView you can also get rid of the search icon.
But be aware: You can‘t mix text and tokens at various positions.
From the docs:
Tokens always occur contiguously before any text in the search field.
Adding this here for reference:
Feel free to check out TaggerKit (a library I made), it's more or less what OP was talking about. You can basically add tags functionality to your app by just adding a view and a couple of properties.
I dont think you can do it with any built in functionality in the SDK, never seen such a feature. What you could do however is implement it yourself, have some custom blue button with some text over it, and when the user hits return you can have some code that takes the text and returns you the button that you need, shouldnt be too bad to implement
I am planning on using ShareKit in my App. I would also like to have printing (AirPrint). I was thinking to have all options( Facebook & Twitter & Printer ) in the same actionsheet.
Is there any reason why I shouldn't do that?
I have been looking for some tips on how to achieve this but have come up blank. There are tips to remove things from the ActionSheet but not add them. Would a printer option no be considered 'sharing'?
The process of adding an action to ShareKit is covered in "How to Add a New Action to ShareKit" This description assumes you have already implemented a core Sharekit functionallity (for example, you have implemented the ShareKit example program).
You will copy New Action templates from the ShareKit Template Src folder (.m and .h files) into your project, rename the files with the appropriate name (like "SHKPrint.m/.h"). There are some obvious things to change, like the class name and the header import file. Add #import "SHKSharer.h" to the header file.
Add the class to the actions/services list in SHKSharers.plist, as the linked page describes. (There really is no distinction at this point between an action and a service that I can see, and they may as well be grouped together, as far as I can tell, without problem. One distinction, though, is that actions are presumed to not require authentication. requiresAuthentication is method in the template.)
After that, as the documentation says, get familiar with Understanding the share flow.
At least one of the canShare methods needs to be overridden, and they are already set up in the template for you to modify and uncomment. I imaging that for your purpose, you might want to consider canShareText as an appropriate method to share, so change that one to return YES. Then you will be able to print using a printFormatter assigned to either UISimpleTextPrintFormatter or UIMarkupTextPrintFormatter (but not without setting up a UIPrintInteractionController). (I don't think you mentioned what you want to print, so you'll have to improvise.)
Modify the sharerTitle method in your new new sharer class, to show an appropriate title.
At this point, you should be able to run your code and see an action sheet. Your print action won't show up on this one, but if you click the more... button, it should show up on the second sheet.
Click that action and nothing will happen yet except the sheet will hide. Now you need to add some code to do the printing. (You will see later, if you choose to share again, the new action has been added to the first action sheet, which is a most-recently-used list.)
I mentioned that it was assumed you have already implemented a core ShareKit functionality, such as the ShareKit example program. If you go to the method that invokes the sharekit action sheet (in your own code, such as responding to your pressing the share button), you will see a place to establish what kind of information you want to share -- e.g., URL, image, text, ... This is independent of where you want to send your shared information -- printer, facebook, twitter, ... (which I think puts the cart before the horse, and I have modified my own implementation to fix this.) But, ignoring that for the time being, you will want to set it up something like this:
- (void) shareButtonPressed {
SHKItem *item = [SHKItem text:yourSimpleTextOrMarkupText];
// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
// Display the action sheet
[actionSheet showInView:self.view];
}
This puts the wheels into motion to share whatever is in the item object. The item object includes a shareType, which in this case is SHKShareTypeText, which is an enumerated type.
I won't go into the machinery that translates this into the shared result. I don't know it in my sleep yet, and might mislead you (if I haven't already).
When you click on the item in the action sheet, the SHKActionSheet class does some magic, converting the string name of your new action class (SHKPrint in this case) into a class, and using that to invoke a class method to allocate and initialize an instance of the same class. (I am doing this as I type, so I skipped the step on how this is accomplished from the "more..." second sheet. I'll leave it to the reader to trace that and see how it works.)
The sharing is done through a call chain running through share, then show methods in the SHKSharer class. (There is some business about autosharing that I won't get into here, but I think you can ignore that for the time being.) This finally lands on the send method of your custom class (SHKPrint). Look at your template file, and it will give you some guidance on what to do.
For more information on printing, see this link, which seems to give a pretty good example of what you can do to print.
I'll stop here for a couple of reasons. I think I answered your question, how to add an action sheet. Also, I don't have AirPrint capability to test with here, so I can't really go much further on my own.
Let me know if you have any other questions.
Settings for Mail allows one to add items to a list (the list of accounts) by choosing the "Add Account..." entry at the bottom of the list; info gets entered on a separate screen, and now the list has a new entry.
Is there a way for someone other than Apple to accomplish this & still get into the App store?
Is there a way for someone other than Apple to accomplish this & still get into the App store?
No. There is no public API to do something like that.
If you're asking can someone modify the add new account list under mail settings programmatically, the answer is no. Even if there was a private API I doubt it would get through the apple review.
Yes, it is possible to create a similar UI-functionality in your app as the one described.
Simply add a list element in the end of your TableView to act as a list footer with desired functionality.
Once clicked, swap to a another view. In this view you change the data source of your TableView so it contains a new element. Once you go back to the TableView, the new element can be drawn into the list.
I would like to achive the same functinoanlity in the UITextField control as Google search web site (which uses Ajax for this): as user start typing, list of suggestion searches is shown. Then more letteres you type, suggestion list changes.
So imaging I have array of words:
Apple
Abc
Aman
As user types A, all thress suggesions are shown, if user type one more letter p, then Apple is suggested.
How would I do something like this? Mail type of applicatins do it, when receipent name is typed in the To: edit control
I guess I can use UITableView with the search, is it correct approach?
You want a UISearchBar. It's designed to do exactly this. Its delegate provides the list to search and present.
In my app I want the user to type names into a UITextField (or equivalent) and then when they press return, it will put that word(s) in a blue bubble that's usually associated with tags. The cursor then moves to the end where they can add more "tags".
This can be seen when adding contacts in the To, CC & BCC fields in the Mail app, and also when selecting contacts in the Messages app.
How is this done? Is it something that's provided in the UIKit or available somewhere else?
Many thanks,
Michael
Venmo just open sourced their token field.
https://github.com/venmo/VENTokenField.git
edited:
The equivalent control in desktop Cocoa is an NSTokenField, but there doesn't seem to be an equivalent for Cocoa Touch.
Since iOS 13 there exists UISearchTextField.
https://developer.apple.com/documentation/uikit/uisearchtextfield
You can see that component in action in the Photos App.
That should fit for many use cases. By removing the leftView you can also get rid of the search icon.
But be aware: You can‘t mix text and tokens at various positions.
From the docs:
Tokens always occur contiguously before any text in the search field.
Adding this here for reference:
Feel free to check out TaggerKit (a library I made), it's more or less what OP was talking about. You can basically add tags functionality to your app by just adding a view and a couple of properties.
I dont think you can do it with any built in functionality in the SDK, never seen such a feature. What you could do however is implement it yourself, have some custom blue button with some text over it, and when the user hits return you can have some code that takes the text and returns you the button that you need, shouldnt be too bad to implement