How can i upload video to Twitter using IOS - ios

I have a local video link, and i want when the user press the button -> show twitter app with my video and title there (without using UIActivityViewController), just by pressing the button

You have to choose which way you want to go to upload a video, i.e. post a tweet with just that title you've mentioned.
Option 1
Use the HTTP API and create a URLRequest that contains the video as 'attachment'. You have to handle authentication first or the request will most likely fail.
Option 2 (Not really an option anymore)
Another way would be the iOS SDK provided, as given in the other example here. Problem is: there is no longer an official Twitter SDK for iOS. You could try your luck with the archived OpenSource SDK but maintainability is pretty decent with this.

Related

Instagram - share image, text and url via iOS app : swift

I am trying to share image with some text and a url from my app to Instagram which would later redirect to iOS app installed on the phone from Instagram app. I am able to share image on instagram but not with text and url. Any help related to the same would be great!
A Bit Late To Answer (Aug, 2022)
I have successfully cracked the plain text sharing on Instagram by myself, after doing a lot of research on google on this topic. You can use the mentioned deep link to open Instagram Direct with some text to share from your application,
instagram://sharesheet?text={AnyTextOrLinkToShare}
Moreover, the below code should work on iOS to launch Instagram Direct (Messenger) from your app with some content
if let url = URL(string: "instagram://sharesheet?text=https://google.com/") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
Not sure, why did they hide this information from their official documentation but now who cares, I have achieved it with the continuous efforts of 16-18 hrs! :)
Instagram had removed pushing custom captions to their app while sharing photos at one point, check this post.
I also understand, according to the Instagram iPhone Hooks page, that you can pass a photo only to the "Select A Filter" Instagram screen, which is before you set a caption. I'm sorry, but I don't think Instagram supports custom captions.
Looks like there is not official way to share image/sticker together with a text/link to Instagram - because "com.instagram.sharedSticker.contentURL" parameter bacame unavailable or private.
But there is one workaround how to proceed working with image/sticker & text/url consequentially described here: https://stackoverflow.com/a/74241318/20343737

Set your app to detect and open when a specific link is clicked - Xcode, Swft 4

I'm currently working on an iOS app, Swift 4, that automatically launches on click of a link to block users from accidentally navigating to that link.
How would I set this up?
For example, YouTube opens up youtube.com links.
Sorry if this is a vague question, if more info is required feel free to ask ^^
If you create a custom URL protocol like myapp://somepath (where myapp is the protocol) then you just register that custom protocol, and when the user clicks such a link it’ll automatically open your app. You can’t intercept a general purpose URL protocol like HTTP or YouTube.
(At least not without OS support. That's how YouTube and the app store are able to open HTTP links.)
I haven't done anything like this so far but it seems like you should take a look at Apple URL Scheme and Universal Links:
https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html
https://coderwall.com/p/mtjaeq/ios-custom-url-scheme
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html
https://www.raywenderlich.com/128948/universal-links-make-connection?utm_source=raywenderlich.com%20Weekly&utm_campaign=95f29cf4fc-raywenderlich_com_Weekly5_31_2016&utm_medium=email&utm_term=0_83b6edc87f-95f29cf4fc-415182745

Stream to VLC for iOS via URL Scheme

I'm trying to link to the iOS VLC app via its URL scheme. I need to open a FLV file(preferably as a stream, rather than downloading). I have tried vlc://http://domain.com/path/to/video.flv which opens VLC with a popup asking if I would like to play or download. Tapping download works, however play doesn't do anything except close the popup(I can get it to eventually work if I tap Play in the popup -> Play in Control Centre -> tap back in VLC). Is there a way to get it to play by directly through the URL?
Bonus points if you figure out how to select the "Scan for Subtitles" option in the "Open Network Stream" section of VLC. ;)
I've looked all over Google and can't find any documentation of the URL scheme. Any help is greatly appreciated.
the vlc:// pseudo protocol is broken in the current 2.6.4 release - it is fixed in 2.6.5 which is currently waiting for review by Apple. I hope that it will be out this week but this is beyond our control.
Generally speaking, I recommend to use another protocol though based on x-callback-url, documented on our wiki: https://wiki.videolan.org/Documentation:IOS/#x-callback-url
Regarding an extra subtitles URL, this is currently not supported. We could add it though, it's just that nobody asked for it so far.
For those who want to add subtitle it has been added in this commit and can be used like this:
vlc-x-callback://x-callback-url/stream?url=http://example.com/dogs.mp4&sub=https://example.com/dogs.srt

Post link to Facebook including app URL scheme - iOS 6

I'm using the UIActivityViewController to share an image and url from within my app.
I'm having trouble formatting the facebook post. I attach an image using a subclassed UIActivityItemProvider and provide the text for the post in the same way.
I want to add a url, but it needs my apps custom url scheme in front of it like this
myurl://image?url=http://imageurl.com
The problem is, when this is posted, only the last half of the url is clickable (from http:// onwards). Which means it doesn't open my app with the url.
Is there another way to do this?
I know I can create an app on Facebook, but how can I tie the two together using the UIActivityViewController?
Thanks
You have 2 options :
Create a simple server-side web service that will redirect from http://yourserver.com/linkToApp/image to myurl://image .
It could even show a different page/preview if the app is not installed/if you're not on an ios device.
Create a facebook app and use "Deep linking" (it will basically do the same for you..)

Custom URL Scheme for sharing URL in native Facebook iPhone App

I know the available custom URL schemes for the native Facebook iPhone App:
What are all the custom URL schemes supported by the Facebook iPhone app?
But I can't find a way to publish a URL to my wall / timeline in that way, that Facebook collects / shows the site title and thumbnail as it does with the touch.facebook.com/sharer.php file.
The only way I see so far is to call
fb://publish/?text=www.domain.com
but this only post the link to my timeline, not title, thumbnail and site description.
Does anyone know a better way?
Basically you have two options:
You can either launch Safari using the Feed Dialog URL Scheme as explained here or use Facebook SDK as explained here.
If your App isn't integrated with Facebook already, it's probably easier to go with the first one.

Resources