Open iTunes Store within IOS App just like in twitter music - objective-c

This code separately open Itunes .
NSURL *url = [NSURL URLWithString:#"https://itunes.apple.com/us/album/gravity-voice-performance/id631561174?uo=4"];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_webView loadRequest:requestObj];
I want to open Album page within ios app.

Have a look at SKStoreProductViewController.

Related

Force youtube video from UiView to play

I'm creating an app which include youtube videos. For this app i need a way to force the youtube video to open. how can i force it to start?
i've looked at this:
webView.userInteractionEnabled = NO;
But cant seem to figure out how to use it.
This is the code:
stringUrl = [NSString stringWithFormat:#"http://www.youtube.com/watch?v=%#", youtubeId[0]];
headerTitle.text = [NSString stringWithFormat:#"%#", theTitle[0]];
NSURL *url = [NSURL URLWithString:stringUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
Here you will get working example project in which it is using HCYoutubeParser to parse the youtube url
https://github.com/hellozimi/HCYoutubeParser
form here you can down load working code and you can check it on simulator and iphone both
even it will explain how to use it.

UITextView clickable url opens after terminating app

I am using datadetectortypes with my UITextView to be able to detect the links and navigate to the page. but the app is terminated and link opens with default safari after terminating the app. Is there any way to open the link within the application?
You can do that if you have web view
for example
NSString *urlAddress = #"http://myurl.com";
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[myWebView loadRequest:requestObj];

going for the next youtube video in my iphone app

i'm developing an iphone app which can play youtube links using a web view
Every things fine. but except it goes to the next video automatically. is thr any way to stop this.
Here is my code.
NSString *urlAddress = #"http://www.youtube.com/embed/wh0ZK5QJMWk"; //http://www.youtube.com/embed/wh0ZK5QJMWk
NSURL *url = [[[NSURL alloc] initWithString:urlAddress] autorelease];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:requestObj];
Thanks

pages.zip file will fail to displays view using UIWebview and NSURL

I have an application that displays search tips. This will work if I store an .html file in the main bundle and display it using the Apple example code:
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}
//load document --
[self loadDocument:#"searchTipsLegislators.html" inView:searchTips];
If however I change the document to one created using a compressed Pages file the app return the error:
2010-12-15 08:53:04.537 cv112[42067:7003] Cannot load iWorkImport
2010-12-15 08:53:04.538 cv112[42067:7003] Failed to generate preview
Has anyone gotten this to work?
Two things to try:
Don't compress the pages document. This is no longer necessary as of iOS 3.
Don't expect this to work on Simulator. Does it work on your device?

ipad app opens browser in the background

Im using the openURL command to send an SMS, but it opens the safari,
can I send the command so it opens in the background??
ie, the user dont see the browser opening or the message that it gives, and stays in the app,
NSURL *url = [NSURL URLWithString: #"https://smsgw.exetel.com.au/sendsms/api_sms.php?username=xxx&password=xx&mobilenumber=0xxx&message=xxr&sender=mk&messagetype=Text&referencenumber=04"];
[[UIApplication sharedApplication] openURL: url];
Thank you
You can't have Safari open a URL for you in the background. But supposing you just want to request the URL and ignore whatever comes back, you could try:
NSURL *url = [NSURL urlWithString:#"...whatever..."];
NSURLRequest *request = [NSURLRequest requestWithURL:url delegate:nil];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request];
[connection start];
You can do this be creating a UIWebView inside your app, and calling loadRequest: on the instance, like this:
UIWebView *webView = [[UIWebView alloc] init];
webView.delegate = self;
NSURL *url = [NSURL URLWithString: #"https://smsgw.exetel.com.au/sendsms/api_sms.php?username=xxx&password=xx&mobilenumber=0xxx&message=xxr&sender=mk&messagetype=Text&referencenumber=04"];
NSUrlRequest *request = [[NSUrlRequest alloc] initWithURL:url];
[webView loadRequest:request];
This will load the URL inside the app, without sending you over to Mobile Safari. The benefit of this method over NSUrlConnection is that if you conform to the UIWebViewDelegate protocol and implement webViewDidFinishLoad: in your delegate class, you can see if the call succeeded or not.