Add calendar to iphone - iphone

I am currently making and iphone app and a big function that i want to incorporate is the ability to subscribe to a calendar..
what i wish to do is to let the user give a URL for where the calendar is held, and from that url i want the app to fetch that calendar and subscribe to it..
i want to know how i can write the code to do this..
so in short my question is..
what code would i write to:
get .ics file from a URL
and save/subscribe to this newly
fetched .ics calendar file
any help and info would be very much appreciated..

The idea of "subscribing" to something isn't a build in function of the iOS SDK. To get this type of functionality would mean writing a recurring/timed function to grab the contents of this URL and process it locally.
The library I often use to simplify some of the HTTP functionality that you'll need is asi-http-request
https://github.com/pokeb/asi-http-request/tree
Hope this is helpful.

Related

Agora.io - How to share video timestamps using mediaPlayer? - iOS

Here's what I'm trying to do: Using Agora.io's MediaPlayer API, I want to be able to publish video to a channel (which I can do using RtcChannelPublishPlugin), but I need to be able to then receive the media's current timestamp on the non-publishing device. Then, I will be able to "re-publish" the video from the other user starting at the same timestamp.
I've tried using AgoraRtm, but I don't think messages sent using rtm can be saved as variables.
I've found a way to get the timestamp and print it out, but the trouble is getting it to the other users in the channel and using it as a variable.
Has anyone experienced something like this? Any help would be greatly appreciated.
I'm using Agora's API example project as a base.
I would recommend the use of meta data that goes with the video stream. See the following API:
https://docs.agora.io/en/Interactive%20Broadcast/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setMediaMetadataDataSource:withType:

iPhone Dev - Creating a one time UIAlertView like in Temple Run

You know how Temple Run sometimes has alerts when you open the App that appear even though you don't update the App? I understand how you would implement this if you were to submit an update to your App, but how does Imangi implement new alerts without releasing new versions of the App? (I'm assuming they upload it from some server, but I'm an amateur at all of that stuff so could someone sorta vaguely explain how I might go about doing that? Will I need to learn Internet programming languages :O?)
Thanks.
I agree with Jonathan. I would set a plist with a reference number on your server. and it would look something like this. I'm using concept, not code. It would be as simple as hosting it on your server. Or it could be as complicated as your creating a user interface on your website that allows you to just plug in the information and it would create the plist for you.
-(void)checkanddisplaynotificationbasedonupdatedplistontheserver{
int currentnotificationnumber = userprefs preference for item "notification"
get and parse notification.plist from your server
notificationnumber = object at index 0
if notificationnumber > currentnotificationnumber{
display your notification with parsed plist
}
}
You could host a plist online, with an array of alerts stored as dictionaries, with attributes like 'title', 'body' etc. The app would then parse this and to create an alert. You could then set up a method which searches for updates to this file every time the app opens and has connectivity.
This is not the only way - there are probably hundreds of other files types/ automated systems to use, however this is a simple way, and roughly how all of them work, and I have implemented something like this in some of my apps. Hope this helps, if you wan't any help coding it, I will be happy to help!
Jonathan

Can I change the Core Location alert message when accessing ALAssets?

I am using the ALAssets framework to access the Photo Library. The first time it's accessed, it asks the User if the app can use their Current Location, and I understand that is necessary and why.
However, in Core Location Manager, there is a purpose property, where it looks like I can customize the iPad's alert message to say why it is necessary to tap Yes. (I don't actually use location, just want access to the photo library.)
I can't seem to work out how to find out where to use this property, as the alert message comes up when I first try and enumerate the assets, and there doesn't seem to be anywhere to intercept it before the error occurs if the user says NO.
I know I can put up a notice of my own before first usage of ALAssets, in anticipation of the iPad built-in alert, but it seems slicker to change the actual iPad message.
Thanks.
I’d suggest, before you try to access the photo library, that you create your own dummy CLLocationManager, set its purpose, then call its -startUpdatingLocation. That’ll get the system to bring up the location permissions dialog with your custom text, and the resulting app-wide location permissions ought to carry over to your ALAsset access.
Unfortunately you can't customize this message. I suggest you will a radar with Apple, if you want to see this feature in the future.
Cheers,
Hendrik

Logging iphone feature usage

Are there any frameworks/services for logging user usage of an iphone application?
Say you want to log events like 'creating a contact' or something similiar, to know how people are actually using your app.
I have used and really like Pinch Media. (Recently renamed to flurry)
http://www.flurry.com
It gives you a bunch of analytics without you having to do anything special.
You can also add hooks to your code to see how often a particular section of code is run and get analytics on that area as well.
Yes, Flurry Analytics does this. You can even pass parameters to your events so you can break down which options are most popular, etc.
What you could do is simply log these messages perhaps as a Log custom class, and whenever you need to add anything to the log, you would simply add a new Log item to the AppDelegate or wherever you need to store the list of Logs. Then you can save them to the file system.
For achieving the logging the feature usage in flurry the url below can be helpful.
http://wiki.flurry.com/index.php?title=Analytics_-_Best_Practices

Automatically returning to the application after dialing the number in iPhone

I'm developing an iPhone re-dialer application in which a number is dialed and if the call is waiting then it will once again redial. But my application is exiting when number is dialed. I don't want that, it should automatically return.
Can somebody help me in solving the problem?
Thanks in Advance.
No, this is not possible. You should save your application state when the call is received, so that the user can pick up where he or she left off in your application, after taking the call.
Create a ‘UIWebView‘ that's hidden and use it load a ‘tel:‘ URL request. It will prompt you to make the call but when the call finishes you'll be returned to your app.
File a bug though to make it proper API though.
The Solution which Ashley suggested works well.
I tried it and the control returns back to the app after call is disconnected.
Also using a webView one can use letter like 1-800-CallUS, etc for dialing.
Declare a webview, create a html file with phone# as a link(this link is automatically detected in your app) and import the file in resources and load the html in a string variable , add this subview to your main view.