Subscribed Calendar name has the .ics URL when opened from a UIWebView - iphone

My iPhone app (supporting iOS 6+) has a web view which lists events with a "Add To Calendar" button for each event. The "Add To Calendar" button is a hyperlink to an .ics file on the server. To make this work, I have modified IIS to use "text/calendar" as the MIME type for .ics files and used the following code in my UIWebView delegate's shouldStartLoadWithRequest: when the request URL contains the ".ics" path extension
[[UIApplication sharedApplication] openURL:ics_url];
When tapping on the "Add To Calendar" button for an event, I get an alert "Subscribe to the calendar "http://blah.com/pathtoics/file.ics"" with 2 buttons Subscribe and Cancel. When I tap "Subscribe", I get another alert "The Calendar "http://blah.com/pathtoics/file.ics" has been added" with 2 buttons "View Events" and "Done". When I open the Calendar app by tapping on "View Events" button, I see the event gets added but the Subscribed Calendar name is the URL "http://blah.com/pathtoics/file.ics"
Two Questions:
Is there a way to modify the alert to say "Subscribe to the calendar event Team Event 1"" i.e., the event name/description instead of the server path to the ics file? If so, how do I do that?
Is there a way to make the name of the Subscribed Calendar to be a description text that I use in the ics file instead of the path to the ics file? If so how?

In the ICS file, make sure X-WR-CALNAME is set to the calendar name you wish to be displayed in the alert and as the name of the subscribed calendar.

Related

How to handle notification response of `UNUserNotificationCenter` when "Clear all" is done to remove all delivered notifications?

I have a class which adopts UNUserNotificationCenterDelegate and its userNotificationCenter(_:didReceive:withCompletionHandler:) to manage notification responses, clear badge number etc.
This all work fine when user interacts with a single notification (clear it, use its actions or tap it to open the app) but if I have multiple delivered notifications and iOS "groups" them in a collapsed groups/section, there is an option to "Clear all". If the user taps on that the userNotificationCenter(_:didReceive:withCompletionHandler:) is never called and I cannot handle this action of "multiple notification cleared".
Is there a there any way to get a callback that "Clear all" was done on the delivered app notifications?

NSUserNotification() onclick in OS X

How can I make a notification clickable?
I want that when a user clicks the notification on the Mac, Safari opens with the specified link.
To respond to clicks on a userNotification object, you need to implement NSUserNotificationCenterDelegeate's userNotificationCenter:didActivateNotification: method.

What are the different event handlers got for fb-send button

I am trying to use fb-javascriptSDK.
At some place i need to show a send button - to send a message to fb friends from within the website.
<div class="fb-send" data-href="http://www.example.com"></div>
Here I have few questions:
1) How to pre-fill the message text-area with some content, by default? (I wanted to put some html content)
2) currently if i include the above html, the f-send button is created and if user clicks on that button, a popup is coming. But can i have an event when the user first clicks on f-send button? ( NOT the "send" submit button inside the popup )
3) With FB.Event.Subscribe - message.send, I have an event handler after the message has been posted. But is there a way to attach an event before posting the message?
Please clarify my doubts...
Regards,
SuryaPavan
No event is triggered until the message is sent
You cannot prefill the message text.
You cannot use HTML in the message text

How can I open application from EKEvent

Is there any way with which we can open our application when some event in calendar is triggered.
What this actually means is, suppose I create and EKEvent and addAlarm: for this event. Now what I want is when this alarm is triggered I want my application to open, there is no problem is an alert show where user has option like, view & cancel. and when he/she selects view my applications opens, just like local OR push notification.
In view event, display a hyperlink for your application.
Tapping on that link can open your application.
I guess so... Not sure about this...
You can open the event by using Apple Script
See Calendar Scripting Guide
tell application "Calendar"
tell calendar "Project Calendar"
show (first event where its summary = "Important Meeting!")
end tell
end tell

MFMailComposeViewController and cancelling "save" action sheet?

i am using MFMailComposeViewController inside my iphone app. I notice that if i enter any text in the body and then press the cancel button, i am prompted with an action sheet with an option to save/don't save the unsent message. I have two questions:
can I programmatically prevent the "save/don't save action sheet from appearing? MFMailComposeViewControllerDelegate doesn't appear to have anything along those lines
if i do save, where is the mail saved to? i looked in my mail accounts and didn't see anything saved in any of the "draft" folders.
No, you can't avoid the action sheet appearing. It's been added in iOS 4.x to, precisely, avoid tapping on the "Cancel" button inadvertently when writing a long email, which I think it's a good idea.
It is saved in "Drafts" folder of the account used to compose the e-mail (normally, your "default account" as it is registered in the Settings of your device). I've just tried using a couple of apps and it works.