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

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.

Related

how to show facebook Events in application

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

Facebook button going to facebook iPhone app, but not loading correct facebook page [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Custom URL scheme for new Facebook iOS app
I have a Facebook button in my iPhone app. When it gets touched I want it to go to the Facebook iPhone app and load a facebook page if the Facebook iPhone app is on the device, if not, then go to Safari and go to this facebook page. The code below takes you to the facebook app, but it just goes to the feed. But it works how I want it to when the Facebook iphone app is not installed
This code does get run.
How can I go straight to the page from a click of the button?
NSString *urlStr = #"https://www.facebook.com/MYFACEBOOKPAGE";
NSURL *url = [[NSURL alloc] initWithString:urlStr];
if (![[UIApplication sharedApplication] openURL:url]) NSLog(#"%#%#",#"Failed to open url:",[url description]);
Maybe try using this instead.
https://apps.facebook.com/YOUR-NAMESPACE-HERE
I can access my own canvas app with the above URL, but using www. doesn't work.

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]];

Force a link to open in Safari instead of the in-app browser

I have an issue with QR Readers.
I encode a URL within a QR Code. When read by many iPhone App they will open the URL within a WebView within the app.
I want to open a vcard there which those internal things just wont do - page stays blank whilst when opened directly in safari everything works great.
So my question is:
Is there any way to get out of the WebView and open the safari?
Regards
Nik
No, there is no way to do this, you are at the mercy of the app creators.
NSURL *url = [NSURL URLWithString:#"http://www.google.com"];
if (![[UIApplication sharedApplication] openURL:url])
NSLog(#"%#%#",#"Failed to open url:",[url description]);
While I agree with #rjstelling... try QRafter by Kerem Erkan - you can choose to open the URL specified in a QR code with either the application's web browser or in Safari.

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"]];