Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for Unity WebGL #898

Closed
wants to merge 1 commit into from
Closed

Conversation

Deathwing
Copy link

@Deathwing Deathwing commented Mar 13, 2018

-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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

-BackgroundInvoker replaced by CoroutineInvoker on UnityWebGL
-BackgroundRunner replaced by CoroutineRunner on UnityWebGL
-ThreadPool usage removed on UnityWebGL
-CognitoIdentity support for GetCredentialsAsync() on UnityWebGL
 -MobileAnalytics support for UnityWebGL with a FileEventStore instead of SQLiteEventStore
@Deathwing Deathwing mentioned this pull request Mar 13, 2018
@normj
Copy link
Member

normj commented Mar 28, 2018

I appreciate sending us the pull request. Unfortunately right now we don't have the bandwidth to add maintenance support for Unity WebGL so I can't take this pull request. I'm going to close this as I don't see that changing anytime soon. If our bandwidth for Unity support changes we can revisit this but I don't expect that to happen anytime soon.

@normj normj closed this Mar 28, 2018
@aallbrig
Copy link

@normj It's five years later. Does the team have bandwidth now? 🤞🤞🤞

@LoopIssuer
Copy link

Hi,
How, without Cognito SDK for Unity WebGL, could I make authentication (login, forgot password etc.) with Cognito?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants