Well, that was a big waste of time. I worked w/ the native AWS SDK in objective-c to get a basic set of features written: init, login, refresh, and logout. This all works well in a single ViewController native app. I have basic buttons to login, logout and refresh. I can see the same tokens returned on the refresh call until I get inside of 5min of the expiration time (1 hour). Then, it uses the refresh token under the covers to get a new set of tokens. This is all wrapped in a Cognito class that I wrote.
The problem comes when I wrap this class in a cordova plugin. The init and plugin code runs fine. But, the refresh errors out with the message “Authorization delegate not set”. This appears to be some sort of internal state this is lost between the login call and the refresh call. I have looked into the source for the AWS SDK and can see a spot where it calls the delegate if the expirationTime or tokens are missing, which generates the error because I do not set the delegate.
I saw a mention from @max on the github repo for the Ionic/AWS reference app about this issue. @max and chance you could share some details of any work you have going on the use of native code to do the login logout. I am very eager to fix the issue as I feel that the AWS back-end/Ionic front-end stack is a really compelling tech set. I would love to share what I have for native code and my “broken” plugin work to try and get to a final point where there is a plugin to provide tokens for working w/ the AWS API gateway (or other services that need an idToken).