How to create an appointment from other application in iPhone? - iphone

I'm trying to call Calendar from my simple application in iPhone. all sample out there give me a clue to use UIApplication#openURL function. How about if i want to open a calendar with/without a new event?
'[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://8004664411"]];'

Apple has a document that lists all of the URL Schemes the current iPhone OS supports. Unfortunately, there isn't one for the calendar, just
Mail Links
Phone Links
Text Links
Map Links
YouTube Links
iTunes Links
so it looks like you can't do it, at least not by launching a URL.

There is currently no API or URL scheme for accessing the calendar information on the phone. If you need one you should file a bug describing why you need it.

Related

How to get/view/read the current URL is in Safari?

Did lots of searching, just came up with the "how to open a URL in Safari..."
Looking to find how to get/view/read what the current URL is when Safari is opened.
Edit:
My app opens a URL with Safari as follows:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:myURL]];
Supposidly, after some validation from website, the ending URL has some attached info.
So I'm trying to get that final URL from Safari.
This is not possible, you do not have access to any outside app. However how most of these authentication / validation techniques work is (like facebook / dropbox login etc.) is that they use some kind of callback back to the app.
You can register an specific url scheme to your app which can have parameters, this way you can get the info in the url the you need. The website will need to support callbacks though or you would need to be able to access the website to provide it yourself.
On how to work with URL schemes you can check out this tutorial:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/
You cannot view this information, as the other posters have said. What you need to do is to use your own website to match the user of the app to the user on the website.
For example, you can send a random number to your website when the user is sent there buy.php?id=123445. Then request (periodically and/or with a button press) via the iPhone the result from your website ex. check.php?id=123445.
This also could be done with cookies and php sessions.

Opening spotify app from my iphone app

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.

Passing a note into Evernote for iOS Applications

I'm working on an app and I want to preserve messages from my application into the users Evernote account (if they select Evernote as a destination and if they have said app installed). Any idea how I can do this locally without the Web API? I can open Evernote by a call:
NSURL *everNoteUrl= [NSURL URLWithString:[NSString stringWithFormat:
#"evernote://"]];
[[UIApplication sharedApplication] openURL:everNoteUrl];
But this typically crashes as soon as the Evernote splash image appears.
I see that apps like Mobile RSS can open up Evernote and pass in the selected RSS message into Evernote (with the wifi disabled), so I should be able to do this locally, but can't figure out how.
Thanks.
See the URL scheme documentation of Evernote:
http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc297053092
Seems like you can only view existing content via the url scheme. Why don't you write an email to Evernote and write the result in that post here.
Edit:
I wanted to recommend to you to write an email yourself as a developer and ask the Evernote team, if there are extended urlscheme possibilities, which are not communicated in their documentation. And if they answer your mail, you could share your new knowledge here with us. That was my idea.
An idea, how MobileRSS does it: perhaps they push new content via webservices to Evernote, then retrieve the new content-ID and than open Evernote? Or they have a special deal with Evernote, but I don't think so.

Linking to my apps on the App Store

I want to create button that, when pressed, takes the user into the App Store and all my apps are shown.
At the moment the code is
-(IBAction)goReviewTwo:(id)sender; {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"https://itunes.com/apps/lifevisionstudios"]];
}
But that doesn't work. Any ideas on how to do it?
Your URL isn't correct. Apple's iTunes Link Maker is the easiest and best way to get the authoritative link to your apps, including for App Stores in various countries.
You can also get a link to a page with all of your company's apps the same way, which seems to be what you're looking for. In the Link Maker your company is referred to as the Artist.
Lastly, rather than using http you should use itms, which will send the user directly to the App Store app rather than routing them through a blank Mobile Safari page first:
itms://itunes.apple.com/us/artist/appname/id?uo=4
Edited to add
As noted in Rab's answer, if you remove the /us it should automatically go to the user's local App Store. It turns out that you also need to remove the query string (?uo=4) that iTunes and the Link Maker generate:
itms://itunes.apple.com/artist/appname/
Just find that page in iTunes, right click the link and choose "Copy Link". Paste it into your code. In your case, I think it would be:
-(IBAction)goReviewTwo:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://itunes.apple.com/us/artist/lifevision-studios/id415139916"]];
}
That should look like itms://itunes.apple.com/us/artist/your-name-here/id101010101 . That's your artist page, and shows your various apps. Take off the /us/ and it should choose based on the user's location. Use the link maker mentioned earlier to specify another country's app store (it will swap in /kr/ for Korea, etc.).
You can link to the App Store with a specific query, like your iTunes Name.
This works:
NSURL *appStoreUrl = [NSURL URLWithString:#"http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&submit=media&term=Anoxy%20Software"];
[[UIApplication sharedApplication] openURL:appStoreUrl];

How can I launch app store from my application

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.