how to show facebook Events in application - iphone

i want to show users event page in my app
i tried with graph api but not helps.
I want something like This

Got Answer:
i did:
NSURL *url=[NSURL URLWithString:#"https://www.facebook.com/events/list"];
[[UIApplication sharedApplication] openURL:url];
its done
Thanks to all who tried to help me.
this will shows users events who had loggedin - in device

Related

Open a shared link in facebook to open in native app if installled in iphone

I am struggling with one thing. Below is the scenario:
I have a website which has a feature to share a link with facebook.
What I want is if someone has the facebook app installed in the iPhone and clicks on the link, it should open it in the app to which that link belongs, if that app is installed.
Could you help me? How can I achieve this ?
You need the URL scheme, which can be found here
Facebook iOS URL Scheme
You will need to open the URL like so
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.some URL.com"]];
You can check and open some specifics applications using url which they are shared their url scheme here.
For example with facebook, you can check if the user has the app installed :
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"fb://profile"]];
And call this method to open the application :
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"fb://profile"]];

How to link a button to a Youtube user in Youtube app

I found this code to link to a specific video in youtube app but how can I show the youtube user?
I used this code to show a specific video:
NSString *stringURL = #"http://www.youtube.com/watch?v=WZH30T99MaM";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
http://www.youtube.com/user/username
and
http://www.youtube.com/channel/channelname+some varibales
Does anyone know how to do this?
and what if the user havent got the youtube app which is available afte ios6?
All possible links within the app are displayed here. Opening a specific channel within the YouTube App from yours is not supported with a URL link.

How to return to app after openURL

in my app I need to open a url by using
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"urlstring"]];
after a certain process in the page how can i return to the app.(like facebook doing for safari authentication)
You can't unless you also build the website part, then you can open your own app by calling the App custom URL scheme, wich you will have to add your self to info.plist.
What the Facebook app does is it registers fb:// URLs to redirect to it. Then it sends you to a special link at facebook.com that redirects to an fb:// link while passing some information along (a token or whatever). If you open Safari and type "fb://" into the URL bar you'll get sent to the Facebook app. rckoenes' answer shows how to register URLs to do that, but the part about returning to your app is up to your website (you have to write that redirect page).
This might work?
UIWebView webView = [[UIWebView alloc] init];
NSURL *url = [NSURL URLWithString:#"urlstring"];
[webView loadRequest:[NSURLRequest requestWithURL:url]];

iOS-Facebook connect with UIWebView

I am a beginner in iOS programming. I am trying to build an Facebook app using iOS SDK for facebook. I have downloaded and integrated the facebook SDK with my sample app. I have also created my app id. I am also able to start my app by (after facebook object creation):
[_facebook authorize:#"123456" permissions:_permissions delegate:self];
Here user authorization takes place within the default iphone browser.
After successful user authorization, I am trying to pass a facebook url pointing to a particular person's facebook wall, within a UIWebView. Now the problem that I am facing is that UIWebView opens up the url in which Sign In/Login option is again there, which should not be the case as I have already done the facebook authorization part.
So my question is how to pass the active facebook session within UIWebView, so that the authenticated user can straight away open any facebook url within UIWebView.
Strangely, instead of UIWebView if I use the following code to connect to a facebook url , i am allowed to successfully connect as an authenticated user:
NSString *url = [NSString stringWithFormat:#"http://www.facebook.com/xmarshall123"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: url]];
The above code off course opens the default browser, and that's probably why I am able to connect to the facebook url as an authenticated user.
Please help.

Open a URL from iPhone Application

I want to integrate some links on my iPhone application.
That is when the user touches on the button saying "Yahoo" then Yahoo's page will be opened and then all the functionalities of Yahoo mail has proceeds. How can I do that? I have a bit of idea about NSURL, but not much.
Please help me for that.
Thanks in advance..
To open the page in Mobile Safari, you need to implement something like the following:
NSURL *url = [NSUR URLWithString:#"http://www.google.com"];
[[UIApplication sharedApplication] openURL:url];
You could return to your application using Custom URL Schemes (for more information see the iPhone Application Programming Guide), but since you want to access sites over which you have no control, I presume that isn't an option? Could you use a UIWebView control within your app instead?
In the action method of the target put something like:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://www.google.com"]];