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

Not able to add calendar event to google pixel phones. #168

Closed
ssivagnanam opened this issue Feb 12, 2020 · 14 comments
Closed

Not able to add calendar event to google pixel phones. #168

ssivagnanam opened this issue Feb 12, 2020 · 14 comments
Assignees
Labels
question Further information is requested

Comments

@ssivagnanam
Copy link

I am trying to add calendar event to google pixel phone. But i am not able to add it and i couldn't find Default calendar (My Calendar) in calendar app also.
Is there any thing i need to setup in my app to work with google pixel phones?

one more issue is like, i am not able to set "Timezone" while creating event.

@bhl09
Copy link
Contributor

bhl09 commented Feb 12, 2020

Maybe it could be a permission issue, check out the readme file here.
You also might want to check out the example app to see examples of the api.

Timezone is not available for this api yet, it will just use the device's timezone. (Note: creating an all day event for Android have a timezone issue right now: #164)

@ssivagnanam
Copy link
Author

Hi,
I am able to create event in calendar of Other phones (like Samsung, Redmi, etc.,). This issue occurs only Google Pixel phones.

I am trying to create event in Australian time zone. But in calendar, start and end time is showing in GMT timezone. Please refer the screen shot.

Screenshot_20200212-111657_Calendar

@bhl09
Copy link
Contributor

bhl09 commented Feb 13, 2020

Which device and email account are you using? I've been testing with Pixel 3a with Gmail and Outlook and haven't experienced any of event or timezone issues.

The plugin should pick up the device's timezone and use it, I'd assume you have set the device timezone as Australia, not GMT right?

@ssivagnanam
Copy link
Author

ssivagnanam commented Feb 14, 2020

I have tried setting default time zone as AET(Australian). But still i am getting time zone as default GMT.

Could you please share any example code snippet to create calendar events with timezone in android.

@bhl09
Copy link
Contributor

bhl09 commented Feb 17, 2020

If you were able to create a calender event through other devices, you should have the code to create a new event already. But briefly, you just need to call the method createOrUpdateEvent(Event event) to create a new event.

Are you able to provide which exact device and email account used? I'd like to test with it to see if I can reproduce this.

@ssivagnanam
Copy link
Author

ssivagnanam commented Feb 18, 2020

I am using Samsung S7 Edge. With default calendar of Calendar app. I want to create event in "My Calendar" Calendar. I am getting GMT as default time zone. But i have selected my time zone as AST in DateTime under settings.

For Pixel phone issue, I am trying to create event in Pixel 2 phone.
Note: in this device, we don't have "My Calendar". so i am using my personal mail id.

Note : I have observed that retrieveCalendars() is returning a list with 3 objects. But those objects property values are null.

@ssivagnanam
Copy link
Author

Hi, I have observed that
var calendarsJson = await channel.invokeMethod('retrieveCalendars');
above line of code is returning below json string as result.
[{"a":true,"b":"2","c":"Holidays in India"},{"a":true,"b":"3","c":"Birthdays"},{"a":false,"b":"4","c":"[email protected]"}]
But in Calendar model, is creating object using wrong keys

Calendar.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
isReadOnly = json['isReadOnly'];
}

Could you please check this at your end once?
Please let me know if any changes are required from my end.

@bhl09
Copy link
Contributor

bhl09 commented Feb 23, 2020

I've tried using Pixel 2 with my personal gmail and I do get the correct json results.
Maybe have to look at the readme if you have the correct permissions and Proguard configs set correctly.

For the timezone issue, the below code is ran to get current timezone for the device:
val currentTimeZone: TimeZone = java.util.Calendar.getInstance().timeZone
Maybe try running the code have a look at the result in the affected device.

@ssivagnanam
Copy link
Author

Thanks for your support. I am able to create events in all devices after enabling proguard settings as mentioned in readme.
But still i am not able to get current timezone in created events (still event is points to UTC timezone). This issue occurs only in samsung devices.
Is there any settings i need to do in Calendar app to set the default timezone?

@bhl09
Copy link
Contributor

bhl09 commented Mar 4, 2020

I'll try it out with a Samsung phone to see what I get and get back to you. Meanwhile maybe trying out changing a timezone to something else and reverting it back to what it was?

@bhl09 bhl09 self-assigned this Mar 4, 2020
@bhl09 bhl09 added the question Further information is requested label Mar 4, 2020
@bhl09
Copy link
Contributor

bhl09 commented Mar 4, 2020

@ssivagnanam I've had a good look with Samsung Galaxy S6. Here's what I found:

  • The phone correctly gets the current timezone and set it - I'm in Australia so I get/set AEST
  • When I look into the event details, for my case, there's no timezone set to the event, but the time seems like set as GMT timezone just like you're having
    • But when I look at the event in montly calendar view, it displays the event correctly in AEST
  • This issue only occurs when you create an event with 'My Phone' - 'My calendars' calendar - Samsung's default calendar

From this, it seems like Samsung's default calendars are little different from Android calendars, I would recommend to add an account (eg. Google) and adding events to that account instead of adding to the Samsung's default calendars.

@ssivagnanam
Copy link
Author

Yeah. Thanks for an Update. Please keep me posted if any updates on this request.

@bhl09
Copy link
Contributor

bhl09 commented Mar 6, 2020

I'm going to close this for now, will let you know if I get a chance to add timezone support to the plugin.

@bhl09 bhl09 closed this as completed Mar 6, 2020
@bhl09
Copy link
Contributor

bhl09 commented Mar 11, 2020

@ssivagnanam just an update with the Samsung phone issue, as from #182, I was able to get the current timezone for the local calendar when I use id instead of displayName. I'll apply this in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants