google-tasks-api

How to return failed task result in continuation task?

↘锁芯ラ 提交于 2021-02-05 09:36:13
问题 I am using Google's Task API in Kotlin and am faced with the next situation: ... val deleteTask = getItem(id)?.continueWithTask { task -> if (task.isSuccessful) task.result?.toObject(ItemModel::class.java)?.let { deleteFiles(it.media) } } deleteTask?.continueWithTask { task -> if (task.isSuccessful) doSomething() } ?: doSomething() ... Where getItem(id) returns the Firebase.firestore get task ( Task<DocumentSnapshot>? ) and deleteFiles(it.media) retuens the Firebase.storage delete task ( Task

How to return failed task result in continuation task [duplicate]

霸气de小男生 提交于 2021-01-29 15:06:27
问题 This question already has an answer here : How to return failed task result in continuation task? (1 answer) Closed 9 days ago . I'm writing my first app in Kotlin and am using Firestore & Firebase Storage. In the process of deleting a document, I want to delete all files in Storage that the document references (as it is the only reference to them in my case). If the Storage delete fails, I want to abort the document delete, in order to avoid orphan files in my Storage. I also want to do

NullPointerException only after I have setServiceAccountUser() for GoogleCredential object (Grails/Java)

安稳与你 提交于 2020-01-01 09:28:25
问题 I receive a NullPointerException with very little detail when I attempt to setServiceAccountUser(ACCOUNT_TO_IMPERSONATE) on my GoogleCredential , build a Google Tasks Service Object and subsequently try to send a request for a list of Tasks from ACCOUNT_TO_IMPERSONATE . def credential = new GoogleCredential.Builder() .setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(SERVICE_ACCOUNT_ID) .setServiceAccountPrivateKeyFromP12File(P12_FILE) .setServiceAccountScopes

NullPointerException only after I have setServiceAccountUser() for GoogleCredential object (Grails/Java)

♀尐吖头ヾ 提交于 2020-01-01 09:28:04
问题 I receive a NullPointerException with very little detail when I attempt to setServiceAccountUser(ACCOUNT_TO_IMPERSONATE) on my GoogleCredential , build a Google Tasks Service Object and subsequently try to send a request for a list of Tasks from ACCOUNT_TO_IMPERSONATE . def credential = new GoogleCredential.Builder() .setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(SERVICE_ACCOUNT_ID) .setServiceAccountPrivateKeyFromP12File(P12_FILE) .setServiceAccountScopes

Setting id to task using Google Task API returns 400 invalid value

自古美人都是妖i 提交于 2019-12-25 08:59:43
问题 I am using Google's Java API for an project. Strangely, inserting a task without setting an id works fine. However, inserting a task with a id returns a 400 invalid value error. The id is to be used for syncing local data with Google Tasks I'm pretty sure there's nothing wrong with the algorithm that generates the ids for the task. The same algorithm works perfectly for Google Calendar API. Am I missing something here? 回答1: You may refer with this SO answer. It suggested to pass the id key

Google Tasks API does not give update about Task completion when New Gmail Theme used

北慕城南 提交于 2019-12-23 12:52:16
问题 First I created a Task using below link: https://mail.google.com/tasks/canvas Then I marked it as Completed. When I checked the API Response for the same using: Services > Tasks API v1 > tasks.tasks.list [Returns all tasks in the specified task list.] I was able to view the updates & found the task i marked as complete. However when I did the same using New interface (theme) from GMail, I found that the task I updated with completion was not at all there in above API Response. Thus Google

How to set Google Tasks Due Date

爱⌒轻易说出口 提交于 2019-12-20 03:13:19
问题 How do you set the due date for a task with the google tasks service in apps script? Tasks Service Trying to set this value to a given date, but this seems to only update the local value not the server value as tehhowch suggests task.due = new Date(); How do you update the server? Here is what I tried var x = { due: new Date() }; Tasks.Tasks.update(x, "MDE2NzI3NTAzNjc5NTQ1ODY5MTY6MDow", task); but it throws the error Invalid value for: Invalid format: "Tue Apr 10 20:45:26 GMT-04:00 2018"

Pass connection object to other activity - Google Tasks API

自闭症网瘾萝莉.ら 提交于 2019-12-13 06:23:20
问题 I seem to have struck a wall with this problem of mine. Basically i'm working on an app which syncs your google tasks with the Google Tasks API. Everything is going great so far in my first activity. But now I want to create a new activity to show the users task lists. So to get the tasklists I need the connection object in this new activity. Normally I just give variables with i.putExtra() or something similiar but ofcourse this does not work with (custom) objects. I already tried to use

AsynTask - onPostExecute is called before doInBackground

时光毁灭记忆、已成空白 提交于 2019-12-12 05:14:20
问题 i got a problem getting my AsyncTask to work correct. My App offers the possibility to connect with your Google Account and add and receive tasks by using the Tasks API. When the users wants to synchronize with his account, the doInBackground() method is started. Right before that, a ProgressDialog is displayed in the onPreExecute() method of the AsyncTask class. If the synchronisation has been successfully executed, the onPostExecute() method 'should' be called fading out the ProgressDialog

Date comparisons with formatDate in Google Apps Script are 1 day behind

北慕城南 提交于 2019-12-11 16:59:37
问题 Writing a Google Apps Script that looks at tasks via the Google Tasks API (as an Advanced Service) and checks their due date to see if they are overdue. If they are, it should then move them to the current day. Completed Project I used this code to create this project for keeping Google Tasks up to date: Keep Google Tasks Updated Issue When comparing the current day with the date the task is due, the date the task is due is always one day behind. Research Looking into it I found that it could