0

It is possible to block / expire old app versions in Firebase App Distribution and force users to update to newer versions?

Deleting the older versions in Firebase App Distribution does not solve the problem, since users can still use those installed versions.

I'm looking for a solution which would work for versions already installed.

blade
  • 804
  • 1
  • 9
  • 18

1 Answers1

0

Yes It is possible. Just you have to follow below steps.

  1. Use Firebase database inside app.

  2. keep 2 variable one is for update show and another is for to show force update.

  3. on start point of your application check and map your existing app with firebase DB mentioned app version same or different.

  4. if the version are same then allow further journey (means existing app is updated).

  5. If version are mismatch then check is this force update flag is true then navigate to playstore for new update .. (you can do whatever you want app will be in your control) check below code for your reference then have listener as well to notify apps that DB value is changed.

        FirebaseDatabase database = FirebaseDatabase.getInstance();
    DatabaseReference myRef = database.getReference("force_update");
    myRef.addListenerForSingleValueEvent(new ValueEventListener()
    {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot)
        {
            if(Integer.parseInt(""+dataSnapshot.child("version_code").getValue()) > iVersionCode)
            {
                popupUpdate(""+dataSnapshot.child("title").getValue(),""+dataSnapshot.child("message").getValue(), Boolean.parseBoolean(""+dataSnapshot.child("force_update").getValue()));
            }
            else
            {
                afterUpdate();
            }
        }
    
        @Override
        public void onCancelled(@NonNull DatabaseError databaseError)
        {
            SOUT("========= Canceled");
        }
    });
    

..

Nilesh
  • 167
  • 3
  • 15