Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Solved] Unity IAP - Facebook Payments Lite - Paging not supported?

Discussion in 'Unity IAP' started by _geo__, Jul 7, 2017.

Thread Status:
Not open for further replies.
  1. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    The situation:
    We are using Unity IAP 1.11.4 (but it also happens in earlier versions).
    We have been testing with Unity 5.6.0f3, 5.6.1p1, 5.6.2p1.
    We have a WebGL App which uses Facebooks Payments Lite (published as Facebook App page and GameRoom).
    We have 27 IAP products (this will be important ;-)

    The Facebook "Payments Lite" docs state that: "paging" will occur if you have more than 25 products.
    See here: https://developers.facebook.com/docs/games_payments/payments_lite/

    The Problem:
    Unity IAP reports all products that are paged (on page 2,3,...) as unavailable (UnityEngine.Purchasing.Product > "availableToPurchase" is always false).
    Note: The list of products is sorted by name (ABC descending). By changing the titles of your products on facebook you can "choose" which procuts will be unavailable.
    This happens in a live app with > 200.000 MAU, no debug settings or test-app.

    How we "fixed" it:

    In the Facebook Payments Lite backend we have renamed two of our least purchased products to a title starting with "Z". Now all the other products are available just fine. Not a very satisfactory solution but still, better than nothing.

    The question:
    Do you have the same problem?
    If yes, how did you fix it?

    @Unity staff:
    Is it supposed to work with more than 25 "Payment Lite" products?
    How can we force UnityIAP to get all the products, not just the first 25?

    Thank you
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @_geo__

    Thanks for reporting this issue. We are looking into this issue.
     
  3. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    Thank you!
    Let us know if you have some beta or fix to test :)
     
  4. JayR

    JayR

    Joined:
    Aug 2, 2016
    Posts:
    84
    Hi @_geo__

    Pagination is not currently functional in the FacebookStore for Unity IAP but we'll get that into the pipeline.
     
  5. JayR

    JayR

    Joined:
    Aug 2, 2016
    Posts:
    84
    Actually, @_geo__ one quick thing you can check in the graph API explorer: select your app in the dropdown under Graph API Explorer. Then replace the text for the request with <your_App_ID>/products?limit=50 and see if it returns your full list or if it still limits it to 25. You can definitely reduce the page size but I'm not sure if you can just arbitrarily increase it.

    Meanwhile I will be adding more products to a test app...
     
  6. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    Hi, sorry for my late reply.
    Yes, the Graph API Explorer reports all products if used with a higher limit (default is 25).
    Maybe you can just ad a higher default limit to the Facebook IAP implementation (would be nice) :)

    Thank you.
     
  7. Cygnus87

    Cygnus87

    Joined:
    Aug 10, 2016
    Posts:
    9
    Just encountered this issue in the Payments for Facebook Gameroom so tried updating the IAP plugin first. Unfortunately it appears this is still a problem even with the most recent version of the Unity IAP plugin.

    If you use the graph API explorer on an app with enough products and query like the Unity plugin chooses to:

    UnityIAP FB: productRequest = /APP_ID/products

    Then the default limit is 25 items per page.

    Really though the issue is not the paging itself or the limit so much as the plugin not handling the paging (our app has a large number of possible IAPs that aren't all displayed at once so it's unlikely increasing the limit would be a sane solution). The paging object is mentioned in the documentation for application products and ends up looking something like this:

    "paging": {
    "cursors": {
    "before": "BeforeCursorString",
    "after": "AfterCursorString"
    },
    "next": "https://graph.facebook.com/v2.10/AP...ing&pretty=0&limit=25&after=AfterCursorString"
    }

    Really all that needs to happen is to keep following the chain of "next" URLs to gather all the products data. Once the end of the list of products has been reached there is no longer a "next" field in the json.

    It's disappointing to learn that this was a know issue for so long and has not yet been fixed.
     
  8. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    Yes, following the pagination links would be the ultimate solution.
    I hoped bumping up the default to 50 (or whatever the maximum is on the facebook-api) might be easier for unity to implement as a quick fix.

    Still sad that it's not yet fixed :-/
     
  9. Radneto

    Radneto

    Joined:
    Mar 10, 2015
    Posts:
    5
    Unfortunately, our game has well in excess of 100 IAP's so the only solution for us is the handling on the pagination correctly.
     
  10. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
    Ouch, in that case the limit of 25 really hurts.
    Hope they get it fixed soon.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    This is indeed on our roadmap, but no ETA yet at this time.
     
  12. Radneto

    Radneto

    Joined:
    Mar 10, 2015
    Posts:
    5
    Thanks for the reponse Jeff, unfortunately, our original plan was to launch with Gameroom this week, I'm assuming to meet our targets, we'll have to create a work around for this problem
     
  13. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,298
Thread Status:
Not open for further replies.