Search Unity

[Solved] [IAP] [Network] Purchasing for multiple clients question

Discussion in 'Unity IAP' started by Paradisss, Feb 22, 2016.

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

    Paradisss

    Joined:
    Feb 18, 2016
    Posts:
    2
    Hi All!
    I am currently working on dedicated server (using Unity Networking), where all purchases will be handled (using Unity IAP: ) ). And when I initiate purchase I want to supply connection ID of current "client". Question is... how do I do it?
    I tried using payload input variable in InitiatePurchase method, but I can't find any reference, or way to get it back in ProcessPurchase method. Maybe there is some other way I can hold on connection ID through IAP process?? Or I should go with linking connection IDs to user profile in Apple Store/Google Play Services and send them to my server?
     
  2. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hi @Paradisss,

    Can you please elaborate on what you are trying to accomplish? After a player has made an in app purchase, are you trying to record the connection id with the purchase made on your server? Are you trying to manage in app purchases from your server host or on the connected client devices?
     
  3. Paradisss

    Paradisss

    Joined:
    Feb 18, 2016
    Posts:
    2
    Hi @mpinol,

    I want to somehow associate concrete buyer with purchase. When client makes purchase attempt - I send request to the server which then goes through all phases of purchasing (full Unity IAP process), then I want to send data with purchase details to client. I am trying to manage app purchases from server.

    Or am I going in wrong direction?
    Should I try to just send request to server, and then just ask server if current client has some updates on their account?
    OR
    Make purchases on client device and just send receipts to server for validation, and after validation give player items (consumables/non-consumables/etc.)?
     
  4. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hey @Paradisss,

    I believe your second suggestion would be the better approach. To first make the purchases on the client device and then send something like the product purchased along with the receipt for validation to determine which items to give to players.
     
Thread Status:
Not open for further replies.