Programmatically add event in iPhone/Android Calendar with PhoneGap/jQuery Mobile?

前端 未结 5 1202
感情败类
感情败类 2021-02-01 04:24

How can I create a calendar event from a JavaScript / jQuery Mobile / PhoneGap app in iOS/Android?

Are there any, e.g., PhoneGap plugins? Didn\'t see any in the official

5条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 05:11

    I found plugins for Android and iOS but they do not have the same JavaScript API so you have to write different code for both systems or add another layer. Also they are not up to date and will need fixes to run with Cordova 2.2.0. To make things worse documentation is kind of short:

    Android

    Dcheng's Android Plugin is able to create, remove and search calender events but is totally outdated and will not work as it is. With Android 4.0 there is a Calendar Provider that makes things easier but still I did not find a good plugin. jbajor can only add events and twistandshout only search events.

    iOS

    Felixactv8's iOS Plugin is able to create, remove and search calender events. Notice that in iOS there is no event id, so searching your events will be fun. The author explains how to add the two needed frameworks in xcode:

    the iphone calendar uses the 2 frameworks, EventKit.framework and EventKitUI.framework.

    if you click on the xcode icon, you should see the project icon and the target icon. click on the target icon, then click build phases. Click the dropdown for "Link Binary with libraries. Click the plus sign at the bottom of the window, then search for both frameworks. Add both of those frameworks, rebuild the project and run it.

提交回复
热议问题