Coder Social home page Coder Social logo

aws-samples / aws-sdk-unity-samples Goto Github PK

View Code? Open in Web Editor NEW
160.0 42.0 112.0 61.57 MB

This repository has samples that demonstrate various aspects of the AWS Mobile SDK for Unity, you can get the SDK source on Github (https://github.com/aws/aws-sdk-net)

License: Other

C# 63.92% Objective-C 31.15% Objective-C++ 3.29% Java 0.82% JavaScript 0.82%

aws-sdk-unity-samples's Introduction

AWS Mobile SDK for Unity Samples

This sample snippet demonstrates how to securely manage and sync your game data and create unique identities via login providers.

This sample Unity project shows how to save game data to the cloud and access it accross devices using Cognito Sync.

This sample demonstrates how to create / update / delete / query items using DynamoDB Object Mapper.

The S3 sample demonstrates the following:

  • List all buckets in the AWS account
  • List all objects in the specified bucket
  • Upload an object into the specified bucket
  • Download an object from the specified bucket

The Mobile Analytics sample demonstrates the following:

  • How to integrate Mobile Analytics client with your app
  • Create and use custom event
  • Create and use monetization event
  • Record and send events to server

aws-sdk-unity-samples's People

Contributors

austinkelleher avatar hyandell avatar jbrown95 avatar johnnyhoffman avatar jongfeelkim-virnect avatar jpignata avatar karthiksaligrama avatar neguse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-sdk-unity-samples's Issues

S3 demo does not work on Android?

The S3 demo seems to work fine in the editor but when I run it on Android I get exceptions all over the place. For instance, when I hit the ListObjects button, I get these (maybe to get this running on Android it needs some Manifest settings??) (using Unity 5 here)

I/Unity (25194):
I/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
I/Unity (25194):
I/Unity (25194): NullReferenceException: Object reference not set to an instance of an object
I/Unity (25194): at Amazon.Util.CryptoUtilFactory+CryptoUtil.ComputeSHA256Hash (System.Byte[] data) [0x00000] in :0
I/Unity (25194): at Amazon.Runtime.Internal.Auth.AWS4Signer.SetRequestBodyHash (IRequest request) [0x00000] in :0
I/Unity (25194): at Amazon.Runtime.Internal.Auth.AWS4Signer.SignRequest (IRequest request, Amazon.Runtime.ClientConfig clientConfig, Amazon.Runtime.Internal.Util.RequestMetrics metrics, System.String awsAccessKeyId, System.String awsSecretAccessKey) [0x00000] in :0
I/Unity (25194): at Amazon.S3.Internal.S3Signer.Sign (IRequest request, Amazon.Runtime.ClientConfig clientConfig, Amazon.Runtime.Internal.Util.RequestMetrics metrics, System.String awsAccessKeyId, System.String awsSecretAccessKey) [0x00000] in :0
I/Unity (25194): at Amazon.Runtime.Internal.Signer.SignRequest (IRequestContext requestContext) [0x00000] in :0
I/Unity (25194): at Amazon.Runtime.Internal.Signer.PreInvoke (IExecutionContext execut
E/Unity (25194): An exception of type NullReferenceException was thrown from InvokeAsyncCallback().
E/Unity (25194):
E/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)


I/Unity (25194): Object reference not set to an instance of an object
I/Unity (25194):
I/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
I/Unity (25194):
I/Unity (25194): NullReferenceException: Object reference not set to an instance of an object
I/Unity (25194): at AWSSDK.Examples.S3Example.m__8 (Amazon.Runtime.AmazonServiceResult`2 responseObject) [0x00000] in :0
I/Unity (25194): at Amazon.S3.AmazonS3Client+c__AnonStorey6D.<>m__76 (Amazon.Runtime.AmazonWebServiceRequest req, Amazon.Runtime.AmazonWebServiceResponse res, System.Exception ex, Amazon.Runtime.AsyncOptions ao) [0x00000] in :0
I/Unity (25194): at Amazon.Runtime.Internal.UnityMainThreadDispatcher.ProcessRequests () [0x00000] in :0
I/Unity (25194): UnityEngine.Debug:Internal_LogException(Exception, Object)
I/Unity (25194): UnityEngine.Debug:LogException(Exception)
I/Unity (25194): Amazon.Runtime.Internal.Util.UnityDebugLogger:Error(Exception, String, Object[])
I/Unity (25194): Amazon.Runtime.Internal.Util.Logger:Error(Exception, String, Object[])
I/Unity (25194): Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests()
I/Unity (25194):
I/Unity (25194): (Filename: Line: -1)
I/Unity (25194):
E/Unity (25194): An unhandled exception was thrown from the callback method Amazon.S3.Model.ListObjectsRequest.
E/Unity (25194):
E/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
E/Unity (25194):

Path too Large on Unzip

This file: GetOpenIdTokenForDeveloperIdentityResponseUnmarshaller.cs.meta

Throws a Path too Large on unzipping on Windows 7.
It is buried in the path: CognitoSyncProject/Assets/AWSUnitySDK/AWSCore/Amazon.CognitotoIdentity/Model/Internal/MarshallTransformations/

And I was unzipping in downloads folder...c:/users/administrator/downloads/aws-sdk-unity-samples-master/

WORKAROUND: Skip the error, then went back into the zip and manually grabbed the missing file and put it in the above path.

Setup errors and invalid operation exception

I have been following the example, but trying to start the game throws an exception:

InvalidOperationException: Cannot override system-specified headers
UnityEngine.Networking.UnityWebRequest.SetRequestHeader (System.String name, System.String value) (at :0)
UnityEngine.WWW..ctor (System.String url, System.Byte[] postData, System.Collections.Generic.Dictionary`2[TKey,TValue] headers) (at <545425060cf44a88bfddbe49cbfe1747>:0)
Amazon.Runtime.Internal.UnityMainThreadDispatcher+d__7.MoveNext () (at C:/a/uv3/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:130)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <05f2ac9c8847426992765a22ef6d94ca>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests() (at C:/a/uv3/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:71)
Amazon.Runtime.Internal.UnityMainThreadDispatcher:Update() (at C:/a/uv3/sdk/src/Core/Amazon.Runtime/Pipeline/_unity/UnityMainThreadDispatcher.cs:57)

this seems to happen between client context setup for mobile analytics and when mobile analytics begins store session info. I know with asyncronous calls this could be anything but it is preventing me from continuing on.

This issues occurs on Unity version 2019.3.9f1 Personal

Simplified credentials + 400 error

I'm trying out the simplified credentials using just the pool id. It is generating an identity on Cognito server every time I run, but it's returning a 400 error and is not writing the identity to the local db.

I'm getting the following:
curl -X POST -H "X-Amz-Target: AWSCognitoIdentityService.GetCredentialsForIdentity" -H "Content-Type: application/x-amz-json-1.1" -H "User-Agent: AWS-SDK-UNITY/1.0.1" -H "X-HTTP-Method-Override: POST" -H "Accept: application/json" -d '{"IdentityId":"us-east-1:2ee56f8e-xxxx-xxxx-xxxx-a77c596a1bd8"}' https://cognito-identity.us-east-1.amazonaws.com/

I've confirmed each new identity is created in the Cognito dashboard.

If I modify SaveManager to use full credential values including accountId, poolId, unAuth, Auth, and region, it works, so this is unique to the GetCredentialsForIdentity() flow.

Any ideas?
Thanks

P.S. Maybe this issue should go in the aws-sdk-unity issues instead?

Errors while importing ChessGameCloudFormationTemplate.template

When I tried to import the ChessGameCloudFormationTemplate.template into my AWS account, I got the following errors and everything rolled back:

10:02:17 UTC-0700 CREATE_FAILED AWS::Lambda::Function NewChessMatch The runtime parameter of nodejs is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs6.10) while creating or updating functions.
  10:02:17 UTC-0700 CREATE_FAILED AWS::Lambda::Function NewMoveNotifier

I'm new to all this AWS stuff so I have no idea how to fix the script or .js files.

SNSExample gets crashed after calling AWSSDK.Examples.GCM.Register(...) method.

Hi there,

I'm playing with SNSExample but it gets crashed when tested on Nexus 5x.

That happened right after calling AWSSDK.Examples.GCM.Register(...) method but I couldn't figure out what was wrong since it did not provide any stacktrace information.
It only says "FATAL EXCEPTION". that's it.
Here is the log.
03-31 18:54:03.634 3939-5563/? D/GCM: GcmService start Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.GcmService (has extras) } com.google.android.c2dm.intent.REGISTER
03-31 18:54:03.884 25366-25366/myapp.share D/AndroidRuntime: Shutting down VM
03-31 18:54:03.890 25366-25397/myapp.share I/AWSUnityGCMWrapper: Saving regId on app version 1
03-31 18:54:03.900 25366-25397/myapp.share I/Unity: regId = APA91bH343lkjDfPiep970Jay95y-bKygVTRlcK0I4mdEREJkjkl3342uldN9LlhArRfJuwKHBe89YM4DXcS5UXP1qPPVM1qDlzbPxukbV7cLBzWzdB2EMRELKEmFDKFJEREi8VT-W0
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
AWSSDK.Examples.GCM:Register(Action`1, String[]) (at C:\Users\user1\Documents\personal\projects\Share\Assets\Examples\GCM.cs:36)
AWSSDK.Examples.SNSExample:RegisterDevice() (at C:\Users\user1\Documents\personal\projects\Share\Assets\Examples\SNSExample.cs:103)
UnityEngine.Events.InvokableCall:Invoke(Object[]) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:144)
UnityEngine.Events.InvokableCallList:Invoke(Object[]) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:621)
UnityEngine.Events.UnityEventBase:Invoke(Object[]) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:756)
UnityEngine
03-31 18:54:03.902 25366-25366/myapp.share E/AndroidRuntime: FATAL EXCEPTION: main
Process: myapp.share, PID: 25366
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 5.3.4f1
Device model : LGE Nexus 5X
Device fingerprint: google/bullhead/bullhead:6.0.1/MMB29P/2473553:user/release-keys

I'm using Unity 5.2.4f1.

Cheers

Update chess game README to include DynamoDB AutoScaling

At the end of June I created a free tier account and followed the chess game tutorial. Today I got charged for the use of excess alarms. I was unaware that in following this tutorial 40 alarms were created, with only 10 allowed within the free tier.

When creating the DynamoDB tables the instructions are outdated. They say to accept the default capacity settings, and to "select or clear Use Basic Alarms. We will not cover them in this tutorial."

Based on these instructions I deleted the alarms listed in the table, but (since mid June) the default capacity settings include auto scaling which (without notification) adds 8 alarms per table.

The instructions should either include a warning about the additional alarms, or suggest turning off auto scaling before the table is created, and then delete the table alarms.

Can't get S3 sample to work with Unity, IL2CPP and Android

I have a Unity app that needs to upload files to S3.
It works on desktop. When I build and run on an Android device, I'm getting no response from S3. There are no errors either (I'm looking at the logcat), just nothing.

I've added S3 to link.xml

Any ideas ?

Table.Query problem.

I'm currently working on an iOS app in Unity, and querying a table for messages. When I query the table the first time, the search that is returned by Table.Query is valid, and all the appropriate results are returned. The second time I call Table.Query, your logging does not show that a WWW request has been made or completed. Nothing is returned and search.Count does not contain a value. I am not using the async version of the call, and I'm executing the request inside of a thread.

Some things to note: I'm using Search.Count as a loop condition instead of Search.IsDone, since the loop would execute too many times when I was using the async version of query. In addition to this I had been using ThreadPool.QueueUserWorkItem to execute the search, but had moved it to its own dedicated thread for testing purposes.

`
void GetMessage(object prefix)
{
var filter = new QueryFilter(MESSAGE_PREFIX_KEY, QueryOperator.Equal, prefix.ToString());
_teamMessageData.Clear();

    Search search = null;
    try
    {
        search = _teamMessages.Query(filter);
    }
    catch(Exception ex)
    {
        Debug.LogException(ex);
    }

    if(search == null)
    {
        Debug.Log("returnning null");
        return;
    }

    Debug.Log("SearchCount: " + search.Count);
    while(_teamMessageData.Count != search.Count)
    {
        if(search.Count < 1)
            break;

        _teamMessageData.AddRange(search.GetNextSet());
    }

    _processTeamMessages = true;
    search.Reset();

}
`

Unity 2018.2.6f1 Chess Game issues

After compile, the MainMenu.unity scene give me the following error when run:

NullReferenceException: Object reference not set to an instance of an object
AWSSDK.Examples.ChessGame.GameManager.Load () (at Assets/ChessGameScripts/GameManager.cs:170)
AWSSDK.Examples.ChessGame.MainMenuBehaviors.Start () (at Assets/ChessGameScripts/BasicUI/MainMenuBehaviors.cs:22)

How can I fix Amazon.Runtime.Internal.UnityHttpErrorResponseException

After I follow your tutorial on how to use Amazon cognito with unity, then I try to use DynamoDB. In LowlevelDynamoDBexample scene I click create table. In the scene and it say AmazonDynamoDB Exception see more information in log then I look in log and it say Amazon.Runtime.Internal.UnityHttpErrorResponseException was thrown. Please tell me how to fix this. If you need more information about this problem please ask me.

SNS google-play-services.jar is moved.

I recommended using this packet https://github.com/googlesamples/unity-jar-resolver
//GCMDependencies.cs
using Google.JarResolver;
using UnityEditor;

[InitializeOnLoad]
public static class GCMDependencies
{
static GCMDependencies()
{
PlayServicesSupport svcSupport = PlayServicesSupport.CreateInstance(
"AdsSample", EditorPrefs.GetString("AndroidSdkRoot"), "ProjectSettings");

    svcSupport.DependOn("com.google.android.gms", "play-services-gcm", "10.2+");
}

}

move GCMDependencies.cs to Editor folder

AWS S3 Server Storage

I need help while setup the credentials for S3 Bucket for storage of data but i am facing 1 error and i need few IDs i add the screenshots if any idea how to setup them let me know thanks.
eroor screen
bucket

Add a Cognito Sync Developer Authenticated Identities Sample

Hi,

please add a "Cognito Sync Developer Authenticated Identities Sample"! I can´t get this to work from the this doc: https://docs.aws.amazon.com/cognito/devguide/identity/developer-authenticated-identities/

My DeveloperAuthenticatedCredentials RefreshIdentity() is never get called and Unity is hanging to death. Have to kill unity to work again.

The "ContactProvider" it self works good for me, i get my valid token. But it will never get called by the DeveloperAuthenticatedCredentials by construct.

`

using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Text;
using ThirdParty.Json.LitJson;

using Amazon;
using Amazon.CognitoSync;
using Amazon.Runtime;
using Amazon.CognitoIdentity;
using Amazon.CognitoIdentity.Model;
using Amazon.CognitoSync.SyncManager;

public class DeveloperAuthenticatedCredentials : CognitoAWSCredentials {

const string PROVIDER_NAME = "my.login.provider.lambdaauth";
const string IDENTITY_POOL = "eu-west-1:**********************241d67a79a";
static readonly RegionEndpoint REGION = RegionEndpoint.EUWest1;
private string email = "[email protected]";
private string password = "testpassword";
private string login = null;

public DeveloperAuthenticatedCredentials(string loginAlias)
    : base(IDENTITY_POOL, REGION)
{
    login = loginAlias;
}

protected override IdentityState RefreshIdentity()
{
    IdentityState state = null;
    ManualResetEvent waitLock = new ManualResetEvent(false);
    MainThreadDispatcher.ExecuteCoroutineOnMainThread(ContactProvider((s) =>
        {
            state = s;
            waitLock.Set();
        }));
    waitLock.WaitOne();
    return state;
}

IEnumerator ContactProvider(Action<IdentityState> callback)
{
    Dictionary<string, string> headers = new Dictionary<string, string>();
    headers.Add ("Content-Type", "application/json");

    string postData = "{\"email\":\"" + email + "\", \"password\":\"" + password + "\"}";
    Debug.Log (postData);

    byte[] pData = Encoding.ASCII.GetBytes (postData.ToCharArray());

    WWW www = new WWW("https://****.execute-api.eu-west-1.amazonaws.com/dev/login", pData, headers);
    yield return www;
    string response = www.text;

    Debug.Log ("Response Text: " + response);

    JsonData json = JsonMapper.ToObject(response);

    //The backend has to send us back an Identity and a OpenID token
    string identityId = json["identityId"].ToString();
    string token = json["token"].ToString();

    Debug.Log ("Token: " + token);

    IdentityState state = new IdentityState(identityId, PROVIDER_NAME, token, false);
    callback(state);
}

}
`

Cognito Sync Unity3d Sample edited:
`
public class MyOwnCognitoSyncManager : MonoBehaviour {

    private Dataset playerInfo;
    private string playerName;
    private string statusMessage = "";
    public string IdentityPoolId = "";

    private DeveloperAuthenticatedCredentials _credentials;
    private DeveloperAuthenticatedCredentials Credentials
    {
        get
        {
            if (_credentials == null)
                _credentials = new DeveloperAuthenticatedCredentials("will be manual set in ContactProvider");
            return _credentials;
        }
    }

    private CognitoSyncManager _syncManager;
    private CognitoSyncManager SyncManager
    {
        get
        {
            if (_syncManager == null)
            {
                _syncManager = new CognitoSyncManager(Credentials, new AmazonCognitoSyncConfig { RegionEndpoint = RegionEndpoint.EUWest1 });
            }
            return _syncManager;
        }
    }



    void Start() {
        playerInfo = SyncManager.OpenOrCreateDataset ("PlayerInfo");

        playerName = string.IsNullOrEmpty (playerInfo.Get ("playerName")) ? "Spieler" : playerInfo.Get ("playerName");

        playerInfo.OnSyncSuccess += this.HandleSyncSuccess; // OnSyncSucess uses events/delegates pattern
        playerInfo.OnSyncFailure += this.HandleSyncFailure; // OnSyncFailure uses events/delegates pattern
        playerInfo.OnSyncConflict = this.HandleSyncConflict;
        playerInfo.OnDatasetMerged = this.HandleDatasetMerged;
        playerInfo.OnDatasetDeleted = this.HandleDatasetDeleted;
    }

`

This would be very helpful for everyone. It´s so hard to get simple email & password auth with aws...

PLEASE! <3

Unable to open the DynamoDB examples in Unity

I've downloaded the DynamoDB examples so I could load them on Unity and pick it apart, but I am unable to select the examples from my downloads folder as they are not recognized as Unity projects. I'm using version 2017.3.1f1 of Unity, as this is for a project I need this version for. Is anyone else experiencing this issue or is this just something on my end?
image

image
image

Is this setup still valid?

Taking in consideration that's quite a long time since this project is published, I think it's very understandable to ask if this setup is still valid and have anyone tested this recently?

Is there any sample that's using all updates in services and tools?

The folder "CognitoSyncProject/Assets/AWSUnitySDK/AWSCore/Amazon.Unity" causes issues with the Unity system

Due to the fact Unity handles anything called "xxx.unity" (they don't care about the case) like scenes, the fact that this folder is called this messes around with some internals and similar. Importing the files makes Unity pop up with a "moving file error", as well as changing the project settings to "force text", the AWSPrefab not being able to see/find AWSInitializer and I'd imagine a few other issues as well.

Nothing other than real Unity scenes should be prefixed with ".unity".

On Android: "Unable to find sqlite3.dll"

After setting up the project, and logging in to Facebook successfully, I get this error, along with,

Facebook.AndroidFacebook:OnLoginComplete(String) (at /Developer/repos/git/aws-sdk-unity-samples/CognitoSyncProject/Assets/Facebook/Scripts/AndroidFacebook.cs:177)


(Filename: /Developer/repos/git/aws-sdk-unity-samples/CognitoSyncProject/Assets/DemoScene/SyncCharacterSelection/LoginController.cs Line: 42)

Unable to lookup library path for 'sqlite3.dll', native render plugin support disabled.
Unable to find sqlite3.dll

I'm experiencing this same behaviour / error logging in the examples within the pluginpackage as well.

Has anyone else tested this in Unity 5?

I get a DllNotFoundException :sqlite3 even though its in the plugin folder. default setup of sdk 1.0.1 and CognitoSyncProject.

Don't know if this is relevant but the dbPath has forward and back lashes, "/AWS\aws_cognito_cache.db"

Thanks for any help,
Cheers,
Nick

Is there a long-term support for the AWS/Unity integration?

We have a Unity app that currently uses a native web view to upload files to S3. To speed up this, we'd love to integrate the AWS SDK into Unity and do this completely natively.

What puzzles me a bit is that there's no "official AWS package" in the Unity asset store, and I can see issues here describing major problems (like not being able to run the samples in Unity 2019) which are open for almost a year (one is even since 2015).

So I am wondering if there's any kind of official (long-term) support for this integration. It won't help us if it works now, but breaks later... It is also very confusing that the link to the AWS Mobile SDK for Unity here

https://docs.aws.amazon.com/mobile-sdk/index.html

actually links to Amplify, while the other links below still refer to the Unity SDK.

The same goes for the "Download AWS SDK for Unity" download link that shows up on the "Getting Started with Cognito page" below. That link points to Amplify, but with no info whatsoever about where to get the actual SDK. This left me with the gut-feeling that the whole Unity support has been dropped with the intention to replace it by Amplify at a later point of time. Correct me if I am wrong.

image

On the same page, there is this link, which does not really point to Unity-specific info:

image

Kinesis PutRecord example sometimes send an event with no data

I could see this behaviour in rare cases and seemed to depend on what machine I was running on.

I tried removing the "using" part below to make it never dispose of the StreamWriter but then it always sends the event with no data.

using (var streamWriter = new StreamWriter(memoryStream))

From what I can tell it needs to dispose the StreamWriter first to flush the data to the MemoryStream, but this doesn't always happen before the event is sent.

Just removing the StreamWriter worked for me.

AWSPrefab 404

Hi, is the AWSPrefab still needed? I can't find it anywhere in the project and after digging around the internets it looks like this is now initialised with some code? I'm pretty new to AWS and was keen to do the tutorial but it seems out of date and/or incomplete.

Also in the section on Cognito Console the link takes you to a page which doesn't have any option to 'Create new identity pool' only 'Manage your User Pools' or 'Manage Federated Identities' is this link incorrect or has the terminology already changed? Anyway I'm finding the tutorial pretty hard to get into and any help appreciated.

Thanks

S3 not working on android as well as ios unity application

Hello, everyone i tried to integrate AWS s3 sdk in unity demo project, it's working fine in editor I can post media on s3 and also get the media from the s3 but when i make apk or ipa i get the error, I share the screenshots here.

Thanks in advance
aab2dd30-4976-4aef-9373-165dc4fee3d5
WhatsApp Image 2021-05-17 at 8 47 33 PM

Api Documentation

I am trying to change code for my project but I cannot find api documentation. I beliave official api documentation is here: Api Docs However there is no information about 'PostObjectAsync' in this documentation. I had no time to check other methods.

Merging in Sync Demo not functioning

I've been working on merging in the 2.0 SDK into my code over the last week or so and noticed something weird with my merging functionality. To confirm what I was seeing, I have gone back to the sync demo. I'm no longer getting any merge when I transition from an unauthenticated to an authenticated user.

Here's what I'm doing:

  • Clean pull of sample project repo
  • Copied latest aws-sdk-unity into project, and then brought in latest amazon-cognito-unity
  • Replaced AWSPrefab with the one in the aws-sdk-unity package
  • Assigned my identity pool in scene manager
  • Assigned my Facebook app id to the Facebook resource
  • Created unauthenticated user
  • Created 3 characters and assigned experience levels to each
  • Saved
  • Loaded
  • Verified data on Amazon dashboard
  • Verified data in SQL locally
  • Verified identity in player prefs
  • Stopped and restarted Editor, confirmed correct characters.
  • Saved
  • Loaded
  • Link to FB account, retrieved access token
  • My three characters disappear
  • Save, Load
  • Create new character, set experience level
  • Save
  • Logout
  • Go through the same process again
  • Exact same flow, except this time I get just the one character from the authenticated account

I've checked the Unity console and I'm not getting notified of conflicts or of a merge. It seems that it's just pulling in the authenticated identity but not notifying of the need to merge. In looking at the SQL, I still see my 3 characters from the unauth account, but they don't ever seem to merge in. Obviously clicking "Logout" blows them away.

Any ideas?

MobileAnalytics Sample nullpointer exception

Hi,

First time using AWS and I'm trying to use the mobile analytics but I can't seem to make it work on either IOS nor Android. I followed the tutorial by the letter, making sure everything was exactly like the tutorial asks and I still can't make it work. Here's the IOS exception being thrown on load:

NullReferenceException: A null value was found where an object instance was required.
  at Amazon.AWSConfigs.GetSection[T] (System.String sectionName) [0x00000] in <filename unknown>:0 
  at Amazon.Util.Internal.RootConfig..ctor () [0x00000] in <filename unknown>:0 
  at Amazon.AWSConfigs..cctor () [0x00000] in <filename unknown>:0 
  at Amazon.Runtime.Internal.Util.Logger.ConfigureLoggers () [0x00000] in <filename unknown>:0 
  at Amazon.Runtime.Internal.Util.Logger..ctor (System.Type type) [0x00000] in <filename unknown>:0 
  at Amazon.Runtime.Internal.Util.Logger.GetLogger (System.Type type) [0x00000] in <filename unknown>:0 
  at Amazon.UnityInitializer.Awake () [0x00000] in <filename unknown>:0 
  at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <filename unknown>:0 
  at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in <filename unknown>:0 
  at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: The type initializer for 'Amazon.AWSConfigs' threw an exception.
  at Amazon.Runtime.Internal.Util.Logger.ConfigureLoggers () [0x00000] in <filename unknown>:0 
  at Amazon.Runtime.Internal.Util.Logger..ctor (System.Type type) [0x00000] in <filename unknown>:0 
  at Amazon.Runtime.Internal.Util.Logger.GetLogger (System.Type type) [0x00000] in <filename unknown>:0 
  at Amazon.UnityInitializer.Awake () [0x00000] in <filename unknown>:0 
  at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <filename unknown>:0 
  at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in <filename unknown>:0 
  at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: The type initializer for 'Amazon.Util.Internal.AmazonHookedPlatformInfo' threw an exception.
  at Amazon.UnityInitializer.Awake () [0x00000] in <filename unknown>:0 
  at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <filename unknown>:0 
  at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in <filename unknown>:0 
  at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in <filename unknown>:0 
UnityEngine.GameObject:AddComponent()
Amazon.UnityInitializer:AttachToGameObject(GameObject)
AWSSDK.Examples.AmazonMobileAnalyticsSample:Start()

(Filename: currently not available on il2cpp Line: -1)

Attached unity initializer to AmazonMobileAnalyticsSample
UnityEngine.Logger:Log(LogType, Object)
AWSSDK.Examples.AmazonMobileAnalyticsSample:Start()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

NullReferenceException: A null value was found where an object instance was required.
  at Amazon.AWSConfigs.set_EndpointDefinition (System.String value) [0x00000] in <filename unknown>:0 
  at Amazon.RegionEndpoint.LoadEndpointDefinitions () [0x00000] in <filename unknown>:0 
  at Amazon.RegionEndpoint.GetBySystemName (System.String systemName) [0x00000] in <filename unknown>:0 
  at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in <filename unknown>:0 

(Filename: currently not available on il2cpp Line: -1)

And just in case I did something wrong, here's the link.xml file, located in the Assets folder root

<linker>
    <!-- if you are using AWSConfigs.HttpClient.UnityWebRequest option-->

<assembly fullname="UnityEngine">
    <type fullname="UnityEngine.Experimental.Networking.UnityWebRequest" preserve="all" />
    <type fullname="UnityEngine.Experimental.Networking.UploadHandlerRaw" preserve="all" />
    <type fullname="UnityEngine.Experimental.Networking.UploadHandler" preserve="all" />
    <type fullname="UnityEngine.Experimental.Networking.DownloadHandler" preserve="all" />
    <type fullname="UnityEngine.Experimental.Networking.DownloadHandlerBuffer" preserve="all" />
</assembly>

<assembly fullname="mscorlib">
    <namespace fullname="System.Security.Cryptography" preserve="all"/>
</assembly>

<assembly fullname="System">
    <namespace fullname="System.Security.Cryptography" preserve="all"/>
</assembly>

<assembly fullname="AWSSDK.Core" preserve="all"/>
<assembly fullname="AWSSDK.CognitoIdentity" preserve="all"/>
<assembly fullname="AWSSDK.SecurityToken" preserve="all"/>
<assembly fullname="AWSSDK.MobileAnalytics" preserve="all"/>
</linker>

and the awsconfig.xml, located in Assets/Resources

<?xml version="1.0" encoding="utf-8"?>
<aws> 
    region="us-east-1"
    <logging>
        logTo="UnityLogger"             
        logResponses="Always"             
        logMetrics="true"
        logMetricsFormat="JSON" 
    </logging>
</aws>

the rest of the project is untouched except for my poolID and my appID. I'm on Unity 5.3.5f1

Doesn't work on Unity 5.3

I just tried to open these examples on Unity 5.3 and you can't directly open the scenes apparently. So I made a project and dumped the whole folder into assets. There are 1000+ errors. The first and biggest error is the GameManager class name. So I renamed it to AWSGameManager.cs and renamed the class but there are still 1000+ errors.

How to Load the table Dynamically

I am new to DynamoDB.I am using Unity 2019. I am loading the table (HighLevelTableExample.cs)
through this method.

DynamoDBTable("mydynamodbtablename")]
public class HighLevelTableExample : DynamoDbBaseExample
{
public string S_tablefieldset;

.... }

Actually i have to dynamically Load a table . That means

DynamoDBTabl(MyDesiredTable)]

Instead of hotcode the table name. When i pass the table name in arguments. The table should load . How can i do it.

Cognito Sync Demo Project: UnityException: Launching iOS project via Xcode failed.

Hi Experts,

I found Launching iOS project via Xcode failed with Cognito Sync Demo Project.

The root of this issue is 'autorelease' is unavailable: not available in automatic reference counting mode.

Therefore, I introduced the below work around(Put -fno-objc-arc in the compile flags of the FbUnityInterface.mm on Unity editor)and then, this issue is not occurred.
http://devquestion.tk/29318048/workaround-for-unity5-ios-compile-error-with-facebook-unity-sdk-6-2-1.html

If this is bug, please fix it.

Thanks,
Akira Ueda

Chess demo doesn't work

When I open the chess demo in Unity it doesn't load the LambdaFunctions directory automatically.
After attaching the LambdaFunctions to assets manually, it throws up 18 compilation errors.

Incompatible with UWP

In Unity while building for Windows Univeral 10.

Error: type System.Runtime.Serialization.SerializationInfo doesn't exist in target framework

Among others, SerializationInfo does not exist in WP8 or WinRT.
There's a need to create a dll for the Editor and another one for UWP probably using .NET core..

Affected:
AWSSDK.Core.dll
AWSSDK.S3.dll
AWSSDK.CognitoIdentity.dll

SNS: google-play-services.jar and android-support-v4.jar files

The current SNS Sample instructions has the following:

You will need google-play-services.jar & android-support-v4.jar to run this project. You can find the play services library in the location /extras/google/google_play_services/libproject/google-play-services_lib/. Import this project to eclipse and export the jar . Make sure that you use the latest version of google play services. Copy these jar files to the Assets/Plugin/Android folder in the project.

I've been trying to set it up but the latest Android sdk no longer includes these files. Any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.