Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.9 release #361

Merged
merged 71 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
29b1900
Updated event model and added timezone support for Android
bhl09 Mar 20, 2020
d58dbc1
[Android] Converts time to corresponding timezone (only for newly cre…
bhl09 Mar 24, 2020
b0cb0f3
Timezone support for Android + original timezone property added
bhl09 Mar 25, 2020
25b27af
Updated timezone functionality and removed original timezone properties
bhl09 Mar 26, 2020
f37c7c3
Added single timezone support for iOS
bhl09 Mar 30, 2020
1ced8a4
Added reminders to constructor
bhl09 Mar 31, 2020
32a4660
Merge pull request #209 from builttoroam/timezone_support
bhl09 Apr 2, 2020
8c70639
flutter format and clean up Android
bhl09 Apr 2, 2020
11aac44
Merge pull request #214 from builttoroam/flutter_format
bhl09 Apr 3, 2020
8035017
update project hierarchy
bhl09 Apr 3, 2020
2a7a9ae
Update remaining items
bhl09 Apr 3, 2020
d7c815b
Merge pull request #215 from builttoroam/project_cleanup
bhl09 Apr 5, 2020
ca46488
Bug fix when adding new calendar.
Pranjal2041 May 28, 2020
5c3c1ec
Allow events to be shown as Busy or Free.
laura-digio Jun 14, 2020
3850ea4
Enable threading (Android) for `retrieveEvents()`
tcd93 Apr 20, 2020
6c42c37
#222 change current methods to non-blocking instead
tcd93 Jun 12, 2020
93596cf
#222 properly handle exception
tcd93 Jun 12, 2020
b72ad54
Merge pull request #237 from builttoroam/develop
nickrandolph Jun 14, 2020
be17fe7
Initial commit
carlosDigio Jun 15, 2020
0e3d1cc
Initial commit
carlosDigio Jun 15, 2020
d9a64ea
Change availability to enum
alvaromarco Jun 15, 2020
ee4284a
Dart fixes
carlosDigio Jun 16, 2020
68b6232
Dart fixes
carlosDigio Jun 16, 2020
8ec17c9
Fix uppercase
alvaromarco Jun 16, 2020
efe50c8
Fix parser
alvaromarco Jun 16, 2020
8468cbf
Clean
alvaromarco Jun 16, 2020
d95550b
WIP
carlosDigio Jun 16, 2020
66ec9ac
iOS fix
carlosDigio Jun 16, 2020
cee102f
Clean commit
carlosDigio Jun 16, 2020
0816a7e
Clean code
carlosDigio Jun 16, 2020
02f1803
Fix parser
alvaromarco Jun 16, 2020
a1b46d6
Fix errors
alvaromarco Jun 17, 2020
5459ea2
_availabilityToText fix
carlosDigio Jun 17, 2020
f693d15
Refactor
alvaromarco Jun 17, 2020
1001ba8
Fix imports
alvaromarco Jun 18, 2020
c75a61a
Ignoring .idea folders
nickrandolph Jun 16, 2020
e097131
Adding .idea and .vs to gitignore
nickrandolph Jun 16, 2020
f61e758
Upgrading gradle
nickrandolph Jun 16, 2020
c9e16bd
Excluding more files via gitignore
nickrandolph Jun 17, 2020
ab0ddee
Applying code formatting
nickrandolph Jun 17, 2020
d226b34
Ignoring .vscode folder
nickrandolph Jun 17, 2020
43a3670
Refactoring dart channel method calls
nickrandolph Jun 17, 2020
2957932
changing ndk to one installed on azure devops
nickrandolph Jun 18, 2020
84ea8a9
reverting ndk version
nickrandolph Jun 18, 2020
4895495
refactor/tidy up
nickrandolph Jun 18, 2020
eee6a2b
Removing remaining string literals
nickrandolph Jun 18, 2020
92fc64c
formatting
nickrandolph Jun 18, 2020
546ea79
Enable threading (Android) for createOrUpdateEvent() (#240)
tcd93 Jun 18, 2020
e74d481
Formatting for event
nickrandolph Jun 18, 2020
c0a775a
Fix for not adding all daysOfWeek on iOS
blehr Jun 18, 2020
fe932a1
If occurrence count is zero send nil
blehr Jun 18, 2020
34cff2d
Merge pull request #245 from builttoroam/develop
nickrandolph Jun 18, 2020
27eeaa3
Removing duplicate code in event.dart
carlosDigio Jun 19, 2020
41077d1
added enable proguard when building release version to README
Plateria Jul 5, 2020
b14d1fd
Merge pull request #253 from Plateria/develop
nickrandolph Jul 5, 2020
094321b
add deleteCalendar() function
Feb 21, 2021
3f8a507
Fixing build number for Android build
nickrandolph Mar 1, 2021
f9e9cde
Adding Build prefix
nickrandolph Mar 1, 2021
3ae3e8d
Updating ndk version to match build agent
nickrandolph Mar 1, 2021
e8df76f
only use Android activity for permissions request
matejdro Dec 9, 2020
8a13748
Adding space to trigger new build
nickrandolph Mar 1, 2021
066d69d
Merge pull request #281 from builttoroam/develop
builttoroamadmin Mar 1, 2021
63fffd6
Force null safety
Mar 23, 2021
b3bcb37
mesh up
Apr 3, 2021
3046303
ndkVersion update
Apr 3, 2021
abd81a5
Improve Proguard rule clarity
thomassth Apr 7, 2021
0342dee
version: 4.0.0
Apr 22, 2021
f34b393
Update README.md
thomassth Apr 22, 2021
3b8318a
Update CHANGELOG.md
thomassth Apr 22, 2021
f65738a
Merge pull request #296 from builttoroam/develop
nickrandolph Apr 24, 2021
7623675
cherrypick workflows, changelog
thomassth Nov 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
38 changes: 38 additions & 0 deletions .github/workflow/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: build

on:
push:
branches: [develop, release, hotfix, master]
pull_request:
branches: [develop, release, hotfix, master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test:
name: Build test
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: dart --version
- run: flutter --version
- run: flutter test
- name: iOS build
run: |
cd example
flutter build ios --release --no-codesign
- name: android build
run: |
cd example
flutter build appbundle
50 changes: 50 additions & 0 deletions .github/workflow/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a basic workflow to help you get started with Actions

name: prerelease

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [release, hotfix]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
prerelease:
name: Development Release
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: dart --version
- run: flutter --version
- name: Edit pubspec.ymal for dev release
run: |
sed -i "s/version.*/&-$GITHUB_RUN_ID/" pubspec.yaml
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2.0.0
- name: Edit changelog.md for dev release
run: |
sed -i "0,/\#\# \[.*/s//## [${{steps.changelog_reader.outputs.version}}-$GITHUB_RUN_ID]/" CHANGELOG.md
cat CHANGELOG.md
- name: Setup credentials
run: |
cat <<EOF > $PUB_CACHE/credentials.json
${{ secrets.CREDENTIALS }}
EOF
- name: Publish package
run: flutter pub publish --force
- name: Add entry to Github release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.changelog_reader.outputs.version }}+${{ github.run_id }}
prerelease: true
42 changes: 42 additions & 0 deletions .github/workflow/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This is a basic workflow to help you get started with Actions

name: release

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the develop branch
push:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: dart --version
- run: flutter --version
- name: Setup credentials
run: |
cat <<EOF > $PUB_CACHE/credentials.json
${{ secrets.CREDENTIALS }}
EOF
- name: Publish package
run: flutter pub publish --force
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2.0.0
- name: Add entry to Github release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ pubspec.lock
# If you don't generate documentation locally you can remove this line.
doc/api/
device_calendar.code-workspace
device_calendar/example/.flutter-plugins-dependencies
device_calendar/example/ios/Flutter/flutter_export_environment.sh
device_calendar/example/ios/Flutter/Flutter.podspec
example/.flutter-plugins-dependencies
example/ios/Flutter/flutter_export_environment.sh
example/ios/Flutter/Flutter.podspec
**/.idea/
**/.vs/
**/.settings
**/.project
**/.classpath
.vscode
54 changes: 33 additions & 21 deletions device_calendar/CHANGELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
# Changelog

## 3.1.0 6th March 2020 - Bug fixes and new features
## [3.9.0]

* Boolean variable `isDefault` added for issue [145](https://github.com/builttoroam/flutter_plugins/issues/145) (**NOTE**: This is not supported Android API 16 or lower, `isDefault` will always be false)
* Events with 'null' title now defaults to 'New Event', issue [126](https://github.com/builttoroam/flutter_plugins/issues/126)
* Updated property summaries for issues [121](https://github.com/builttoroam/flutter_plugins/issues/121) and [122](https://github.com/builttoroam/flutter_plugins/issues/122)
* Updated example documentation for issue [119](https://github.com/builttoroam/flutter_plugins/issues/119)
* Migrated to null safety
* Updated multiple underlying dependencies
* Rebuilt iOS podfile
* Upgraded to new Android plugins APIs for flutter

## 3.2.0

* Added time zone support
* Project hierarchy update and clean up

## 3.1.0 25th March 2020 - Bug fixes and new features

* Boolean variable `isDefault` added for issue [145](https://github.com/builttoroam/device_calendar/issues/145) (**NOTE**: This is not supported Android API 16 or lower, `isDefault` will always be false)
* Events with 'null' title now defaults to 'New Event', issue [126](https://github.com/builttoroam/device_calendar/issues/126)
* Updated property summaries for issues [121](https://github.com/builttoroam/device_calendar/issues/121) and [122](https://github.com/builttoroam/device_calendar/issues/122)
* Updated example documentation for issue [119](https://github.com/builttoroam/device_calendar/issues/119)
* Read-only calendars cannot be edited or deleted for the example app
* Added `DayOfWeekGroup` enum and an extension `getDays` to get corresponding dates of the enum values
* Added to retrieve colour for calendars. Thanks to [nadavfima](https://github.com/nadavfima) for the contribution and PR to add colour support for both Android and iOS
* Added compatibility with a new Flutter plugin for Android. Thanks to the PR submitted by [RohitKumarMishra](https://github.com/RohitKumarMishra)
* [Android] Fixed all day timezone issue [164](https://github.com/builttoroam/flutter_plugins/issues/164)
* Added support for deleting individual or multiple instances of a recurring event for issue [108](https://github.com/builttoroam/flutter_plugins/issues/108)
* Ability to add local calendars with a desired colour for issue [115](https://github.com/builttoroam/flutter_plugins/issues/115)
* Returns account name and type for each calendars for issue [179](https://github.com/builttoroam/flutter_plugins/issues/179)
* [Android] Fixed all day timezone issue [164](https://github.com/builttoroam/device_calendar/issues/164)
* Added support for deleting individual or multiple instances of a recurring event for issue [108](https://github.com/builttoroam/device_calendar/issues/108)
* Ability to add local calendars with a desired colour for issue [115](https://github.com/builttoroam/device_calendar/issues/115)
* Returns account name and type for each calendars for issue [179](https://github.com/builttoroam/device_calendar/issues/179)

## 3.0.0+3 3rd February 2020

* Fixed all day conditional check for issue [162](https://github.com/builttoroam/flutter_plugins/issues/162)
* Fixed all day conditional check for issue [162](https://github.com/builttoroam/device_calendar/issues/162)

## 3.0.0+2 30th January 2020

* Updated `event.allDay` property in `createOrUpdateEvent` method to be null-aware

## 3.0.0+1 28th January 2020

* Updated `event.url` property in `createOrUpdateEvent` method to be null-aware for issue [152](https://github.com/builttoroam/flutter_plugins/issues/152)
* Updated `event.url` property in `createOrUpdateEvent` method to be null-aware for issue [152](https://github.com/builttoroam/device_calendar/issues/152)

## 3.0.0 21st January 2020

Expand All @@ -50,7 +62,7 @@
## 1.0.0+3 9th January 2020

* Flutter upgrade to 1.12.13
* Added an URL input for calendar events for issue [132](https://github.com/builttoroam/flutter_plugins/issues/132)
* Added an URL input for calendar events for issue [132](https://github.com/builttoroam/device_calendar/issues/132)

## 1.0.0+2 30th August 2019

Expand All @@ -62,11 +74,11 @@

## 1.0.0 28th August 2019

* **BREAKING CHANGE** `retrieveCalendars` and `retrieveEvents` now return lists that cannot be modified (`UnmodifiableListView`) to address part of issue [113](https://github.com/builttoroam/flutter_plugins/issues/113)
* **BREAKING CHANGE** `retrieveCalendars` and `retrieveEvents` now return lists that cannot be modified (`UnmodifiableListView`) to address part of issue [113](https://github.com/builttoroam/device_calendar/issues/113)
* Support for more advanced recurrence rules
* Update README to include information about using ProGuard for issue [99](https://github.com/builttoroam/flutter_plugins/issues/99)
* Made event title optional to fix issue [72](https://github.com/builttoroam/flutter_plugins/issues/72)
* Return information about the organiser of the event as per issue [73](https://github.com/builttoroam/flutter_plugins/issues/73)
* Update README to include information about using ProGuard for issue [99](https://github.com/builttoroam/device_calendar/issues/99)
* Made event title optional to fix issue [72](https://github.com/builttoroam/device_calendar/issues/72)
* Return information about the organiser of the event as per issue [73](https://github.com/builttoroam/device_calendar/issues/73)
* Return attendance status of attendees and if they're required for an event. These are details are different across iOS and Android and so are returned within platform-specific objects
* Ability to modify attendees for an event
* Ability to create reminders for events expressed in minutes before the event starts
Expand All @@ -81,7 +93,7 @@

## 0.2.1 5th August 2019

* [Android] Fixes issue [101](https://github.com/builttoroam/flutter_plugins/issues/101) where plugin results in a crash with headless execution
* [Android] Fixes issue [101](https://github.com/builttoroam/device_calendar/issues/101) where plugin results in a crash with headless execution

## 0.2.0 30th July 2019

Expand All @@ -91,7 +103,7 @@

## 0.1.3 5th July 2019

* [iOS] Fixes issue [94](https://github.com/builttoroam/flutter_plugins/issues/94) that occurred on 32-bit iOS devices around date of events. Thanks to the PR submitted by [duzenko](https://github.com/duzenko)
* [iOS] Fixes issue [94](https://github.com/builttoroam/device_calendar/issues/94) that occurred on 32-bit iOS devices around date of events. Thanks to the PR submitted by [duzenko](https://github.com/duzenko)

## 0.1.2+2 28th May 2019

Expand All @@ -104,11 +116,11 @@

## 0.1.2 - 16th May 2019

* [Android] An updated fix to address issue [79](https://github.com/builttoroam/flutter_plugins/issues/79), thanks to the PR submitted by [Gerry High](https://github.com/gerryhigh)
* [Android] An updated fix to address issue [79](https://github.com/builttoroam/device_calendar/issues/79), thanks to the PR submitted by [Gerry High](https://github.com/gerryhigh)

## 0.1.1 - 1st March 2019

* Fixed issue [79](https://github.com/builttoroam/flutter_plugins/issues/79) where on Android, the plugin was indicating that it was handling permissions that it shouldn't have
* Fixed issue [79](https://github.com/builttoroam/device_calendar/issues/79) where on Android, the plugin was indicating that it was handling permissions that it shouldn't have

## 0.1.0 - 26th February 2019

Expand All @@ -122,7 +134,7 @@

## 0.0.7 - 16th November 2018

* Fixes issue [##67](https://github.com/builttoroam/flutter_plugins/issues/67) and [##68](https://github.com/builttoroam/flutter_plugins/issues/68). Thanks to PR submitted by huzhiren.
* Fixes issue [##67](https://github.com/builttoroam/device_calendar/issues/67) and [##68](https://github.com/builttoroam/device_calendar/issues/68). Thanks to PR submitted by huzhiren.

## 0.0.6 - 18th June 2018

Expand Down
File renamed without changes.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Device Calendar Plugin

[![pub package](https://img.shields.io/pub/v/device_calendar.svg)](https://pub.dartlang.org/packages/device_calendar) [![Build Status](https://dev.azure.com/builttoroam/Flutter%20Plugins/_apis/build/status/Device%20Calendar)](https://dev.azure.com/builttoroam/Flutter%20Plugins/_build/latest?definitionId=111)

A cross platform plugin for modifying calendars on the user's device.

## Features

* Request permissions to modify calendars on the user's device
* Check if permissions to modify the calendars on the user's device have been granted
* Add or retrieve calendars on the user's device
* Retrieve events associated with a calendar
* Add, update or delete events from a calendar
* Set up, edit or delete recurring events
* **NOTE**: Editing a recurring event will currently edit all instances of it
* **NOTE**: Deleting multiple instances in **Android** takes time to update, you'll see the changes after a few seconds
* Add, modify or remove attendees and receive if an attendee is an organiser for an event
* Setup reminders for an event
* Specify a time zone for event start and end date
* **NOTE**: Due to a limitation of iOS API, single time zone property is used for iOS (`event.startTimeZone`)
* **NOTE**: For the time zone list, please refer to the `TZ database name` column on [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
* **NOTE**: If the time zone values are null or invalid, it will be defaulted to the device's current time zone.

## Null migration

From v4.0.0, device_calendar fits null safety. However, not all workflow had been checked and bugs from 3.2 still presists.

You are strongly advised to test your workflow with the new package before shipping.
Better yet, please leave a note for what works and what doesn't, or contribute some bug fixes!

## Android Integration

The following will need to be added to the manifest file for your application to indicate permissions to modify calendars a needed

```xml
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
```
### Proguard / R8 exceptions
By default, all android apps go through R8 for file shrinking when building a release version. Currently, it interferes with some functions such as `retrieveCalendars()`.

You may add the following setting to the ProGuard rules file (thanks to [Britannio Jarrett](https://github.com/britannio)). Read more about the issue [here](https://github.com/builttoroam/device_calendar/issues/99)

```
-keep class com.builttoroam.devicecalendar.** { *; }
```

See [here](https://github.com/builttoroam/device_calendar/issues/99#issuecomment-612449677) for an example setup.

For more information, refer to the guide at [Android Developer](https://developer.android.com/studio/build/shrink-code#keep-code)

### AndroidX migration
**IMPORTANT**: Since version 0.1.0, this version has migrated to use AndroidX instead of the deprecated Android support libraries. When using version 0.10.0 and onwards for this plugin, please ensure your application has been migrated following the guide [here](https://developer.android.com/jetpack/androidx/migrate)

## iOS Integration

For iOS 10 support, you'll need to modify the Info.plist to add the following key/value pair

```xml
<key>NSCalendarsUsageDescription</key>
<string>INSERT_REASON_HERE</string>
```

Note that on iOS, this is a Swift plugin. There is a known issue being tracked [here](https://github.com/flutter/flutter/issues/16049) by the Flutter team, where adding a plugin developed in Swift to an Objective-C project causes problems. If you run into such issues, please look at the suggested workarounds there.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 29

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -44,4 +44,5 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
api 'androidx.appcompat:appcompat:1.0.2'
implementation 'org.dmfs:lib-recur:0.11.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.builttoroam.devicecalendar

import com.builttoroam.devicecalendar.models.Availability
import com.google.gson.*
import java.lang.reflect.Type

class AvailabilitySerializer: JsonSerializer<Availability> {
override fun serialize(src: Availability?, typeOfSrc: Type?, context: JsonSerializationContext?): JsonElement {
if(src != null) {
return JsonPrimitive(src.name)
}
return JsonObject()
}
}
Loading