Tweeting a message using Swift and Parse - ios

I'm currently writing a social networking app for iOS using Swift and the Parse SDK. My app is basically a UITableView that displays a timeline of messages from users that sign up for my app. But there is one part that I'm struggling with that I hope the community will be able to help me solve.
My problem is that when I want to be able to tweet the message that the user to my twitter followers. But I cant seem to figure out how to get message displayed in my timeline as the text for my tweet share sheet using the Social Framework built into iOS. I also have a Alert to be displayed when the user taps on a message to give a list of sharing options. I figure this alert is not the cause my issue. I will attach my source code for my TimelineTableViewController. Full code examples on how to active this logic in Swift is very helpful.
TimelineTableViewController

Related

Save a contact on iOS using QR [duplicate]

Is there a URL to open the contacts application from within my application? I know you can achieve this with the settings app by using the UIApplicationOpenSettingsURLString constant in Swift; however, I wasn't sure if I could do the same with the Contacts app.
There isn't a deep link for opening the Contacts App.
Apple is very picky when it comes to deep-linking. They have to provide one for Settings since many apps need services like Data, Location, Bluetooth, Wifi, etc.
Unfortunately they do not extend this to the Contacts App.
However if your app needs contact information then for that Apple has provided a Contacts framework to browse through your contacts within your app itself.
Read more about it here.
In order to add/update/delete/merge contacts directly from your app without using the Apple's Contact UI, use the CNSaveRequest APIs. More on that here.
The closest thing you can get to opening a contact is to write them a message in IMessage. From this screen the user can press the contact icon and open the contact page for that particular contact.
You can do this by opening the url sms://+44776382223 where the number is the number of the person that you would like to view the contact of.

Swift: How to post to Twitter from iOS app with certain hashtag?

I'm fairly new to posting to social media via Swift in an iOS app but need to be able to post an image to Twitter under a certain hashtag (i.e the user's image is always posted under this certain hashtag regardless).
So far, my app can take a picture and access the user's photo library, but I have run into some trouble implementing post to Twitter.
I have looked at the following questions: Post on twitter from ios app
How to make an ios app post to twitter
But most of the links referenced are either gone or outdated. I have also looked into Sharekit (http://getsharekit.com) as this would do the posting to Twitter automatically it seems, however Sharekit is deprecated.
Ideally, I would like the user to be able to take their photo (I have this) give it a caption, etc WITHIN THE APP then when they press a button it more or less "silently" posts to Twitter WITH the hashtag that I will have set in the app. I am unsure as to how to accomplish this.
What is the best way/approach to posting an image to Twitter via Swift? The hashtag bit seems to be the more difficult step - how can I "force" a hashtag on the user's post?
What you're probably looking for is the Social framework and SLComposeViewController.
Using the setInitialText(_:) method you can add text to the tweet, though this doesn't really force anything, as the user still has the possibility to edit the tweet before publishing, and it doesn't really work "silently" either.
Posting an image is done with the addImage(_:) method.

Initiate Facebook Group Chat from iOS App

I want my app to create a new Facebook group chat with certain people that opens either on Facebook's site in Safari or in the native Facebook app when the user presses a button. I want Facebook to handle the whole chat and my app only to initiate it somehow in the cleanest and least involved way possible. My app already uses the Facebook SDK to open an active FBSession, so I've already got login credentials.
Looking around online and in Facebook's docs, I can't find anything that suits my needs. The closest thing I found was in this answer containing a list of Facebook app URLs you can connect to that open the Facebook app to certain pages. There's "fb://chat/(initWithUID:)" and "fb://messaging/compose/(initWithUID:)". However, not only is there no explanation on how to use these, but people say that Facebook has changed these URLs (and does not have any documentation on them), so they don't work anymore unless I reverse-engineer new URLs (which could change again). Ugh, so close!
I also found examples on starting chats with the Facebook Chat API, but that involves logging into Facebook using some networking framework then writing my own GUI and model for sending messages, which I am only prepared to do as a last resort. There should be some way to let the Facebook app or website do all that. Does anyone know how I can do this?
I've found something very close, but I still don't see a way to make my app initialize it with the desired group of friends:
The Facebook SDK has a message dialog that can appear for sending messages to friends. This isn't exactly what I wanted but is good enough because it means that all the programming is already done for me by Facebook, and users should be able to see these messages on https://facebook.com and the Facebook apps. https://developers.facebook.com/docs/ios/share#message-dialog

Tapping/Clicking on graph object activity not consistant - Facebook iOS

I recently implemented open graph in one of my iOS apps. Currently it posts a custom activity that when tapped is suppose to show more information about the activity.
This seems to be working for the majority of users. However, I've had a few report that when they click/tap on the posted activity it simply directs them to the app facebook page.
Has anyone else experienced this inconsistency? I cannot figure out what is going on.

How should I show my app's icon on Facebook's friend list in iOS?

I am new in handling apps that will be connecting with Facebook.
I want to let my user log in my app with Facebook account and be able to send something, for example, a gift to their Facebook friends.
I want to get the user's friends list and which is very easy by using FBFriendPickerViewController. However, I want to have an effect that if their Facebook friend(s) is/are also using my app, the app icon will be shown at the right hand side of the user table cell (Just like some Phone Contact lists will show if the contact has Whatsapp/ Google+)
I have been searching through sites but still find nothing about this.
So my question is, is there any "official" way (using Facebook SDK method) to show the icon?
Or I have been thinking of another approach is that, I first get the friend list and then saved it, with the information that whether the "friend" is using my app or not. Then I create a custom friend picker view and check the condition to enable/disable the visibility of the app icon.
I can get the information by using approached of using GraphAPI fields or using external database, for which are mentioned in this , this and this .....
Anybody help?
Ok I end up with customizing my own table view... : )

Resources