Custom link in an open graph story - ruby-on-rails

I'm building a facebook app which uses open graph to publish stories. I can successfully publish the stories but what I want to do is to customize the app link in the story(circled in the given image).
Currently my link to "posted via APP_NAME" is referring to the Facebook appcenter page of my app. All I want to do is to customize the link and make it refer to my personal website. How can I do that?
Do I have to specify any extra parameters while making a POST request to facebook??

As far as I know this link leads to one of:
Canvas URL if you have a canvas app
Site URL if you have no canvas app just website with fb login
You can set both in App Settings (https://developers.facebook.com/apps/)
Looking through the logs it's impossible to distinguish it from people just accessing the app.

Add a canvas application with an address of page with this code:
<script>top.location.href = 'http://your-website.com'</script>

Related

Google Analytics - URL builder not linking back to campaigns

I have been trying to use the URL builder to get more insight into how productive our links are. I build the url in the Google builder, and have linked it into emails and our website hyperlinks. However, nothing comes back to the analytics dashboard.
Specifically, I want a URL that I can use in an email campaign that when clicked will tally in our analytics dashboard. I have tried with this builder: https://ga-dev-tools.appspot.com/campaign-url-builder/ but nothing links back to our Acquisition - Campaigns report.
Is there a way that I have to manually link the campaign url to our dashbaord to get it tracked and reported?
Thanks,
learningtheropes
Usually, it's not a URL builder issue, but a redirect that you have on your website, that "resets" the session and ignores your UTM's.
BTW, try using this extension instead
https://chrome.google.com/webstore/detail/google-analytics-url-buil/gaidpiakchgkapdgbnoglpnbccdepnpk

iOS deeplink (universal Link) through sub Domain

I have read a lot of articles regarding universal links but still i need to be clear regarding few things.
I have to add universal links to http://www.domain.com but due to certain reasons i will not be able to make my website SSL certified or even put apple-app-site-association with https in root folder. So I thought of doing this in a different way, i will put apple-app-site-association file in the root of a subdomain, lets say https://www.app.domain.com/apple-app-site-association
Then i will open every universal link with that subdomain whenever universal link is available and redirect https://www.app.domain.com to http://www.domain.com if universal link is not available.
Questions in my mind :-
apple says - file needs to be accessible via HTTPS—without any redirects—at https:///apple-app-site-association.
In this line what does apple mean by without any redirects ?
when apple does not find any universal link related to a particular URL, will it itself redirects it to safari.
Is this a safe way to add universal links or is it necessary to have our main domain on https or at-least apple-app-site-association on https
This should work fine. To explicitly answer your questions:
'Without redirects' means when iOS requests https://www.app.domain.com/apple-app-site-association, it must find the file at that address. You can't have a redirect of any kind (Javascript, 301, 302, etc)
If a URL is not valid for Universal Links because you didn't cover it using the inclusion rules in the apple-app-site-association file, it will be opened using Safari. If the URL is on another domain without a valid apple-app-site-association file (e.g., http://www.domain.com/), then it will also be opened in Safari.
Yes, it's fine. Definitely a workaround, but not unsafe.
You should also investigate a hosted deep linking service like Branch.io (full disclosure: I'm on the Branch team) or Firebase Dynamic Links. These will give you all of the same benefits (plus a bunch more flexibility, to be honest) without any of the setup headaches.
We experienced ways where a 302 on iOS works.
In general I fully agree that Apple officially does not seem to support any redirect.
The following cases have been tested on an iPhone 6 running iOS 11.
These cases work :
Website in Chrome on iOS: User clicks on link A and a 302 redirects him to a Universal link B.
Website in Safari on iOS: User clicks on link A and a 302 redirects him to a Universal link B.
Gmail App on iOS: User clicks on link in email and Gmail opens external Chrome browser, which opens a Google link which redirects to link A which redirects via 302 to Universal Link B. (this case works only if Chrome is installed and in Gmail Settings the user explicitly changed the default browser to Chrome)
These cases DO NOT work:
Apple Mail: User clicks on link A in email and external Safari is opened. 302 happens and opens Universal link B. Result: App does not open
Gmail App: User clicks on link A in email and Gmail inAppBrowser (probably WKWebview?) is opened. Gmail redirects EVERY link from an email over a google server, as a second step link A is opened (dont know via 302 or other method) then 302 happens and opens Universal link B. Result: App does not open
Unfortunately you can see that in some cases it does NOT work. As these cases, Apple Mail and Gmail on iOS are very important for most of us here, I think this is a showstopper and you should not use it.
We tested with Adjust links and therefore in cases where the app does not open Adjust opens the AppStore to download the app.
For all Adjust interested: We tested by opening a link https://app.adjust.com/... which has a 302 on the respective Universal link https://XXXXXXX.adj.st/... on which our app listens.

Facebook Graph API doesn't return profile image for one page

Apologies, I can only include 2 URLs as a new user so I have had to econonomize.
I am having a problem where the user object in Facebook's Graph API is not returning a profile image correctly. I can only find one case of this problem. For all other uses I have tested it appears to be working correctly. The profile image doesn't seem to have any privacy settings, since I'm able to view it normally from the profile page.
I am using Facebook's Graph API to load the profile image for a user/page by putting this URL into an IMG tag:
https://graph.facebook.com/[profile-id]/picture?type=square
This has worked in all cases I found during testing, including pages and users. For one of our users deploying the app on a page, however, the URL is loading the question mark image, as though there is no profile image for the page. Their page clearly has a profile image, as you can see here:
http://www.facebook.com/EgansRestaurantPub
But if you click through to the Egan's Calendar tab, you'll see the question mark image. The image URL is the following, which returns the question mark:
https://graph.facebook.com/400488613342471/picture?type=square
I've checked the ID using the following link format, to ensure it's the right ID for the page:
http://www.facebook.com/pages/[anything]/400488613342471
My first theory was that there were privacy settings on the profile image, but my personal account (as a non-fan of the page) is able to view the profile image. My only other idea is that perhaps it is because the page uses a short URL (EgansRestaurantPub) that doesn't include the page ID. For similar pages, I found using the following worked:
[graphurl]/cocacola/picture
[graphurl]/BMW/picture
But when using the same method for my client's page, it still returns a question mark.
Does anyone know why this is not returning the profile image for this page? This is the only page where I have found this problem.
I am using the PHP SDK and a bit of the JS SDK. I would prefer to avoid making another call to the API that would delay loading the page. That's why I liked being able to throw the URL straight into the IMG tag. But I will make another call if there is no other way.
It seems there is some kind of restriction as mentioned in the user document (picture field):
access_token required for pages with whitelisting/targeting
restrictions, otherwise no access_token required
You just need to supply a user access_token for this to work:
https://graph.facebook.com/400488613342471/picture?type=square&access_token=XXX
To test this, you can directly get an access_token from the Access Token Tool.

custom url schemes in twitter posts it does not work

I am an ios app developer. We have implemented a custom URL scheme 'my_app://section_name' or so where if the link is opened in the user's mobile browser, it will redirect the user to a specific section in the app.
We would like to be able to tweet these URLs and have users on their mobile device click on them to open up the app, however it just can click once
(when you click close , maybe you click wrong then you want to click it second but it does not work )
I hope this isn't too silly of a question. Thanks
Make sure to check the tweet body after it have been posted.
This may be due of an URL shortener, especially if the tweet is posted from the iOS 5 Twitter framework.
I'm having a similar issue with url schemes. We can include them in emails and text messages, and they highlight and work properly.
Unfortunately, when we do the same with a tweet, the iOS Twitter client fails to recognise the special URL scheme and so the user cannot tap on it to open our app.
Pretty big oversight, methinks. Anyone else had any joy including special URL scheme links in tweets?
A solution that you should consider involves not sharing the URI scheme directly, but rather creating a page on your web server to handle this. In fact, if you want to be able to share full URI schemes with paths, you're better off building a web server to dynamically generate a page with a URI scheme redirect.
This is a over-simplified representation of what we built at Branch. This includes some code to get you started though the web server will require a bit of setup not described here.
instead of testapp://some.data.here, you'll link to http://yoursite.com/hosted-redirect/some.data.here.
your server should listen at the route /hosted-redirect, grab some.data.here and build the following page (body here):
(source: derrrick.com)
So your server will have to generate and respond with this page, filling in some.data.here, anytime http://yoursite.com/hosted-redirect/some.data.here is requested.
A lightweight node app could do this with a single file.

Link on Facebook with custom prefix/protocol (like myapp://blahblah)

I added to my iOS application option to detect and response to custom URL schemes to launch application ( http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html ).
Link is working perfectly on different sites (using href), but I'm having problem with Facebook. If I'm trying to post link (using Graph API) which looks like:
myapp://blabla
Facebook return error:
The url you supplied is invalid
And for feed with link return
link URL is not properly formatted.
I can't just post url as a message because it's not being detected as a URL and appear like text only.
Is there any way to post to Facebook wall with custom links?
Edit:
I have an idea, but I don't know if it gonna work. Putting
myapp://blabla directly into address field in mobile browser is launching application so probably accessing an webpage (like http://www.mywebpage/myapp) with only redirection to
myapp://blabla gonna work too, but is Facebook gonna accept that link?
I think your suggestion in the edit is the correct method, and should work. However applications like spotify seem to use an intersticial page which fires the "app link" with javascript, the advantage to this approach is that you can use that page to "sell" the app to users who don't have it and also provide lovely open graph tags for people who want to share it.

Resources