Which method to use for saving game data and also displaying them in Flutter? [closed] - firebase

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a game that is super simple, no animations or that kind of stuff, it is some sort of trivia game. I can, already, save user's max. score locally via sharedpreferences, what I want to do now, is to save max. scores in some kind of server all users' and display them, maybe, in one screen.
I am not asking here for code, I realize that would be hard without seeing my game's source code.
I need any advice here to which method to use for saving user's 'simlpe' data?
Should I use firebase to save all users' max. scores or using Google Play Games would be a better choice?
By the way, I don't want to interrupt user for email, google sign in or any other that kind of methods. User will only update their username and profile photo (if they choose to).

You can use firebase realtime database or firestore to save user data. You don't have to use authentication if you don't want Google sign in.
Check the following :
https://pub.dev/packages/cloud_firestore
https://pub.dev/packages/firebase_database

Related

Best method of back end pseudo user validation with DynammoDB [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
I have a simple app that is using a dynammoDB table with node/express as the back end. I let users add and then edit things. I am trying to determine the best way to verify that a user owns the item that they are editing/deleting.
Here is what i've looked at. Is there a better method?
1. User cognito ID is part of the item when created
2. User token is sent as part of edit
3. Item is pulled from table when edit starts
4. Token is decoded and the id is compared to the one pulled from the table
The obvious problem here is that every edit requires a read. This seems wrong.
Another method
1. User cognito ID is part of the item when created
2. User token is sent as part of edit
3. Original id is sent from the item as well
4. Token is decoded and the decoded id is compared to the one sent
This doesn't require a read, but would let a clever person edit things that they shouldn't.
Is there another way that I am missing? I don't want to create some separate IAM policy for each user.
You should use DynamoDBs fine grained access control that can dynamically allow Cognito users only read/edit their own data:
https://aws.amazon.com/blogs/aws/fine-grained-access-control-for-amazon-dynamodb/

Where do I the ranking functions for firebase Storage [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am developing an app that the users can upload and vote for TagImages, so what is needed is to when someone check into a TagTopic get the most popular images and the newest one, so to do this ranking operation.
How should I approach this?
I think what you need is to use Firestore or Realtime, but in you case realtime would be better because the number of reads and writes, however, what you could do is to create an object for each image that contains the metadata about it like the number of votes, may be also down votes, who upload it, upload time, tags, or any things else you want. Then in you app or website you'll make a query that reads lets say top 5, and get them, then use the images names to get them from the cloud storage. For example:
images:{
image1Name:{
upvote: 10;
downvote: 2;
totolvote: 8;
uploader: 'Remoo';
uploadTime: '10:00:00AM 23/11/2021' //whatever the structure
}
}
Then you query them (this is Flutter example):
_firebaseDatabase
.reference()
.child("images")
.orderByChild('totolvote')
.limitToFirst(5)
.once().then(()=>{...})
Then get image1Name from cloud storage.
But note you can only use one orderByChild with each query, on the other hand you can use multiple where in Firestore, but there will be more cost on the reads and writes. Eventually it up to you and how you structure it. Hope this work for you.

Can I make a qr code generator app that contains user information? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to create an app that makes QR code that contains user's information.
The current scenario is that after sns log into the app, make QR code that contains user's account information
After that, I would like to create a QR code generator app that allows the user's information to be sent along with the QR code when User scan to QR code scanner.
What I'm curious about right now is whether I can make a QR code that contains the account information for that user, and if I can, what modules I can use to create.
Yup, it's completely possible.
Zxing, library ( Java ) can be used to generate as well as decode the QR code.
Some relevant tutorials are :
Java QR Code Generator
Reading QR code

Meteor Users collection vs additional collection [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i'n trying to figure out, what's the best practice for building collections associated with user's data.(In terms of reactive, queries speed, or other.)
For example, what's better?
Meteor.Users.profile: {friends, likes, previous orders, locations, favorites, etc"}.
Or create additional collection to keep this data, for example:
Meteor.UserInfo.user{friends, locations, previous orders, etc").
Thanks.
Use the Users collection to store information about that user that isn't related to other collections. Typically this should be at the top level of the user document, not inside the profile. The only thing I'd expect to see in the profile is profile information (and not, for instance, a list of previous orders).
Things like previous orders shouldn't be there since you can just query the Orders collection to find them. For performance reasons it is sometimes useful to denormalise this data, but this should be an exception, not the rule.

How do you set up an API key system for your website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Let say that I have a website with some information that could be access externally. Those information need to be only change by the respected client. Example: Google Analytic or WordPress API key. How can I create a system that work like that (no matter the programming language)?
A number of smart people are working on a standard, and it's called OAuth. It already has a number of sample implementations, so it's pretty easy to get started.
Simple:
Generate a key for each user
Deny access for each request without this key
Currently, I use a concatenation of multiple MD5s with a salt. The MD5s are generated off of various concatenations of user data.
A good way of generating a key would be to store a GUID (Globally Unique Identifier) on each user record n the database. GUID is going to be unique and almost impossible to guess.
There are also infrastructure services that manage all this for you like http://www.3scale.net (disclosure I work there), http://www.mashery.com and http://www.apigee.com/.

Resources