This sample application demonstrates some of the options for doing user management on the FatFractal platform.
The current version includes three tests - including two methods to add some custom information about the user to the system and a third test that demonstrates how to implement a password change for a use.
Android and iOS versions with test code are included, but the fastest way to see the results is to see the HTML5/JS version. You can get to see that from this link:
https://fyi.fatfractal.com/managingusers/
Subclassing FFUser
The first method is to subclass the FFUser class that is included in all the SDKs. The example here adds three parameters to the definition - including a nickname (String), location (FFGeoLocation) and profilePic (byte[]). You can see the examples as follows:
MyFFUser subclass of FFUser
Subclassing FFUser for Android
Subclassing FFUser for iOS
Subclassing FFUser for HTML5/JS
Test cases for registering a MyFFUser user
Android test case for registering a MyFFUser user
iOS test case for registering a MyFFUser user
HTML5/JS test case for registering a MyFFUser user
FFDL definition for FFUser to use MyFFUser additional parameters
FFDL definition for FFUser
Create PublicProfile class with a REFERENCE to FFUser(MyFFUser)
The other method is to add the additional information to a new Objecttype (my example is called PublicProfile) that contains the same additional information, but also includes a REFERENCE to FFUser. This allows for managing access control for some user information independent of the FFUser which may be useful in some cases. Note - for this exercise, the FFUser still has the expanded parameters, but the sample code only populates the standard info for a user. They point is that you can easily separate what is private and what is more "public".
PublicProfile with REFERENCE to MyFFUser(FFUser)
PublicProfile class with REFERENCE for Android
PublicProfile class with REFERENCE for iOS
PublicProfile class with REFERENCE for HTML5/JS
Test cases for registering a FFUser(MyFFUser) user and creating a PublicProfile
Android test case for registering a FFUser(MyFFUser) user and creating a PublicProfile as well
iOS test case for registering a FFUser(MyFFUser) user and creating a PublicProfile as well
HTML5/JS test case for registering a FFUser(MyFFUser) user and creating a PublicProfile as well
FFDL definition for PublicProfile with REFERENCE to MyFFUser(FFUser)
FFDL definition for PublicProfile
Changing a user password
This test uses a server extension that will securely change a user password.
Server extension - changePassword
Source for changePassword extension
FFDL definition to add the server extension
FFDL definition for changePassword extension
Client side test cases for changing the user password
HTML5/JS test case for changing user password