I want to know a scheme to open a Youtube playlist.
I have this code:
if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"youtube://playlist?list=PLgrYntDWyYDdHwZney5QoTDFQrphRmYoK"]]]//https://twitter.com/cms24es
) {
}else if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"https://twitter.com/TmrrrsApp"]]]//https://twitter.com/cms24es
) {
}
I know a scheme to open a video, if I use youtube://, but to open a playlist instead I don't know how.
Well I guess youtube doesn't understand browser URL of playlist like this -
http://www.youtube.com/playlist?list=PLgrYntDWyYDdHwZney5QoTDFQrphRmYoK
Alternatively, go to your video->playlist -
Right click on the playlist and select "copy link address"
It provides a link something like this -
http://www.youtube.com/watch?v=ILwOQV32rHg&list=FLLpWow4PGIVkCJifJxrMfwA
Use this as a URI to play in native youtube app.
youtube://www.youtube.com/watch?v=ILwOQV32rHg&list=FLLpWow4PGIVkCJifJxrMfwA
Related
Does anyone know the URL scheme for iOS to show a video in the facebook app?
For showing the profile I use
NSURL *url = [NSURL URLWithString:#"fb://profile/1727305929"];
[[UIApplication sharedApplication] openURL:url];
What is similar for a video?
For example, what is the URL scheme for this video link:
https://www.facebook.com/hanwel/videos/10200653642859965/?pnref=story
Thanks,
Hanno
I've tried to use the code below but it keeps taking the user to show the website and I need it to take them to a application on the iPhone, ipad and ipod!
- (IBAction)fbIconGo:(id)sender {
NSURL *fbURL = [[NSURL alloc] initWithString:#"https:facebook.com/numberHERE"];
// check if app is installed
if ( ! [[UIApplication sharedApplication] canOpenURL:fbURL] ) {
// if we get here, we can't open the FB app.
fbURL = [[NSURL alloc] initWithString:#"https:facebook.com/NUMBER HERE"];; // direct URL on FB website to open in safari
}
[[UIApplication sharedApplication] openURL:fbURL];
You can do with:
NSURL *url = [NSURL URLWithString:#"fb://profile/<id>"];
[[UIApplication sharedApplication] openURL:url];
Schemes
fb://profile – Open Facebook app to the user’s profile
fb://friends – Open Facebook app to the friends list
fb://notifications – Open Facebook app to the notifications list (NOTE: there appears to be a bug with this URL. The Notifications page opens. However, it’s not possible to navigate to anywhere else in the Facebook app)
fb://feed – Open Facebook app to the News Feed
fb://events – Open Facebook app to the Events page
fb://requests – Open Facebook app to the Requests list
fb://notes – Open Facebook app to the Notes page
fb://albums – Open Facebook app to Photo Albums list
Your URLs should be changed to use the URL schemes instead , Look at these posts for the complete details,
http://wiki.akosma.com/IPhone_URL_Schemes#Facebook
Open a facebook link by native Facebook app on iOS
If you are trying to navigate to a page or a profile , the address should be as follows,
NSURL *url = [NSURL URLWithString:#"fb://profile/<id>"];
[[UIApplication sharedApplication] openURL:url];
You can use Apple URL schemes to communicate with other apps. Read DOCS Communicating With Other Apps
TO open facebook app use fb: URL scheme; i.e.
NSURL *url = [NSURL URLWithString:#"fb://https:facebook.com/NUMBER HERE"];
[[UIApplication sharedApplication] openURL:url];
I'm trying to open up the vine app when you tap a vine url from my app. Doing
NSURL *url = [NSURL URLWithString:#"vine://http://vine.co/v/biTaEEwdq2n?1"];
[[UIApplication sharedApplication] openURL:url];
Will indeed open up the app, but not navigate to the video. Any idea how this is done? Is it possible?
After looking at the Javascript on vine.co, I've found that the correct scheme for a post is : vine://post/<#id#> . So, let's try this vine://post/biTaEEwdq2n
It works for me.
Try using vine://v/biTaEEwdq2n or vine://video/biTaEEwdq2n as the URL.
The URL Scheme for the vine profile page is vine://user/USERID
Ex:
vine://user/126850376482649253
Is there anyway to use an iOS URL Scheme to open the YouTube to a particular user's profile I've tried youtube://user/myusername but that did not seem to work.
To open a Youtube page in Youtube app (if it's installed on the device)
you can check whether the device can open the page:
// URL scheme for youtube app
NSString *youtubeURL = #"youtube://www.youtube.com/user/";
// Page name(or channel name)
NSString *youtubePageName = #"YourPageName";
// Check if the device can open in Youtube app or not.
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString: [youtubeURL stringByAppendingString:youtubePageName]]]){
// Open in Youtube app
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: [youtubeURL stringByAppendingString:youtubePageName]]];
}else{
// If device cannot open in youtube app, open the page in browser.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://www.youtube.com/user/YourPageName"]];
}
This solution worked for me
iOS 9 edit: Target app's URL scheme must be added to info.plist under LSApplicationQueriesSchemeskey.
Here is a related post: iOS 9 not opening Instagram app with URL SCHEME
This forum post's lack of responses indicates there probably isn't a way to do this currently: YouTube iOS URL Scheme for Channels
But you may be able to request that feature on YouTube's iOS app feedback page. And in the meantime, I'd recommend just linking to users' HTML YouTube pages.
No, few weeks ago I was looking for the same, but i didn't found anything. Instead I've opted for use a UIWebView to show the youtube channel or using the openURL: UIApplication's method to open the channel with Safari.
If you want to save some time, you can use the easy-to-implement TSMiniWebBrowser's control at this Github page.
Here is the youtube Channel Url scheme, try to load it in UIWebView and it will works.
http://m.youtube.com/#/user/channel_name for e.g http://m.youtube.com/#/user/whartonmagazine
I'm working on something cool and I want to link to my Google+ profile in the iOS app.
Has anyone found out how to use the mgc:// URI scheme that the Google+ app on iOS provides to open a specific profile the way you can do it with fb://, twitter:// and almost every other account-based iOS app?
In fact it's really simple. Check your URL in a web browser and replace http:// or https:// with gplus://
Example :
If the URL in your browser is https://plus.google.com/u/0/100711776131865357077 then you open the profile in the app with the following code.
NSURL *gPlusUrl = [NSURL URLWithString:#"gplus://plus.google.com/u/0/100711776131865357077"];
if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
[[UIApplication sharedApplication] openURL:gPlusUrl];
}
I know this is an old post, but I found the solution here (just search "google"). The URL scheme is gplus://. I have tested this myself and verified that it worked. Usage example:
NSURL *gPlusUrl = [NSURL URLWithString:#"gplus://"];
if ([[UIApplication sharedApplication] canOpenURL:gPlusUrl]) {
[[UIApplication sharedApplication] openURL:gPlusUrl];
}