Software Archive
Read-only legacy content
17061 ディスカッション

Add Calendar event from my app

nermeen_m_
ビギナー
2,631件の閲覧回数

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 件の賞賛
1 解決策
John_H_Intel2
従業員
2,631件の閲覧回数

Heres a sample that works on iOS and Android.

元の投稿で解決策を見る

16 返答(返信)
Diego_Calp
高評価コントリビューター I
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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
ビギナー
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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

Kevin_L_3
ビギナー
2,631件の閲覧回数

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_
ビギナー
2,631件の閲覧回数

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_
ビギナー
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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
従業員
2,632件の閲覧回数

Heres a sample that works on iOS and Android.

nermeen_m_
ビギナー
2,631件の閲覧回数

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_
ビギナー
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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_
ビギナー
2,631件の閲覧回数

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
従業員
2,631件の閲覧回数

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_
ビギナー
2,631件の閲覧回数

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

 

would you please help me with this request,

返信