Android Subscriptions Code
These codes will allow you to acknowledge and verify purchases or subscriptions. There is 1 call for each type of transaction.
1. To get started, go to console.google.cloud.com/functions
2. Click Create Function
3. Give your new function a meaningful name
androidSubscriptionHandler should be the name you use here
4. Save the trigger type
5. Copy the code below and click the blue "next" button
6. Clear the default and paste the copied code into the code
7. Update the package.json file
8. Set the name of the functions entry point
the name used here should match the name used in Step 3 above
9. Click the plus icon to create a new file and name it "serviceAccount.json"
11. Deploy the function
12. Set function invocation privacy permissions
This allows any device with your endpoint URL the ability to verify purchases made via your app
Select the function you want to make public. (the function you just created)
Click the Permissions tab.
Click Add Principle
In the Add members field, type
allUsers
Select the Cloud Function Invoker role from the Select a role drop-down menu.
Click Add.
Last updated