ApparenceKit CLI 3.0.0 release note: RevenueCat, Anonymous authentication and more

Published on

ApparenceKit has now been updated to version 3.0.0. This update brings a lot of new features and improvements.
It's been 6 months since ApparenceKit was released. It's been a great success and I am very proud of it.
With this new version, I hope to make it even better and more useful for you.
A lot of improvements have been suggested by the community and I am very grateful for that.
Let's see what's new.

Anonymous signup mode

On setup you will be prompted to activate anonymous signup. This allows a user to access your app without login. An id and security token will be generated without any email, social auth or phone number. Currently this only work with firebase. (Supabase is currently working on it See https://github.com/supabase/gotrue/issues/68#issuecomment-1836671954) For rest API you can still activate it by changing the current mode in environment: But you will have to implements the auth api signupAnonymously.

authenticationMode: AuthenticationMode.authRequired, // change it to anonymous

Changes

User anonymous state has now an optionnal ID

const factory User.anonymous({String? id}) = AnonymousUserData;
String get idOrThrow => map(
        authenticated: (value) => value.id!,
        anonymous: (value) {
          if (value.id != null) {
            return value.id!;
          }
          throw "user is not connected";
        } 
        loading: (_) => throw "user is not connected",
      );

Firebase authentication new methods

Sign up with Google or Apple and link the account to the current anonymous user. The anonymous account will now be linked to the Apple account. The user can now sign in with his Apple account on another device. His data will be preserved.

If you want to sign in to a previous account call signinWithApple or signinWithGoogle.

As Firebase does not have any trigger for when a user links an account, you might want to call this function after it. So you can for example add the user email to your email marketing list


Rating popup pre-request

Apple store and Play Store limit the number of time you can ask a user for a rating. (nearly 3 times a year only) As you may know, Rating is one of the most important things to grow an app. A pre-request popup asking the user if he has 10 seconds to give your app a rating before showing the real rating popup from the system.

showRatingPopup(WidgetRef ref) {...}

You can call it from any widget using riverpod. You won't have to bother about spaming the user. The method will check if it should show the popup or not.

See lib/core/rating/models/rating.dart for more details.


Current theme is now saved in user preferences

ApparenceKit provides a complete theme enhancement. Simplifiying text theme, colors, and more. (See this article about our theme system)

It also provides a way to switch between light and dark mode easily, but this wasn't saved in the user preferences. This is now done.
The current theme is now saved in SharedPreferences without anything to do.
Meaning that if the user switches to dark mode, the app will open in dark mode the next time he opens it.


Migrating in-app payment to RevenueCat

Motivation RevenueCat is the most popular by far for handling in-app payments. It's also now the most reliable option and so we are migrating to this solution completely. (I could have maintained both solutions but this would require too much effort).

The module still includes a template of a paywall that you can customize to fit your needs. If the subscription is active the active subscription content page will be automatically shown.

As revenuecat allows you to tweak the shown subscriptions you can easily test your subscription prices.


BugFixes


Conclusion

I hope you will enjoy this new version.
I also use it to create apps with it and includes the best practices I learn from my experience. The documentation has also been updated to reflect these changes.
Don't hesitate to give me feedback or ask for new features.

Create a 5 stars app using our Flutter templates

Check our flutter boilerplate
kickstarter for flutter apps
Read more
You may also be interested in
Handle notifications in Flutter with Firebase  blog card image
Handle notifications in Flutter with Firebase
Published on 2023-12-15
Flutter with Supabase template released  blog card image
Flutter with Supabase template released
Published on 2024-02-01
ApparenceKit is a flutter template generator tool by Apparence.io © 2024.
All rights reserved