Trouble with access control and IAPHub logic – help needed 🙏

Hi everyone :waving_hand:

After a bit of a break, I’m back working on my app and running into some issues I can’t seem to figure out. I’d really appreciate your help!

I’ve added two boolean properties to the Users collection in the database:

  • hasAccess
  • adPosted


:gear: How the logic is supposed to work:

  • I’m using IAPHub for in-app purchases (it works fine, test payments are successful).
  • The idea is that users must pay a symbolic 1 EUR annual fee to access the app’s content (the app lists hotels with navigation).
  • On the IAPHub Start screen, I added an action:
    • Update Logged-in User > hasAccess = true

  • adPosted = true
  • This action runs only if adPosted is false (to limit each user to only one ad submission).

and other Actions on IAPhub start screen are:




:puzzle_piece: What else I added:

  • On the Paywall, I added an extra button

and configured its actions:

  • Update User > hasAccess = true and hasActiveSubscription = true
  • Another action: Link to a Registration screen

:cross_mark: The Problem:

Since I added this, the “Submit Ad” button no longer works, and it seems like some logic is broken.
I think I may have made a small mistake somewhere, but I can’t figure it out.

The Preview is also not reliable, so I have to re-upload the app for testing each time — which slows everything down.


:folded_hands: Please I need help

Thanks so much in advance :folded_hands:
I’m attaching all screenshots to make it easier.

Dear @Dilon and @Victor I would really appreciate if you could help me identify what I did wrong. Thank you in advance

@Domba frankly speaking, I can not understand the logic, why did you set this up in such a way, where is “submit ad” button and how is it connected to IAPhub.

From what I understood, you are using 3(!) properties on IAPhub start screen (I’m assuming it is a component you’re talking about): hasActiveSubscription, hasAccess and adPosted. In my opinion, mixing them in one action flow is not a very good idea. IAPHub start component’s main goal to check: does this user has an active subscription or not? (and what subscription type, but that’s the different story). Based on this, you can send a user to one path or to another path, and there you can implement additional logic. Maybe you could do it in a single flow after IAPHub start, but I can’t say if it’s possible or not. But I never see the update of hasActiveSubscription based on IAPHub’s result.

Also on your screenshots I can see some strangely defined logic. E.g. on the 1st screenshot you update Logged-in User → hasActiveSubscription, hasAccess and adPosted to True, if adPosted is False; but hasActiveSubscription should come from IAPHub (???).
If you show screenshots of actions in their execution order, then you will never get to Paywall in case of adPosted = False initially, because you’ll set all 3 props to true, and user will go to Profil za reg. kor. (never reaching other links).

Sorry, the configuration is difficult to understand and my advice would be to simplify it first (easiest way is to separate it to multiple screens).

Best,
Victor.

1 Like

Thank you very much for your detailed reply!
I really appreciate your time and explanation.
I’ll try to approach it in a different and simpler way.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.