How to add Events in iPhone calendar application using our iphone application. - iphone

How to add Event in iPhone Calendar. I just want to add events in iPhone calendar using my application and wants to set pushnotification for perticuler event. Please help me out on this. Thank you.

To create an Event programmatically, you would use EventKit, more specifically the provided EKEventEditViewController. See the Apple documentation for an explanation and sample code.
In iOS 4.0+, you would also be able to access that controller without writing any EventKit code. To do that, use a UITextView configured with dataDetectorTypes = UIDataDetectorTypeCalendarEvent. The UITextView will automatically convert strings representing formatted dates, days of the week, etc. - to clickable URLs that handle the creation of events.
Please refer to the Apple iOS documentation for the rest of your question. If there is anything specific that doesn't work in your case, please post some code, show us what you have tried already, etc.

you can use this code
EKEventStore *es = [[EKEventStore alloc] init];
EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
controller.eventStore = es;
controller.editViewDelegate = self;
[self presentModalViewController:controller animated:YES];
[controller release];

Related

Sending sms from phonegap in iphone?

Is it possible to send sms using phonegap in iphone??If yes can anybody suggest me sample code or tutorials to do so???
Is it possible to find out user's phone number using phonegap in iphone??If yes can anybody suggest me sample code or tutorials to do so???
If you want to send sms via phone first you should create a plugin(see phonegap website to see how its done) then in plugin code(it should be native code do it like this :
You must add MessageUI.framework to your Xcode project and include a #import <MessageUI/MessageUI.h> in your header file.
Add these delegates to your header file MFMessageComposeViewControllerDelegate & UINavigationControllerDelegate.
In your IBAction method declare instance of MFMessageComposeViewController say messageInstance to check whether your device can send text use [MFMessageComposeViewController canSendText] in if condition, it'll return Yes/No in the if condition do these:
MFMessageComposeViewController *messageInstance = [[[MFMessageComposeViewController alloc] init] autorelease];
// set body for your messageInstance
messageInstance.body = #"Hello from Shah";
// then decide the recipients for the message as:
messageInstance.recipients = [NSArray arrayWithObjects:#"12345678", #"87654321", nil];
//Set a delegate to your messageInstance as:
messageInstance.messageComposeDelegate = self;
// Then present the messageViewController
[self messageInstance animated:YES];

How to develop a SMS client for iOS?

my original title was How to customize TTMessageController for SMS transmission?. I changed this now because I look for any possible solution and not only those with TTMessageController.
Well, I am working on an simple application in xcode4. The user should be able to send SMS from different SMS gateways.
The background logic is quite simple because everything is managed by executing some http requests on an rest api.
The hard thing for me now is to setup the UI and that is where I need help because I am new to iOS development. This is how I want it to be:
http://img222.imageshack.us/img222/3159/bhrfe.png
There should be a recipient picker to either do autosearch on contacts or to directly pick a contact from the contact list. Beside I want only one recipient. And there should be a text area.
I also want to have a label somewhere at the bottom to show the current char number.
Since I did not find those UI elements in xcode4 library I searched for something similar and I found the TTMessageController which gives me the view you see in the picture.
However plus button does not work and I am not sure how to extend all this to do what I want.
I appreciate any idea on this.
For the + Button you can use the address book UI:
// This Code is taken from Apple's sample code QuickContacts
#import <AddressBookUI/AddressBookUI.h>
-(void)showPeoplePickerController {
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
// Display only a person's phone, email, and birthdate
NSArray *displayedItems = [NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonPhoneProperty]];
picker.displayedProperties = displayedItems;
// Show the picker
[self presentModalViewController:picker animated:YES];
[picker release];
}
The <ABPeoplePickerNavigationControllerDelegate> delegate include this methods:
– peoplePickerNavigationController:shouldContinueAfterSelectingPerson:
– peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:
– peoplePickerNavigationControllerDidCancel:
After selecting a person you can save his/her number in an array and in the text field (e.g. comma separated)
.
For the question if it will be approved here is the guideline:
https://developer.apple.com/appstore/resources/approval/guidelines.html
22.6 Apps that enable anonymous or prank phone calls or SMS/MMS messaging will be rejected
You can't use TTMessageController to send sms. The only possible way to send sms is to use MFMessageComposeViewController. Here's a tutorial on how to use it: http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/

How to use Tapku library for iPhone?

I just found the Tapku library and would love to use the calendar, but am clueless as to where to start since I am new to iPhone dev. How do I go about presenting the calendar in one of my views?
TKCalendarMonthView *calendar1=[[TKCalendarMonthView alloc] init];
calendar1.delegate = self;
calendar1.dataSource = self;
[calendar1 selectDate:[NSDate date]];
[self.view addSubview:calendar1];
Add this in the .m file where you want to display.
have you looked in the demo project included in the library? i believe it has an example that would be very useful to you, and also, here is the developer documentation gitHub docs that includes the calendar class structure.

iOS4 ABNewPersonViewController Loses Data Entered when attempting to add a Photo iPhone 4

I have implemented a basic add contact feature to an iOS 4 application. Following the documentation from Apple, I have created a navigation controller, and set its root view to the ABNewPersonViewController. I have implemented the delegate as well. The basic mechanics all work.
The problem I am having is when you add a photo to the new person that is very large (taking a photo or picking one from the library), the ABNewPersonViewController form returns empty when the camera controls are dismissed. No photo is in the add photo box either. If I pick a small image (say a screenshot from the iPhone), everything works. I can see from the debug output: Received memory warning. Level=1
Has anyone else run into this? Is there a way to set the photo quality to a lower setting for the ABNewPersonViewController? Any help appreciated.
ABNewPersonViewController *abNewPersonView = [[ABNewPersonViewController alloc] init];
abNewPersonView.newPersonViewDelegate = self;
UINavigationController *newNavigationController = [UINavigationController alloc];
[newNavigationController initWithRootViewController:abNewPersonView];
[self presentModalViewController:newNavigationController animated:YES];
[abNewPersonView release];
[newNavigationController release];
If ABNewPersonViewController does not handle memory warnings correctly, file a bug with apple.

How to add refresh button to iPhone RSS Reader app?

I'm playing around with this application I got on last months Web Designer that's a very basic RSS reader. I would like to add a refresh button to the top navigation bar that refreshes all the content in the table but can't seem to work out how to do it. I've worked out it must somehow use the [tablename Reload] function, but have got no idea how to implement it.
I'm new to all this so simple instructions are good instructions :) I know how to add the button, its linking it to and defining the actions when the user clicks it that I'm struggling with.
You can grab the code here http://www.webdesignermag.co.uk/tutorial-files/issue-162-tutorial-files/ under iPhone Apps (it's the only one).
This is what you need to do in the RootViewController.m:
In the viewDidLoad function, add a button of type UIBarButtonSystemItemRefresh, associate to it an Action and a Target, (infact, as Alan told you, you need to learn about Outlets and Actions)
UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:#selector(refreshTable)];
self.navigationItem.rightBarButtonItem = refreshButton;
Implement refreshTable function (if not declared in .h, have to put it above viewDidLoad())
- (void)refreshTable{
[rssParser release];
rssParser = [[RSSXMLParser alloc] init];
[rssParser parseRSSFeed];
[self.tableView reloadData];
NSLog(#"table is refreshing ....");
}
Hi Graeme and velcome to SO.
For the iphone UI, you have to define outlets and actions, and use Interface Builder to link them together.
This page has some information that should hopefully get you started.
Understanding Outlets and Actions