Set up multiple Facebook applications in one solution and fan page tap url problem - asp.net-mvc

I have looked and searched for an answer for that question and I found an answer in Nathan Totten blog you can find the answer here:
https://gist.github.com/820881
The problem is I am trying to get the application settings according to the application which the user uses, which comes from the url by seeing your app name or id if you were in fan page.
It works with me within the user profile context by using:
var CurrentUrl = HttpContext.Current.Request.UrlReferrer;
and i can get the application name but within facebook fan page when using the same way it gives me a strange url :
http://static.ak.facebook.com/platform/page_proxy.php?v=4
However, it is supposed to give me:
http://www.facebook.com/pages/Mypagename/130736200342432?sk=app_myappId
Any help will be great and any new way to get which app id or tap url the user clicked will be even better.

this problem was exist within the user profile before ,and i think that you use the ifacebookapplication current method that will not give you the chance to get any thing about the context it only take you to an infinite loop ,i think that you have to send to Nathan Totten him self may be he has an answer because in the article he mentioned :
private IFacebookApplication GetCurrent()
{
var url = HttpContext.Current.Request.Url;
// Get the settings based on the url or whatever
var simpleApp = new DefaultFacebookApplication();
// Set the settings
return simpleApp;
}
may be he has a way to get the url within fan page or another way which i am sure it is not exist at least in my mind now .

Thanks ,I found an answer to my case :) now i can get my application id the way is i have to applications i try to decode the sign request with the app secret of each one if the decode result was clear then it is my target app if not then i will try the other one

Related

create multiple 'view in app' links using Branch.io in index view

I'd like to create an index view which shows a list of items followed by a 'view in app' button to download data directly into the app.
Solution 1. [Not a sulution] I think deepviewcta call is appropriated to use in a single product page. It doesn't look like suitable in my case, because it has to call deepview before calling deepviewcta.
Solution 2. I'm trying to construct the URL directly using 'dynamic' deeplink. The documentation says any additional query param appended will shows up in the initSession callback, but it doesn't work for me.
the construct link looks like this:
https://bnc.lt/a/key_test_kkkkkkkkkkkkkkkkkkkkkkk?has_app=yes&channel=character&my_list_id=0c56c4bc-fac9-412a-be19-c0feefe30d29
what I got in the callback only has following data
"+clicked_branch_link" = 0;
"+is_first_session" = 0;
in the callback, other params are just missing, I got:
url NSURL * #"my-app://open?link_click_id=197576253652400385" 0x00007fad90d47450
Any Other Solutions?
It turns out I was using live key in ios App while using test key in server end. So solution 2 works now.
Also for anyone want to do the same thing. For regular Branch Links, it is not possible to stay on the same page as the Branch link was clicked from. they suggest adding a $after_click_url to the Link's data. This key will tell the system to route to a particular web address after the Branch Link has been clicked.
Thanks for branch.io's support, they responded very quickly.

How does today.com switch URLs like this?

Recently, our family has started watching HGTV-style shows on Netflix. One of our favorites is the Property Brothers. I went Googling today and visited this link:
http://www.today.com/home/property-brothers-give-peek-inside-their-beautifully-renovated-las-vegas-1D80297959 (wow)
I went scrolling down the page, and was surprised to see the URL in the URL bar change as I went onto the next article. The previous article was still above, and the URL switched back when I scrolled back up. How does Today.com switch URLs without loading a new page like this? It's seamless!
I have heard of the History API before in relation to Facebook. Is this what's being used?
I have heard of the History API before in relation to Facebook. Is this what's being used?
Yes. From MDN's "Manipulating the browser history" web-guide:
Suppose http://mozilla.org/foo.html executes the following JavaScript:
var stateObj = { foo: "bar" };
history.pushState(stateObj, "page 2", "bar.html");
This will cause the URL bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists.
(See the above-linked guide for much more information.)

JQGrid: How to override saveparameters url for inlineNav addRow?

I need to explicity specify the url for adding a row via inlineNav.
But, I do not know HOW to do that, other than something called saveparameters has the url value I need to specify, documented here: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing&s[]=addrowparams
However, function that uses that is saveRow, and that is called by inlineNav save button using default saveparameters, which has wrong URL (the window location, because grid has not editurl specified).
QUESTION: How can I configure jqGrid saveparameters with the url my inlineNav save button needs?
I could put 8 or 10 URLs here showing many asking same question and no answer. Is this stupid question, or not supported or possible?
Any help much appreciated.

QuickBlox sample video chat Unauthorized Error

I am trying to run the Quickblox Video Chat sample to see if this is something that can be integrated to my app, but the sample setup is incomplete in how to get it to work.
https://github.com/QuickBlox/Sample-VideoChat-ios
I have created an app, put my app keys in the sample, and created 2 users and put their information there, but still does not work.
Please, when you put sample code write ALL the information you need to get it to work. The read me file mentions nothing about having to setup new users and even I figured this out, it still does not authenticate, just giving the error "Unauthorized"
This is the code they have for the users:
// This is test oppoents. This is 2 users' logins/passwords & ids
self.testOpponents = #[#"videoChatUser1", #65421,
#"videoChatUser2", #65422];
I created my own users in my registered Quickblox app and replaced the above code, but it still does not work. Is the password information supposed to go someplace here???? What is causing this to fail???
If you quickly go through whole sample, you can see some comments there
for example, look at this file
https://github.com/QuickBlox/Sample-VideoChat-ios/blob/master/VideoChat-sample-ios/AppDelegate.m
you can see comments that explain what all these values mean
//
// There are tests oppoents. There are 2 users' logins/passwords & ids
//
self.testOpponents = #[#"videoChatUser1", #65421,
#"videoChatUser2", #65422];
videoChatUser1 - login and password of the 1st user,
65421 - ID of the 1st user
videoChatUser2 - login and password of the 2nd user,
65421 - ID of the 2nd user
hope this help

Google Apps Script, anchor creating a redirect when clicked

I'm creating a script that logs a user into a site. Everything works but for some reason when the user clicks on the link to go to their profile the link opens in a new window and at first redirects before going to the correct page.
For example:
The correct link is: https://sites.google.com/site/examplelehan/Jan_Moolman but the moment the link is clicked the link that is actually executed in the address bar changes to: http://www.google.com/url?q=https%3A%2F%2Fsites.google.com%2Fsite%2Fexamplelehan%2FJan_Moolman&sa=D&usd=2&usg=AFQjCNFXLLswDh2AWCBpYi54jNXxpZVGPQ
So it seems as if www.google.co.za is being pre-pended to the url. I've seen other posts as well but none of them seem to be offering working solutions. A few posts have said that this occurs when the link is created without the http:// prefix but I've tested that and the same problem occurs.
I've also tried using .createHTML in order to create the link but for some reason the link doesn't show, any other HTML I use seems to work so I guess that's why Google created the Anchor function.
Thank you in advance for your help.
In this issue tracker comment Eric Koleda suggested a workaround using UrlShortener Services . I tested it with your link (http://goo.gl/HRPfU) and it seems to be a working solution.
EDIT : to answer your comment, here is a working example :
function test(){
var shorturl=short('https://sites.google.com/site/examplelehan/Jan_Moolman');
Logger.log(shorturl);
}
//
function short(longurl){
var toShorten = UrlShortener.newUrl().setLongUrl(longurl);
var short = UrlShortener.Url.insert(toShorten).getId();
return short
}
note that this API has to be activated before it can be used (see docs)

Resources