How to programmatically add calendar subscriptions on iOS? - objective-c

Via the settings panel of your iPhone, you can add a subscription to a remote .ics calendar format. I have a Dutch iPhone app that does this from within the app (see the screenshot below, "abonneren op de agenda" means "subscribe to the calendar"), but there must be others too.
I want to mimic this behavior for a project of mine, but I can't find the API to do this with. It looks like it's not a part of EventKit, but because there's no app switching going on when you hit 'subscribe' in the example app I suspect it's also not a url scheme.
Who knows?

Try something like this:
NSString *url = #"http://server/filename.ics";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
This shows an uialertview with the question to the user if he/she wants to subscribe.
;)

Related

Link to developer's apps

How do I open the App Store on the Apple TV to show all the apps created by a specific developer?
The iOS way, http://appstore.com/DEVNAME, does not work on Apple TV.
I use this method:
NSString* url = #"some url";
[[UIApplication sharedApplication] openURL:[NSURL url]];
To get the details of a developer,
https://itunes.apple.com/lookup?id=1074241891
To get all apps by that developer,
https://itunes.apple.com/lookup?id=1074241891&entity=software
To get the apps based on localization,
https://itunes.apple.com/lookup?id=1074241891&entity=software&country=gb
or
https://itunes.apple.com/gb/lookup?id=514675684&entity=software
I don't know why it is currently making me download a js file, it is suppose to display JSON response in browser? Maybe just temporary?

Showing sms dialog in ios for certain number

I know iOS is very strict about accessing sms and user data. But I wish to implement simple feature, something like log.
In my app user sends sms to another number (robot). And gets it's state back in sms. I know I can't access them in any way. But maybe I can set up a button which would simply show sms from certain number if there are any. Just to open Messages for a certain number that's all.
Is that possible, and can be accepted by Apple?
You can only send an sms. You cant view any messages. Check the apple documentation here.
Apart from usage of MFMessageComposeViewController, only option you have is to open the message app as,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"sms:"]];
Or just to pop up the sms app with number as,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"sms:1234567890"]];
Here is a similar question.
Update:
If you want to do this inside your app, you can use MFMessageComposeViewController. Check this apple documentation for more details on this.

Sent text to notes

I'm trying to add a 'copy to notes' button in my app which sends a text to the notes app of ios. Is there any possible way to integrate this?
I've done some research and didn't find anything and since I've never seen it in an other app I guess it's not possible, but I thought It was worth a question.
Good question. Situations like the one you describe are always handled with URL schemes using the UIApplication method openURL:. For example, to launch the phone app with a specific number you could do:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:1-234-567-8910"];
Or to launch the Mail app:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"mailto:nobody#example.com"];
Just to show a few examples. The Apple URL Scheme Reference document describes all of the various URL schemes to integrate with different system apps. Nowhere in this document does it mention a URL scheme for the built in Notes app. If it were possible to send text to the Notes app, I would expect the document to advertise the fact. While it's not conclusive proof that it's not possible, I still think it should be cited as strong evidence of such.
Note that there are likely several third party note-taking apps that have their own custom URL scheme that may support launching with text.

No icon when sharing with Sharekit

I am trying to do a really basic sharing on Facebook from my app, with ShareKit. Most things looks ok, but I don't understand why there's no icon to the left, just the small one in the footer. I can't find a way to put it there. How do I customize it? For me it looks like the left picture I attach, but I would like to have it like the right.
NSURL *url = [NSURL URLWithString:#"http://itunes.apple.com/us/app/...?mt=8"];
item = [SHKItem URL:url title:[NSString stringWithFormat:#"I'm playing someGame on my iPhone! My Highscore is %i, think you can beat it?", 456]];
[SHKFacebook shareItem:item];
You cannot out of the box. This dialog is provided by the Facebook SDK, which is just built into ShareKit's files - unchanged.
I am sure if you do a bit of digging around in ShareKit's folders you'll find the Facebook SDK, but I am not sure if you're allowed to edit its appearance (I know you aren't allowed to change the Share button for example)
With regards to the icon - this is loaded from the web and cannot be changed. The dialog comes from the Facebook website directly and somehow intercepting it and putting it on your own website would create an invalid request.
Edit: Based on your lovely edit (love the spray annotations :P), you can achieve this in the settings page for your app in Facebook. To do this, head over to Facebook's developer app (should be in the applications section of your Facebook account) and upload a large resolution icon for your app. Remember, it asks for a small 16x16 icon and the same one in different sizes, if it finds no icon with the sufficient size it'll display nothing.

iPhone: Button "Vote in AppStore"

I would like to add a button "Vote Us" that opens App Store and brings automatically users to my app review page where they can vote my app.
How can I do it?
I think the easiest way to access specific pages on the App Store is to use the URLs, which are opened automatically on the iPhone using the Store app. For example, sending the user to http://itunes.apple.com/gb/app/polytune/id364009203?mt=8 takes them to the PolyTune page in the App Store. I'm not sure if there is a more direct way to achieve it.
Use this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
#"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=YOUR_APP_ID&mt=8"
]];