Today we’ve rolled out Pseudo-Users, making it easy to use Kii services right away without user authentication. When we created Pseudo-Users we were not only thinking about saving you time but also about the myriad of valid use cases where the users should be on-boarded quickly so they can start experiencing the app without going through the hassles of registration or sign-in.
Possible use cases are:
- Your user starts playing a game or using an app without a profile but later wants to provide user profile data without loosing progress
- You want to have an app with distinct users but you never want to require them to authenticate
- You want to create user profiles without requiring a password (and be able to later add that kind of security if necessary)
The benefit is that you’re now not forced to create a full blown user profile with password protection for these scenarios.
We have designed Pseudo-Users so you can convert them into full users when you think it’s time! Let’s take a look at some code snippets that will show you how to work with these “detached” users (we’re showing async method calls that use callbacks but you also use sync calls if you prefer):
As you can see
onRegisterCompleted() returns immediately with a valid Kii user that you can retrieve via
KiiUser.getCurrentUser() and you can determine that it’s a pseudo user thanks to the method
UserFields class allows to arbitrarily pass complementary user information (that is if you actually want that, it can be null if you prefer not to pass any parameter). You can of course retrieve a user token to enable a future sign-in with just a line of code:
In the event that you want to turn this user into a full blown Kii user you can just do the following (consider the variable pseudoUser has a user created as shown above):
As you can see we easily attached all the necessary identity data for a full blown user (of which password is a must) departing for a pseudo user. We also added user fields but that’s optional.
If you have questions about this new feature don’t hesitate to chime in at community.kii.com