Include branch.io deep link in Facebook "Share" button shareContent (iOS, Swift) - ios

We're using branch.io for our app's referral program, and it works great for email/text (particularly when using the BranchInvite SDK). However, we'd like to add Facebook "Share" and "Send" buttons, including our branch.io deep links (i.e., in the "shareContent" info) in the custom text that goes out with the share/message.
Aside from the ease of using Facebook's UI for friend selection, we feel this will also clarify to our users that they're in control of the process (i.e., we're not arbitrarily spamming their network with invites!).
Anybody know how this might be done? Is it possible?

Okay, not sure if this is the best way, but it gets the job done:
let fbShareLinkContent = FBSDKShareLinkContent()
fbShareLinkContent.contentURL = NSURL(string: Branch.getInstance().getShortURL())

Related

How can i upload video to Twitter using 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.

Can you make a Deeplink in a browser to open "share to story" in instagram?

I would like to have a "share to instagram stories" functionality in a webapplication. I was hoping i could do that with iOS urls and Android intents (in url form).
Is it possible to deeplink from a browser on android to share an image into the story mode?
I was starting from this linke, to open instagram on android phones:
instagram story test
But I cannot find any good resources that explain how to do this with stories. On https://developers.facebook.com/docs/instagram/sharing-to-stories/ it is described how it works for proper Apps with intents, but i was hoping it was possible to creat a link out of that too.
Anyone has done something like that or can tell me the scheme of such an URL?
href="intent://WHAT_TO_PUT_HERE#Intent;package=com.instagram.android;action=WHAT_ACTION";scheme=https;end">
how and where to add an image... and where would be com.instagram.share.ADD_TO_STORY?
Or if that is not possible at all, and the most I can get from a browser is opening instagram?
As far as I am aware, these are the only supported hooks documented for instagram.

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

Facebook/Mobile deep-linking + app links

I'm confused. I think I've fundamentally misunderstood how to use Open Graph stories + deep-linking across my iOS/Web app. I'm hoping someone can help me clarify things. Here's what I have:
A web app set up that takes http://mywebapp.com/?video_id=XXXXXXXX
Properly configured meta tags for app-links
An iOS app with similar functionality that communicates with an API
Facebook sharing on the iOS app.
Here's what I expect:
See a link (ON MOBILE) in either the Facebook app or Safari, when I tap the link get the 'Install App' or 'Open in App' UX
I experimented with simply linking to 'http://mywebapp.com/?video_id=XXXXXXXX'. It doesn't work UNLESS I go to the object debugger (https://developers.facebook.com/tools/debug/og/object/) and 'Fetch New Scrape Information' for that video_id (i.e. it doesn't work dynamically, the page has to be scraped.) I also tried using Open Graph sharing with a contentURL and a combination of custom objects/actions/content/stories and at no stage did the Facebook app offer to open up the iOS app (again, unless I scraped the page in advance).
Have I misunderstood what is possible? I take it that if I scrape + link to http://www.mywebapp.com it'll work fine, but I want to have custom stories like:
'User X played video 'Y' using MyWebApp', but that kind of dynamic sharing WITH a concept of deep linking/app link/whatever seems impossible. Does anyone have any experience with this?

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..)

Resources