Software Archive
Read-only legacy content

Add Calendar event from my app

nermeen_m_
Beginner
811 Views

Hi all,

I made an application in XDK using HTML5, in this app there are many presentations indifferent dates and different time. What I want to do, is when the user click on one of these presentations, the app add an event on the calendar with the presentation date and time.

How can I do this on the XDK??

Thanks

0 Kudos
1 Solution
John_H_Intel2
Employee
811 Views

Heres a sample that works on iOS and Android.

View solution in original post

0 Kudos
16 Replies
Diego_Calp
Valued Contributor I
811 Views

Hi,

 

You need a Cordova plugin like this:

https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin

There are some Javascript examples.

Regards

Diego

0 Kudos
Anusha_M_Intel1
Employee
811 Views

You will have to use a plugin as suggested by Diego.

But before you can do that, you need to make your app a Cordova app. 

Go to the Project tab -> Under Project Info -> In the first row click on the Cordova icon under 'Upgrade'. 

This will update your app from HTML5 to Cordova. After this, you will get new options in your projects tab like the plugin manager where you can add the calendar plugin. 

0 Kudos
Amrita_C_Intel
Employee
811 Views

As suggested by Anusha adding on to it please see this documentation which shows how to add third party plugin:

 https://software.intel.com/en-us/xdk/docs/add-manage-project-plugins

0 Kudos
Kevin_L_3
Beginner
811 Views

Hi - my understanding (and experience at the moment) is that the Calendar add-in is not working on CLI 5.1.1. builds. See this post: https://software.intel.com/en-us/forums/intel-xdk/topic/606793

0 Kudos
Amrita_C_Intel
Employee
811 Views

Can you try using lower version of plugin? Some new plugins are with gradle script so having some security related issue.

0 Kudos
Kevin_L_3
Beginner
811 Views

Hi - I've tried 4.6, 4.4. to 4.2 with no success. And this is affecting both Android and iOS builds. Gradle builds only affect Android right?

0 Kudos
nermeen_m_
Beginner
811 Views

I have tried adding cordova-plugin-calendar  and I also downgrade the plugin version, but in the Emulator, I have the attached message.

When I test it on my mobile, I have nothing, no errors , no success messages, no fail message, and no events is added to the calendar also

I don't know what is the problem

Thanks

0 Kudos
nermeen_m_
Beginner
811 Views

I built the app and I had no errors, when I tried to install it on my mobile, it asked for permissions to access calendar and I accepted.

But when I click on the button to add a calendar event, nothing happens and no event is added

I attached the message appeared on my mobile which asking for permissions

0 Kudos
John_H_Intel2
Employee
811 Views

It appears the plugin is being added correctly. You should check the documentation of the plugin and see if you are calling it correctly.

0 Kudos
John_H_Intel2
Employee
812 Views

Heres a sample that works on iOS and Android.

0 Kudos
nermeen_m_
Beginner
811 Views

thanks all,

there was error on the code under the button.

thank you very much for the quick help,from my pleasure to join this forum.

0 Kudos
nermeen_m_
Beginner
811 Views

I used the calendar and it is good

but, I have an agenda (programme) which contains many session, when the user click on one of these sessions, it will be added automatically in the calendar and check attend button.

when the user exit the agenda and enter again I need to check the attend button of the sessions in the calendar(I tried findEvent function in the calendar but it is not working)

this app is available now in the store for test its name is Africa smartGrid2016

thanks in advance

0 Kudos
John_H_Intel2
Employee
811 Views

Nermeen ~

This is a functionality of the plugin itself. You should refer to the documentation of the plugin for assistance on using the findEvent function.

0 Kudos
nermeen_m_
Beginner
811 Views

I already used the plugin and it is working in the create and in the delete but when I tired to use the findevent and take a result to make action, nothing happens

                var startDate = new Date(2016,2,5,9,00,0,0,0); 
                var endDate = new Date(2016,2,5,16,00,0,0,0);
               var title = "Meetings of AFSEC Technical committees";
               var eventLocation = "INTERCONTINENTAL CAIRO SEMIRAMIS";
               var notes = "by invitation only";
       
                 $cordovaCalendar.findEvent({
                     title: 'Meetings of AFSEC Technical committees',
                     location: 'INTERCONTINENTAL CAIRO SEMIRAMIS',
                     notes: 'by invitation only',
                     startDate: startDate,
                     endDate: endDate
                 }).then(function (result) {
                     console.log('results', JSON.stringify(result, null, '\t'));
                      $('#toggle1').prop("checked", true);
                 }, function (err) {
                     console.error('err', err);
                      $('#toggle1').prop("checked", false);
                 });

please I need help to this issue, why my code is not working, and iam in a hurry as the conference will be held on 5th of March 2016

thanks in advance

0 Kudos
John_H_Intel2
Employee
811 Views

This adds an event, finds the event, and deletes the event. Works fine on iOS, didnt test on android, but I imagine it works there as well.

0 Kudos
elie_r_
Beginner
811 Views

Hi. i want to add an event calendar on my xdk application,

 

would you please help me with this request,

0 Kudos
Reply