Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Deekshith · Apr 30, 2020 at 07:33 AM · In-Game EconomyPlayer InventoryPlayStream

Granting Bundles after IAP purchase

I am yet to implement IAP for my project but want to know if the bundles will automatically be granted by playfab on successful IAP purchase?

If yes then where do we have to specify which bundles has to be granted to that player on success?

Also I want to do some custom granting of rewards based on the bundle that is been granted. The custom rewards will be defined in the same bundle's custom data.

So how can I trigger a cloudscript function and I would need the data of which bundle was granted(from that trigger) so that I can look into that item's custom data specifically and do custom operations

Comment
Deekshith

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Apr 30, 2020 at 09:27 AM

>> …bundles will automatically be granted by playfab on successful IAP purchase?

Yes, bundles will automatically be granted by PlayFab on successful IAP purchases, please navigate to this tutorial to learn more: https://docs.microsoft.com/en-us/gaming/playfab/features/commerce/economy/getting-started-with-unity-iap-android#setting-up-a-playmarket-application-for-iap

>> If yes then where do we have to specify which bundles has to be granted to that player on success?

I don’t follow, that specific bundle(s) player bought will be added to the inventory, and, in normal cases, we usually make the bundle consumable by time (few seconds) so that it goes away after “dropping off” its contents soon after granting.

>> So how can I trigger a cloudscript function and I would need the data of which bundle was granted(from that trigger) so that I can look into that item's custom data specifically and do custom operations

You can set a up Rule that acts on the player_inventory_item_added event, use Conditions to find the specific bundles you want to perform custom operations on, and trigger a Cloud Script to do the work, the data from the event that triggered the action can be accessed using context.playStreamEvent in the handler function.

Comment
Deekshith

People who like this

1 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Deekshith · Apr 30, 2020 at 09:45 AM 0
Share

- Can I use com.playfab.player_receipt_validation instead of player_inventory_item_added event?

- Using the conditions I can trigger a cloudscript. But I will be executing the same cloudscript for every IAP purchase and as you said is this bundle Id accessible from context.playStreamEvent?

avatar image Citrus Yan Deekshith · Apr 30, 2020 at 10:06 AM 1
Share

1. Probably not: player_receipt_validation event does not contain necessary info for you to find events regarding to bundles. You may use custom event for this.

2. Yes, Bundle Id should be the Item Id : https://docs.microsoft.com/en-us/gaming/playfab/api-references/events/player-inventory-item-added

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    As of November 2018 what is the recommended IAP Asset? 1 Answer

    problem with PurchaseItemRequest 1 Answer

    Summary of inventory items owned 1 Answer

    Consumable Game Items 1 Answer

    What is the best way to model nothing in a drop table? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges