Software Archive
Read-only legacy content
17061 Discusiones

Add Calendar event from my app

nermeen_m_
Principiante
2.669 Vistas

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 Solución
John_H_Intel2
Empleados
2.669 Vistas

Heres a sample that works on iOS and Android.

Ver la solución en mensaje original publicado

16 Respuestas
Diego_Calp
Colaborador Valioso I
2.669 Vistas

Hi,

 

You need a Cordova plugin like this:

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

There are some Javascript examples.

Regards

Diego

Anusha_M_Intel1
Empleados
2.669 Vistas

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. 

Amrita_C_Intel
Empleados
2.669 Vistas

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

Kevin_L_3
Principiante
2.669 Vistas

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

Amrita_C_Intel
Empleados
2.669 Vistas

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

Kevin_L_3
Principiante
2.669 Vistas

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?

nermeen_m_
Principiante
2.669 Vistas

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

nermeen_m_
Principiante
2.669 Vistas

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

John_H_Intel2
Empleados
2.669 Vistas

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

John_H_Intel2
Empleados
2.670 Vistas

Heres a sample that works on iOS and Android.

nermeen_m_
Principiante
2.669 Vistas

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.

nermeen_m_
Principiante
2.669 Vistas

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

John_H_Intel2
Empleados
2.669 Vistas

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.

nermeen_m_
Principiante
2.669 Vistas

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

John_H_Intel2
Empleados
2.669 Vistas

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.

elie_r_
Principiante
2.669 Vistas

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

 

would you please help me with this request,

Responder