Andris Active Member Licensed User Longtime User May 2, 2018 #1 Erel said: The first token parameter in GoogleOauth2 sets the target module. This is the module that will receive all events. If you want to use it from multiple activities then add a service (or use the Starter service) and from the service delegate the event to whichever activity you like. Click to expand... The tutorial demo in the thread referenced above works perfectly for me as is. However, I want to handle emailing from a different activity called Email, so I've set the first parameter in GoogleOAuth2 to Email and moved subroutine Send to the Email activity. I can send emails fine after the first install, while the authentication token is valid. However, if I compile again a while later, after the token has expired, I get these log messages: Code: Copy Getting access token from refresh token... Object context is paused. Ignoring CallSubDelayed: JobDone This doesn't happen if Sub Send is in Main instead of Email. It seems that an event is being raised by GoogleOAuth2 in Main, instead of in Email, where I would expect it to be because I set Email as the target. Does anyone have any input on this?
Erel said: The first token parameter in GoogleOauth2 sets the target module. This is the module that will receive all events. If you want to use it from multiple activities then add a service (or use the Starter service) and from the service delegate the event to whichever activity you like. Click to expand... The tutorial demo in the thread referenced above works perfectly for me as is. However, I want to handle emailing from a different activity called Email, so I've set the first parameter in GoogleOAuth2 to Email and moved subroutine Send to the Email activity. I can send emails fine after the first install, while the authentication token is valid. However, if I compile again a while later, after the token has expired, I get these log messages: Code: Copy Getting access token from refresh token... Object context is paused. Ignoring CallSubDelayed: JobDone This doesn't happen if Sub Send is in Main instead of Email. It seems that an event is being raised by GoogleOAuth2 in Main, instead of in Email, where I would expect it to be because I set Email as the target. Does anyone have any input on this?
Erel B4X founder Staff member Licensed User Longtime User May 2, 2018 #2 It will be simpler to use the starter service for this. You can then start the target activity or do whatever you need to do. It will not be paused (there is a small exception here related to Android 8+ devices. It will be taken care automatically in the next version of B4A). Upvote 0
It will be simpler to use the starter service for this. You can then start the target activity or do whatever you need to do. It will not be paused (there is a small exception here related to Android 8+ devices. It will be taken care automatically in the next version of B4A).
Andris Active Member Licensed User Longtime User May 2, 2018 #3 Erel said: It will be simpler to use the starter service for this. You can then start the target activity or do whatever you need to do. It will not be paused (there is a small exception here related to Android 8+ devices. It will be taken care automatically in the next version of B4A). Click to expand... Thanks Erel. Using Starter seems to work fine. I've attached a zip file that modifies the original Tutorial demo to show a second Emailer activity and the additions to Starter. Add the ClientID and the recipient email address in Starter. Hopefully it will help others who currently have the same problem. Attachments GmailFromActivity.zip GmailFromActivity.zip 61.4 KB · Views: 612 Upvote 0
Erel said: It will be simpler to use the starter service for this. You can then start the target activity or do whatever you need to do. It will not be paused (there is a small exception here related to Android 8+ devices. It will be taken care automatically in the next version of B4A). Click to expand... Thanks Erel. Using Starter seems to work fine. I've attached a zip file that modifies the original Tutorial demo to show a second Emailer activity and the additions to Starter. Add the ClientID and the recipient email address in Starter. Hopefully it will help others who currently have the same problem.