iOS TWTweetComposeViewController - Posting in background - ios

I'm trying to integrate twitter in iOS5 app.
Using Twitter framework in my app, can I post the message in the background?
I know that using TWTweetComposeViewController, it will show a view and then it will post.
Is this possible?

The answer is no. The whole point of having the View Controller is to allow the User to see and dictate what exactly will be posted without interference from the App apart from the initial text which the user also has the option to change. It stops apps abusing the Twitter accounts from posting spam etc.
The Apple Documentation clearly states:
Although you may perform Twitter requests on behalf of the user, you cannot append text, images, or URLs to tweets without the user’s knowledge. Hence, you can set the initial text and other content before presenting the tweet to the user but cannot change the tweet after the user views it.

You can't do this using TWTweetComposeViewController. You can do this using TWRequest provided the user authorizes your app to access their Twitter account(s).

Related

Can I integrate my app onto instagram and publish in the app store?

I'm currently working on an app that allows some feature to be displayed when a user clicks on another instagram user's pictures, ie, when the picture and the provision to comment on the comment section displays. This is a simple feature that in a way overlays over this page. M question is, does instagram or any other photo sharing app allow this?
Once the user downloads my app, he/she will be allowed to integrate my app with instagram and have this feature enabled.
Not sure I understand your question right or not. But there is no way to overlay your view to other application. There is a way to display part of your application in other application, which called extension but Instagram needs to design their application to add that feature which likely impossible.
Other way you can think of is checking if Instagram has API to see if a photo is liked/commented then you can response to that action.

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

Notify Facebook users from iOS app

My iOS app gives the user the option to login using their Facebook account. I would like to be able to see the list with all the friends and invite the ones selected to use the app. The problem is that using the app request window, the friends get a notification that is displayed somewhere in the App Center, rather than in the Notifications panel. Unfortunately, this sort of notification is very subtle and might not be seen only after a long time.
From obvious reasons, I cannot fetch the emails of friends as this would be a great alternative.
Do you know if there is a way to send a Facebook Message or some other sort of notification that is more 'visible' to the receiver? Thanks!
I'm not sure if I completely understand your problem. If it's the problem that I think you're having, it sounds like you need to fill out more information on your Facebook App's configuration page.
From what I remember when I had this same issue, you need to have a Canvas URL set in your Facebook App's configuration page. Even if your app is not going to use Canvas, you need to have that part filled out in order for your friends to receive the app's notification jewel on Facebook.

Doing Facebook Requests directly without the built-in UI

I wanted to confirm if this is possible. I want to publish "User To User Requests" directly to the open graph action with my own UI (specifically the friend selector).
My friend selector does follow the platform guidelines (ie do not allow users to select all users at once). My question is that can I publish these requests directly without having to use any of the FB UIs including the request dialog preview (we are going to show our own preview).
This is to be built on iOS. The primary reason we want to use our own UI is because our design team feel that the popups hinder UX on mobile and they want to make it seamless. Their reasoning is a design issue that probably up for another discussion all together, but what I want to know is about using the requests api without using the native FB ui.
The answer is simply, YES, yes you can do this and then post the request to each friend using the id's of the friends selected by the User. All you have to do is just retrieve the friend list retrieve selected user ids and POST to them the requests.

Resources