I am opening an another app using openUrl of url scheme.Now I want to back to my source app getting some information from target app.Can anyone know how it will be done?
I am able to open other app using apple url scheme but not getting how it will be returned to previous app.I am using following code to open target app.
[[UIApplication sharedApplication] openURL:url];
You can't, only if the app you are opening knows how to app your app, end knows that your app is the one that opened it will it be able to open your app again.
There is no standaard URL scheme that can tell an other app to open your again.
if the target app yours as well, or it is not but it supports calling back out?
If so, you pass it your URL as a parameter:
url = #"otherapp://?return=myapp";
Latest update from iOS 9:
Now apple provide back button by default when you navigate to any app using url schemes.
Here you go:
http://appleinsider.com/articles/15/08/09/how-to-use-the-new-back-button-in-ios-9
Related
I have to open a URL in safari... and after doing some work on safari I have to close the safari...
my code is as below.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strPageUrl]];
Actually I have to share video on myspace.. if user has shared the video then I have to close safari and need to activate my application again.
I want to do something similar facebook SDK login with safari..
Please help me how to open this
custom url schemes work only one way... Like if you opened safari from your application then you can't return back to your application unless the second application is also yours and you have implemented another custom url to return back to your application. Since safari was made by apple so it does not have info regarding your application.
I am not exactly sure what you are trying to achieve but you can try out UIWebView for requirement if it helps.
I'm pretty sure there must be a way to launch spotify iphone app from my own app. I've seen SMP app (share my playlist) doing something very similar when pushing playlist into spotify app.
I guess it should be by using something like:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"spotify://search:muse"]];
As you can see, I want to be able to make spotify search for a specific keyword. The problem is I don't really know the spotify url scheme, if there is such thing available.
I've been searching in the web, in spotify developer website, etc. but nothing comes up...
I have run into a similar need in an app. My solution was to create a client that hits the Spotify API to return either XML or JSON of the search. For instance, if you want Muse, you would hit the API with the following URL:
http://ws.spotify.com/search/1/artist?q=muse
From the XML or JSON, you'll be able to extract the link to the particular artist within their URL scheme:
spotify:artist:12Chz98pHFMPJEknJQMWvI
Chop off the spotify:artist: portion and append that onto a Spotify artist link:
http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI
Then, using the Spotify URL scheme and UIApplication, you can open the Spotify app to that particular artist's page:
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:
#"spotify://http://open.spotify.com/artist/12Chz98pHFMPJEknJQMWvI"]];
Note, using URL schemes to access features of another app is generally undocumented and can be a fragile endeavor. If Spotify in the future decides to change anything about this, it will break this functionality without warning.
The quick fix I made was to remove the urlscheme that was added to the original uri.
so you'll be calling the uri directly.
which is 'spotify:artist:4gzpq5DPGxSnKTe4SA8HAU' or 'spotify:track:1dNIEtp7AY3oDAKCGg2XkH'
UIApplication.shared.openURL("spotify:artist:4gzpq5DPGxSnKTe4SA8HAU")
or
UIApplication.shared.openURL("spotify:track:1dNIEtp7AY3oDAKCGg2XkH")
this fix is for the crash when calling the old urlscheme from v6 and above.
I have 2 admob ad on an ipad app.
One is 320*250
another one is 468*60
When I click the 2 two ads
I found the first one will go to the web url and launch safari,
the second one will push up a window and display the web url.
Is it possible to change the second ad banner action to go to the web url and launch safari also?
I am not sure if I need to change the client codes or do something on admob server side setting.
Welcome any comment
Unfortunately I don't think this is something that you can control. It looks like it's a part of the AdMob SDK where the ad creative determines what type of view to put you into when a click happens.
I have used to launch a web view safari using this code please try it. Its working fine in my Application.
NSURL *url = [NSURL URLWithString:#"http://www.stackoverflow.com"];
if (![[UIApplication sharedApplication] openURL:url])
NSLog(#"%#%#",#"Failed to open url:",[url description]);
Thanks.
In some free apps there is a button for buy pro version of app that if you touch it app store app will open how can i do that from code ?
The iPhone/iPad will automatically recognize an AppStore URL if you just:
- (IBAction)OpenAppInAppStore {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms://itunes.apple.com/us/app/wolframalpha/id334989259?mt=8"]];
}
or if you open any URL that has "itms://" and only on the device
Launch iTunes on your computer.
Search for the item you want to link to.
Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.
Open the modified URL using an NSURL object and the -[UIApplication openURL] method.
Read Technical Q&A QA1629. They also offer a method how you can add your iTunes Affiliate link without redirecting from your app to safari to the appstore
Use the function openURL from UIApplication with the iTunes URL link of your App.
Im trying to implement button which opens app store application from my app. I use this simple line of code, which opens safari but not app store application.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://itunes.apple.com/sk/app/tweetie-2/id333903271?mt=8"]];
I dont know whats wrong, is the URL format correct? I was following this document.
All related questions in stackoverflow are outofdate I suppose.
If you want to bypass Safari, change 'itunes' in the URL to 'phobos'. Note that this will fail in the simulator, but most definitely works on the device.
According to the documentation, iTunes affiliate links have to process several redirects in order to wind up in iTunes. Follow the example to create an NSURLConnection, set yourself as its delegate, and use the string it ends up with to open with UIApplication.