Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Correct handling of Store signals

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17352

    Kool

    Hi All,

    I’ve noticed that after performing a test purchase, the Store (for Soomla) item seems to ‘Restore all purchases’ at each application start up. This leads to strange behaviour in the Store slot handlers for when actions occur.

    In my app, I have three handlers for the Store item:

    Store {
        onRestoreAllTransactionsFinished: {
            // Show dialog for restoring 
        }
    
        onItemPurchased: {
            // Show dialog for item successfully purchased
        }
    }

    I thought this would be sufficient. However, due to the described behaviour of the Soomla plugin (restoring purchases at start-up), it means both the ‘onItemPurchased’ and ‘onRestoreAllTransactionsFinished’ are being triggered at each application start-up.

    I introduced a boolean flag to try and alleviate this:

    Store {
        property bool restoring: false
    
        onRestoreAllTransactionsStarted: {
            restoring = true
        }
    
        onRestoreAllTransactionsFinished: {
            if (restoring)
            {
                // Show dialog for restoring succesfull
            }
    
            restoring = false
        }
    
        onItemPurchased: {
            if (!restoring)
            {
                // Show dialog for item successfully purchased
            }
        }
    }

    This almost gets the right behaviour but it isn’t great.

    Is there a better way to properly differentiate between a user-triggered store purchase and the start-up restoration?

    Many thanks!

    #17353

    Alex
    Felgo Team

    Hi,

    can you please let us know on which platform you experience that behavior?

    Thanks,

    Alex from Felgo

    #17354

    Kool

    It’s on Android.

    #17357

    Marcin

    Hi all,
    I can confirm this behavior on Android platform.
    I have observed this months/weeks ago.

    #17399

    Alex
    Felgo Team

    Thanks for the info. We will have a closer look if something changed on Google’s side here and let you know!

    Best,

    Alex

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded