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

Proper return values #150

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Proper return values #150

wants to merge 3 commits into from

Conversation

pikaju
Copy link

@pikaju pikaju commented Dec 11, 2023

Previously, the Futures returned by this package either never completed at all or completed instantly, which made them effectively useless. This PR adds an enum return type with values success when the user created the calendar event, canceled when they aborted the creation, and permissionDenied when the lack of permission prevented the event creation. The returned Future only completes after the process is done.

@GChanathip
Copy link

GChanathip commented Jan 9, 2024

seems like this one was broken on iOS 14.
I got stuck on add new event UI.

@sperochon
Copy link

Hi everybody, would it be possible to merge this please?

@diegogarciar
Copy link
Collaborator

Thanks for the PR @pikaju, and thanks for the reminder @sperochon !

Working great for iOS, tested on iOS simulator

I however tested on an Android physical device and I'm getting an immediate result with value "cancelled"

@vbuberen
Copy link

vbuberen commented Feb 5, 2024

I however tested on an Android physical device and I'm getting an immediate result with value "cancelled"

Yes, in the current implementation the result won't work, because Intent.FLAG_ACTIVITY_NEW_TASK can't be used when startActivityForResult is used: https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK

https://github.com/ja2375/add_2_calendar/pull/150/files#diff-3c1397a073b40d30a899803f31f87740dd6769f3ad3c8c1f494595d4dfa09a3dR121

So I am curios how the author of this PR tested changes on Android.

Additionally, one more issue with implementation, even if we remove this intent flag is that when user uses Google Calendar app after adding an event user ends up on a home screen of the Google Calendar app and needs to use back (with either a swipe or click on the corresponding button), thus would still get Activity.RESULT_CANCELED in the onActivityResult()

@michaeljajou
Copy link

Can we get this merged? What's the status

@gazialankus
Copy link

@ja2375 could you have a look when you can please? It seems this PR is needed.

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

Successfully merging this pull request may close these issues.

8 participants