I am showing a list of events in a calendar-like display on our website, and would like visitors to be able to click a link/button to add a certain date to their own computer/PDA/phone calendar.
For Outlook and iCal I return an ICS file to the user. For Google Calendar there is a simple URL which does it. I would like to cater for Blackberry users too, but am unsure what format they need, and whether their browser supports such actions.
Googling for answers has confused me as to whether Blackberrys can accept ICS files or need VCS? I have never touched a Blackberry either, so am genera开发者_开发技巧lly very ignorant of all aspects!
Feel free to shout about Android to me too. Thank you.
Seems like you are searching for blackberry.launch.newAppointment().
FTA:
The
newAppointment()
method creates a new appointment in the calendar application. The user must save the appointment before it is saved to the calendar.Syntax
blackberry.launch.newAppointment({ summary, location, allDay, start, end, freeBusy, note })
And regarding user interaction, Just a small clarification (FTA):
The blackberry.launch object provides methods that lets you access core and add-on BlackBerry® applications through JavaScript®. Depending on the application, you can either launch the application or open the application and create a new item, such as a calendar entry or a task, and prepopulate any of the entry fields. Although the methods of the blackberry.launch object can open and create new items for an application, changes are not made to the application without confirmation from the user. For example, if you use the blackberry.launch object to make a phone call to a specific phone number, the user is prompted to confirm whether the user wants to proceed with the call before the number is dialed. Similarly, if you create a new item for any application, the user must save the item before it is added to that application.
Edit: it seems there's a workaround for integrating .ics on blackberry.
You don't need to have those devices to develop for them.
Being so oriented toward mobiles, I think you should definitely get SDK's / official simulators of these devices, and test first hand what works and how.
Blackberry:
http://us.blackberry.com/developers/resources/simulators.jsp
Android:
http://developer.android.com/sdk/index.html
As far as I can tell, BlackBerry just doesn't support an .ics file the way other platforms do. I'm using the BB Storm 9559 (Verizon) emulator to test mobile web pages, and have tried all the .ics options (including the METHOD:REQUEST workaround) to no avail. But the good news is, as mentioned above, a simple client-side JavaScript can be used to create BlackBerry calendar appointments by clicking a link on the mobile web page.
@Rodrigo Hahn's answer above is correct, although you should check the BlackBerry developer docs for a more complete explanation of the syntax. Check here for the official explanation of the blackberry.launch.newAppointment() method: http://docs.blackberry.com/.../blackberry_launch_971534_11.jsp
I've implemented this code myself and it works great on my 9550 emulator. See a working example at http://medcomp.mobi/tradeshows
Hopefully this helps someone! Cheers.
精彩评论