Win the match with MBurger + Modena Volley

Mattia Farina
Mumble
Published in
5 min readMar 18, 2019

Modena Volley is one of the most famous and winning volleyball teams of Italy based in Modena which has played in the highest level of national league from 1968. Thousands of fans visit MV website for news about the team, buying merchandising or just to know when and where the next match would take place. A loyal fanbase such Modena Volley’s one not only deserves a comprehensive website but also a good app so… MBurger to the rescue 🚀!!

Our challenge was to build their application that had the purpose to bring the fans closer to the team, representing a place where put news about the team, results of matches, galleries of photos, calendar of the upcoming matches and many other informations. Using MBurger CMS Headless and its functionalities we were able to build the app faster and to have a complete dashboard where MV team can publish content easily and notify users about the latest news about their favorite volleyball team.

Below we will describe some not trivial functionalities that we were able to implement in the app with the help of MBurger.

User Authentication

One of the features of the app is the ability to vote for the MVP during the match. It’s a great feature for fans but also something risky because it is necessary to prevent multiple votes for a single match for a single user, or else results would bu pretty inaccurate. To prevent this situation we implemented user authentication using the MBAuth plugin, this way only authenticated users can vote for the MVP and each user can vote only once per match. Users can register from the app or login with Facebook or Google.

The auth session is managed directly by the MBurger SDK, after a successful login the authentication token is saved and sent with the subsequent api calls, to check if a user is already logged in:

iOS

if (MBAuth.userIsLoggedIn) {
}

Android

if(MBCommonMethods.hasLoggedIn(context)){
}

To register a new user the SDK has a sign-up feature which can handle many personal informations about the user (most of them are optional). Passing the data to the SDK is immediate and when a piece of information is not available or required, we simply don’t pass it:

iOS

[MBAuth registerUserWithName: @"USERNAME" Surname: @"SURNAME" Email:@"EMAIL" Password: @"PASSWORD" Phone:NULL Image:NULL Contracts:contracts Data:nil Success:^{} Failure:^(NSError *error) {}];

Android

String name, surname, email, password;
JSONArray jContracts;
MBurgerAuthTasks.registerUsr(getApplicationContext(), listener, name, surname, null, null, email, password, jContracts, null);

If a user is already registered we can use the authentication function with his credentials or create a new user by logging in with social networks for the first time.

iOS

// Email authentication[MBAuth authenticateUserWithEmail:@"EMAIL" Password:@"PASSWORD" Success:^(NSString *accessToken) {} Failure:^(NSError *error) {}];// Social authentication[MBAuth authenticateUserWithSocialToken:token TokenType:@"facebook or google" Contracts: contractsSelected Success:^(NSString *accessToken) {} Failure:^(NSError *error) {}];

Android

// Email authenticationMBurgerAuthTasks.authenticateUsr(getApplicationContext(), listener, email, password, null);
// Social authenticationString token //Google or FB auth tokenint social //MBAuthAsyncTask_AuthenticateSocial.SOCIAL_FACEBOOK or MBAuthAsyncTask_AuthenticateSocial.SOCIAL_GOOGLEMBurgerAuthTasks.authenticateUsrWithSocial(getApplicationContext(), listener,token, social, jContractsSelected);

The auth functions returns the access token of MBurger in the success block if the developer needs to use it but the authentication session is managed automatically by the SDK.
Be aware that the sign-up is ONLY necessary to vote, the app is fully usable without authentication.

Registered user can be found in the dashboard under “Plug-In” -> “Users”

GDPR compliance

With the introduction of GDPR, in may of 2018, we added the ability to create contracts and agreements directly from the MBurger dashboard under Settings -> Legal. Each agreement is composed of a name and link to the text of the agreement or a markdown text representing it.

Agreements are easily retrieved with the SDK asking for the project:

iOS

[MBClient getProjectIncludingContracts:YES Success:^(MBProject *project) {NSArray *contracts = project.contracts;} Failure:^(NSError *error) {}];

Android

MBurgerTasks.askForProject(getApplicationContext(), new MBApiProjectResultListener() {
@Override
public void onProjectApiResult(MBProject project) {
//Get contracts from MBProject object
}@Override
public void onProjectApiError(String error) {
}
}, true);

For this app we had 2 agreements, the first is a Privacy Policy, which is mandatory for any registered user, the second one is a marketing agreement, and it’s optional. As you can see in the previous screenshots they are requested in the registration screen but also when a social login is performed, with a popup. Obviously tapping on the agreement the text of it is displayed to the user so he can view it ad decide to accept it or not.

From the dashboard for every user it’s displayed if the agreement has been accepted or declined so that users that have not accepted the marketing one can be removed from marketing campaigns.

Users can also know which contracts they have accepted by calling the “profile” API, which will return all user accepted contracts, so anyone can see what the signed-on in the “settings” part of the app. It is also possible to uncheck the “marketing agreement” within the app in the same section, this is also another simple api call where we “update” user profile’s contracts.
So no worries with privacy, MBurger has already nailed it!

The match is won… but the tournament??!!

We are only passionate developers, sports and us are radically different worlds, but we think MBurger paid omage to one of the most famous volleyball teams providing easy-to-use API, radical flexibility and critical eye on users’ privacy, which, more now than then, is a serious affair. The match is won and we are sure that also the tournament will be no problem with a system like this🏆.
If you wish to make your first MBurger app please refer to the official documentation for Androidand iOS or come in contact with us partecipating to our developers community.

--

--

Mattia Farina
Mumble
Editor for

Sono co-fondatore di Mumble, tech company che sviluppa prodotti digitali coloud based utilizzati ogni anno da oltre 3 milioni di persone.