FlutterFlow Tricks: Scheduled Functions / Cron Jobs

Поделиться
HTML-код
  • Опубликовано: 9 ноя 2024

Комментарии • 11

  • @mphatsomlenga8948
    @mphatsomlenga8948 5 месяцев назад

    Just when I needed it, thanks man

  • @ScoxZz
    @ScoxZz 5 месяцев назад +1

    Awesome!
    I have a huge daily action, that was so far triggered by the first user logging in. Looking forward to try to translate it into a cron job instead and fix that shitty experience!

    • @StevenNoCode
      @StevenNoCode  5 месяцев назад +1

      Happy to have helped! How you’ve set up currently is often the only way if you use FF only. Now you know the secret of cron jobs :)

  • @EmblazNOR
    @EmblazNOR 5 месяцев назад +1

    Excellent!
    Please create a tutorial about how to securely store API keys through firebase and supabase.

    • @StevenNoCode
      @StevenNoCode  5 месяцев назад +1

      Sure, I'll put it as the next short form video I make.

    • @EmblazNOR
      @EmblazNOR 5 месяцев назад

      @@StevenNoCode awesome! Im currently using buildship for this, but as i understand it i can skip buildship and use firebase for this instead. Or am ing something?

    • @RajeevSharma-ii7fx
      @RajeevSharma-ii7fx 4 месяца назад

      @@EmblazNOR const functions = require('firebase-functions');
      const admin = require('firebase-admin');
      // To avoid deployment errors, do not call admin.initializeApp() in your code
      const db = admin.firestore();
      exports.test4 = functions.pubsub.schedule('0 0 1 * *').onRun(async (context) => {
      try {
      const snapshot = await db.collection('entity').get(); // Replace with your collection name
      const batch = db.batch();
      snapshot.forEach(doc => {
      const data = doc.data();
      const amtToCredit = data.amtToCredit || 0;
      const currentPlanCredits = data.planCredits || 0;
      const updatedPlanCredits = amtToCredit;
      batch.update(doc.ref, { planCredits: updatedPlanCredits });
      });
      await batch.commit();
      console.log('Plan credits incremented successfully.');
      } catch (error) {
      console.error('Error incrementing plan credits:', error);
      }
      return null;
      });

  • @Woofiapp
    @Woofiapp 5 месяцев назад

    Love the videos! Question, what is the difference between using buildship to integrate stripe connect and integrating it inside of flutterflow?

    • @StevenNoCode
      @StevenNoCode  5 месяцев назад

      It's exactly the same. Buildship is simply a low-code visual builder with the same outcomes. For example, instead of writing your own Cloud Function for web hooks, you use Buildship to do the work instead. For API calls, instead of you having to understand the Stripe Connect API docs, you can use what Buildship has built as template.

  • @stephen_builds
    @stephen_builds 4 месяца назад

    Helpful. Please can you create a function for notifications. When an action is made on db, cloud funtion send notification to that user.