federated identities and modification of user attributes - android

In my app I want users to sign themselves up/in (through user pool I created) or through facebook. I have done this first approach and looking at facebook authentication now. Basically, I retrieve user info such as name, email, gender etc but I also want them to fill in missing information such as DOB, location or later on, if they wish, they should be able to modify those attributes. How can I achieve this ? Should I have a DynamoDB table and populate it with those attributes and let them modify it later ? Thanks for advice.

In addition to David's answer, you could use Cognito Sync to store each of those attributes as a record within a single dataset. Since you mentioned you have a Facebook provider linked, those'll be accessible cross devices and only visible to the owning user.
Dynamo is also a totally viable option, you could use Cognito's IAM permissions to make sure users can only see/update their own rows.

We added support for Federation through Facebook, Google and LoginWithAmazon for User Pools. This will create a user in user pool when a user logs in with federation. You can also capture the attributes from Facebook using the attribute mapping feature.

I would suggest aws cognito to help track the user attributes as you have e described https://aws.amazon.com/cognito/ it has a lot of those attributes built in and also allows you to create custom attributes.

Related

Android: Google Calendar API, public events for all users

I decided to use Google Calendar API for my running app. I need to have some default public events in my calendar, this way anybody who is logged with different Google accounts could see them.
The questions is, what is the easiest way to store events, that everybody, who is logged from different accounts could see them?Maybe I need to create main events calendar and share to other local calendars?
You may want to check the use of Extended Properties which makes it easy to store application-specific data for an event without having to utilize an external database.
You can have the shared properties which are visible and editable by all attendees of an event. This property is shown regardless of the calendarId used in the request.
And to add or update events, using patch requests is the preferred method, as it allows you to manipulate some properties while leaving others untouched. Adding a new property with the same key will overwrite any existing properties with the same key.
Please visit the given link for a more detailed information.

Is it possible to add custom parameters to Firebase Dynamic Links?

So I'm developing a game for Android and I'm using Firebase for Authentication, to store user data, etc...
And now, I want to provide the user a way to share their score with their friends, so they can try to beat that score. I was thinking about sharing a dynamic link, and when the second user gets the link, the game would just start from that checkpoint.
But to do that, I would need to send a few data: the level Number, the first user's score, the first user's name.
I checked the documentation here and I saw that I can add some custom campaign parameters. But can I add those other parameters I need? If yes, How do I do it?
build Uri :
builder.scheme("https").authority("deepLink_from_firebase").appendQueryParameter("Param", Param_value).build();
and set that on setDeepLink()
To do this with Firebase, you would need to either encode all the custom data in the URL, or store it in your backend and use the URL as a key to retrieve the stored values. It's possible, but not as intuitive as you're hoping.
I would recommend investigating Branch.io (full disclosure: I am on the Branch team). The Branch service is free, does store an unlimited number of custom parameters with each link (exactly as you described), and interfaces perfectly with the other Firebase functions you are currently using. Branch links are used for this by many of the top apps in the world, including Airbnb, Pinterest, Tinder, and many others.

Is there a way to generate a user id for android?

Is there a way to generate a user id for new users like 'yik yak' does, removing the need of a login id and password? i really want to implement this as the app i am creating is not e-commerce so there is no need for such tight security.
Also would there be a way to display the generated user so users could add each other as friends?
I am not sure about a user ID, but I have used this to generate a device specific ID for similar purposes to what your are describing.
There is a way to do this using the faker library: https://www.bloco.io/blog/2015/faker-a-library-to-generate-fake-data-for-java-android
Please follow their tutorial.

does Facebook Graph API support searching people's name?

I would like to search facebook user by thier name. For example, If I type 'James',
I would like to return facebook users whose name is 'James'.
I know it is possible to access user's info with user's id value. But is it possible to access
user's id with only user's first name or last name?
Sergey is right about the fact that searching for all people named James would be useless. Sergey is referring to FQL, which is a different way of querying data, but as DMCS pointed out, there is a search function in the Graph API that can enable you to do what you're trying to do.
https://developers.facebook.com/docs/reference/api/
I quote:
Searching
You can search over all public objects in the social graph with https://graph.facebook.com/search. The format is:
https://graph.facebook.com/search?q=QUERY&type=OBJECT_TYPE
If you go to the page, there will be some examples of URL queries you can use to search for different types of objects, including users.
In my view, a useful application will typically be operating in the context of a FB user, accessing the objects that user has given the application permission to access. If you're searching a name among a user's friends, it's probably easiest to get all of his friends (you don't need any IDs to do this, other than the logged in user), and parse through that list for the user's name and ID, and then use the ID to get whatever information you're going to get.
It's really simple, do an HTTP GET to the Graph API search?q=James&type=user&access_token={token}
Take a look at this table https://developers.facebook.com/docs/reference/fql/user/
there're certain restrictions applied to that and required fields in the query because there can be millions of 'Jameses' and you will overload facebook's services with your queries as simple as that. They will not give you all the Jamses due to security and load reasons.

How to best add a comment/rating system to an android app

I already published an android app where you can see a list of specific objects and detailed informations about them. The list changes every day but some of the objects can appear again.
The application is communicating with a PHP server over HTTP and periodically pulls the list of objects.
I now plan to extend the app to make it possible to rate the objects and add a comment similar to how it is done in the android market. I'd like to avoid forcing the user to sign up for an account for being able to comment.
I see two problems:
The comment-system could be abused by spammers
A comment could be added from another system
So my questions are:
How to protect the system from spam?
How to authenticate the application with the server?
How do I limit the number of comments to one per user and object?
What about the androids device id? Is it unique enough to use it as identifier for the user?
Which other problems do you see?
2020 Commenting/Rating/Reviews Options
Since Socialize is out, here are a few options you can explore:
Build your own comment/rating implementation. Personally I love reddit and how it handles nested comments and ratings. Here's a library I found that implements it beautifully. Please note you'll need to tie this with a cloud-database. This is based on groupie. Article & implementation. Many ways to do this - https://stackoverflow.com/a/59472206/668240
Disqus - SDK's coming soon to iOS and Android.
BazaarVoice - commercial
Social Networks SDKs like Facebook, Twitter, etc. Personally I dislike this as we'll need to authenticate users with respective networks to use the APIs. It's like we are shipping off users of our apps to social networks. If you don't have a problem with that - then it might be for you
Legacy Option in 2014:
You can try out Socialize SDK which is open-source and a really good SDK for the rating and commenting you are looking for. It already has a well-functioning Commenting system built-in along with a 'like/love' facility and sharing to FB and Twitter. Each 'entity' (object in your case) can have metadata associated with it. So all you have to do is construct/use a rating widget, then send that rating with the entity attached to your object. To display your rating/comment is as simple as retrieving them from Socialize.
Each object (element from your app) should be associated with an entity which has a unique key in the form of a URL - sort of like a primary key to recognize your items. This entity can have meta-data - any data that you can insert on behalf of your object. Once you do that, you can retrieve that metadata any time you want.
I've been using Socialize for around a year now. They've matured over this period and are always aspiring to be the best at what they do.
Look at the Socialize Bar at the bottom. Its can be customized to your needs.
What's more - Socialize is free.
As for your questions:
There is comment moderation built into the Socialize Web Component
where you can filter out anything you feel is out of place.
Socialize allows you to authenticate through Facebook and Twitter.
Limiting to one comment per user can be achieved by using their User
and Comments API.
Socialize has both Anonymous authentication as well as Social A/c
authentication. I believe you can remove anonymous auth. So that
ensure that every user is authenticated before rating/commenting.
For authentication, you could use OpenID like StackOverflow does or Facebook authentication. Once you have them authentication, it shoud be easy to limit the number of comments to one per user per object. As far as spam, you could follow StackOverflow's model and allow users to vote comments up or down or flag as spam. Perhaps users with comments that have been voted up would have more power and be able to flag comments as spam.
You'll need some sort of rate limiting. I've used this one in this example before.
So you need a table with the user's ID and how many api calls they have left, and then when their last api call was. Then use the algorithm to update the values in the table every time a method is called.
Read through this, I think it should be possible to create an UUID for every case:
http://android-developers.blogspot.de/2011/03/identifying-app-installations.html
And then keep a hidden api key which is hard coded, or at least get's everytime calculated the same or in enigma style influenced by the time it is used. But you will be never be sure, that it won't be find out by crackers/hackers and maybe abused, you will always have this Problem.
Authenticate with the UUID of the user + api-key.

Categories

Resources