GithubHelp home page GithubHelp logo

mpociot / tieventkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nyvra/tieventkit

5.0 3.0 0.0 288 KB

Titanium Appcelerator module that implements iOS Event Kit framework

License: Other

JavaScript 3.20% Objective-C 39.39% Python 57.41%

tieventkit's Introduction

TiEventKit

Titanium Appcelerator module that implements iOS Event Kit framework.

Supports

  • iOS 4.0+
  • Titanium SDK 2.1.3.GA

What can I do with this module?

For moment, you can create Events in user default calendar. In iOS 6, the user will be asked by permissions to access her calendar. In iOS 5, you don't need user permissions.

Each event have this attributes:

  • title (STRING)
  • location (STRING)
  • notes (STRING)
  • begin (DATE)
  • end (DATE)
  • allDay (BOOL)

NOTE: The date format is: "yyyy-MM-dd hh:mm:ss Z".

Creating an Event

For compatibilty, you first need to ask authorization by user before create an Event. If user have granted the permission to access her Calendar, it will always return TRUE in event callback method. So, here is a simple usage of method:

var EK = require("ti.eventkit");

// Request authorization to user
EK.requestAuthorization(function(e) {

	// If user have authorized this application…
	if (e.authorized == true) {
	
		// Create the Event
		EK.createCalendarEvent({
			title: "Codestrong",
			notes: "We will hack a lot.",
			location: "San Francisco",
			begin: "2012-10-21 08:00:00 GMT",
			end: "2012-10-23 18:00:00 GMT"
		});

		Ti.UI.createAlertDialog({
			title: "Calendar",
			message: "This event will be AWESOME!",
			buttonNames: ["YEAH!", "OK"]
		}).show();
		
	} else {
		Ti.UI.createAlertDialog({
			title: "Calendar",
			message: "You have to allow this application to access your Calendar",
			buttonNames: ["OK"]
		}).show();
	}
});

Future supports

  1. Reminders support.
  2. Create a method to verify if application is allowed to access the Calendar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.