I searched around the answer but I couldn't find one. I only found this answer.
But when I go to in app purchases in google play console using following video:To implement in-app purchases in your Ren'Py project, you will need to use the Google Play Billing Library, which is a set of APIs that allows you to integrate Google Play's billing system into your app. You will also need to create a product list in the Google Play Console, which defines the items that you want to sell in your app.
One possible way to open the rest of the story after an in-app purchase is to use a variable that stores the purchase status of the item, and then check that variable before jumping to the next label. For example, you could do something like this:
Code: Select all
# Define a variable that stores the purchase status of the item default story_unlocked = False # Use the Google Play Billing Library to initiate a purchase flow # This is a simplified example, you will need to follow the documentation for more details $ result = google_play_billing.purchase("story_item") # Check the result of the purchase flow if result == "success": # Set the variable to True if the purchase was successful $ story_unlocked = True # Show a message to the player "Thank you for your purchase! You can now enjoy the rest of the story." else: # Show an error message to the player "Sorry, something went wrong. Please try again later." # Check the variable before jumping to the next label if story_unlocked == True: # Jump to the label that contains the rest of the story jump story_label else: # Show a message to the player that prompts them to buy the item "You need to buy this item to unlock the rest of the story. Do you want to buy it now?" menu: "Yes": # Repeat the purchase flow $ result = google_play_billing.purchase("story_item") # Check the result and jump accordingly if result == "success": $ story_unlocked = True "Thank you for your purchase! You can now enjoy the rest of the story." jump story_label else: "Sorry, something went wrong. Please try again later." "No": # Return to the previous label or menu return
I get a message "To add in-app products, you need to add the BILLING permission to your APK" in google play console. How should I enable that ?