Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-BackgroundInvoker replaced by CoroutineInvoker on UnityWebGL
-BackgroundRunner replaced by CoroutineRunner on UnityWebGL
-ThreadPool usage removed on UnityWebGL
-Cognito Identity support for GetCredentialsAsync() on UnityWebGL
-Mobile Analytics support for UnityWebGL with a FileEventStore instead of SQLiteEventStore
Description
Right at the start: My changes do not cover all services and all functions of the aws.sdk.net, mostly only the services we are using for our unity game (core, Cognito identity, mobile analytics). I can't guarantee that this is covering 100% (surely it is not), but at least it is something to start working with (maybe for a special Unity3D WebGL branch?).
The most of the code changes within unity only sections, but nevertheless, it should not affect non-WebGL builds. Only WebGL builds should use the changed methods/classes.
I added CoroutineRunner/CoroutineDispatcher like you have a BackgroundRunner/Dispatcher, which is basically running on coroutines on the unity main thread.
Calls which were related to Threading has been replaced by Unity Main Thread calls (for unity webgl only).
CognitoIdendity mostly used Synchronous methods, which I had to change in order to make it work for WebGL.
Also because SQLite is not supported in WebGL, I added a FileEventStore, which is based on System.Data.DataStore, in order to track mobile analytic events for WebGL builds.
Motivation and Context
With this change, it is at least partially possible to use the aws.sdk.net inside Unity for WebGL builds.
#326
Testing
I ran tests of your SDK and also we are using the changes I did for our released facebook WebGL game, where we use different tools to keep an eye on every exception which happens in our special WebGL-only aws.sdk.net
I tried to minimize the impact on non-Unity related target frameworks with using unity define flags whenever I changed something, which is not directly part of a unity subfolder.
Screenshots (if appropriate)
Types of changes
Checklist
License