Search Unity

Daydream (VR) subscription support.

Discussion in 'Unity IAP' started by Taoma, Feb 19, 2019.

  1. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    Hi,

    I've been trying to implement Unity IAP subscription (Google Play) for an existing (published) Daydream app for the last two days without success. Everytime I press the subscribe button the view fades out and then back in, reporting an error "Unknown", "Billing unavailable" (error code 3).

    I then created new project, imported Unity IAP and added (to existing UnityIAP.cs) my subscription product id and it worked. IAP dialog showed up as expected. I used the same package name, version and bundle version code along with the keystore.

    Then I imported GoogleVR Unity SDK and modified IAP demo scene to work in VR, but it no longer worked, reporting the same "unknown", "billing unavailable" message. I tried to add a normal non-consumable product and it actually worked.

    Is subscription supported on Daydream? I couldn't find any information (Unity or Google) about this.

    Unity version: 2018.3.4f1
    Unity IAP version: 1.20.1
    GVR SDK for Unity v1.190.1
     
    Last edited: Feb 19, 2019
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    Thanks for replying. I'm attaching the adb log. I replaced package name and app name with "com.my.daydream.app" and "My App Name" respectively.

    The first thing I did was to buy already purchased product (test_001) and then I tried to purchase subscription (new_content_every_60_days).

    On a side note:
    Shouldn't I be presented with Daydream's dialog when the product I try to buy is already purchased?
     

    Attached Files:

  4. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    @JeffDUnity3D Hi, did you manage to check the log? Any suggestions?
     
  5. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    Bump
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    As you can view in the logs, you do have several products that appear to be not initializing:

    Unavailable product 100.gold.coins -100.gold.coins

    However, I don't think that is your core issue. You do initialize some products correctly, like test_001 which is failing to purchase with the error that you mention. Unfortunately we don't have immediate access to a Google Daydream system to test, so unfortunately I don't think we are going to be to provide a quick answer.

    Also, it does say "Sku is owned: test_001" so you were able to purchase it once?
     
  7. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    Thanks for replying :)

    Yeah test_001 is not subscription product. I added it to test normal purchase to find the root of the problem easier.

    As I said normal (non) consumable products work. The only problem I'm having with are subscription products.

    The other products that don't initialize are the ones from IAP demo. I didn't think that these could be a problem but I'll check it out.

    I tested this on the original Pixel phone and galaxy s9+. Same results.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You should not be able to purchase a subscription a second time, can you clarify your issue a bit more? A subscription is a non-consumable product.
     
  9. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    test_001 is a non-consumable product (ProductType.NonConsumable).
    Buying this one worked as it should, Daydream's dialog shows up and I can buy the product.

    new_content_every_60_days is subscription (ProductType.Subscription).
    Screen fades to black when I try to "purchase" subscription and then fades back without displaying Daydream's dialog.
    (This works in non-VR mode).

    I tried to remove all the other products that fail to initialize with the same results.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I wouldn't expect the dialog to display as you've already purchased it. I would expect the purchase failure callback to fire, telling you this. And you seem to be mixing initialization (a one-time IAP up front initialization) with product purchase. Your product purchase is failing, not an initialization failure. Please review the sample IAP project here: https://forum.unity.com/threads/sample-iap-project.529555/
     
  11. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    I'm sorry for all the confusion. I digresed a little.
    Let's ignore test_001 - non-consumable product, since it's not the point of this thread. I used it to make sure IAP works. And it does.

    The product I'm having problem with is the product with id: new_content_every_60_days which is a subscription (hence the title of this thread). I'm not redirected to Daydream's dialog when I try to subscribe.

    I receive "billing not available" messages (adb). The view fades out to black and then back in without showing the purchase (Daydreams in-VR dialog) dialog.

    As I already stated this happens in VR mode only. Works fine in non-VR mode. Native android dialog shows up as it should.
     
    Last edited: Feb 26, 2019
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, thanks for the update.
     
  13. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    Just bumping the thread. No news probably?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please test with a different user profile on your device, or create a new subscription product to test with. A subscription can only be purchased once.
     
  15. Taoma

    Taoma

    Joined:
    Sep 29, 2016
    Posts:
    11
    I upgraded Unity IAP to 1.22.0 version, and tested with different subscription product. The result is still the same
    Code (CSharp):
    1. Purchase failed: test_sub2
    2. Unknown
    3. Store specific error code: BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE
    4. Purchase failure description message: GOOGLEPLAY_Unable to buy item (response: 3:Billing Unavailable)
    Works fine for non-subscription products.

    I attached adb log.
     

    Attached Files:

  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The logs are saying "Unavailable product 100.gold.coins -100.gold.coins" and the same for all the others, please check your spelling. Please provide the code you are using to add these products and a screenshot of your Google Play product list