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.
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:
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?