mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 23:10:08 +01:00
81 lines
2.2 KiB
Plaintext
81 lines
2.2 KiB
Plaintext
[gd_scene load_steps=2 format=2]
|
|
|
|
[ext_resource path="res://iap_demo.gd" type="Script" id=1]
|
|
|
|
[node name="Control" type="Control"]
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
script = ExtResource( 1 )
|
|
|
|
[node name="purchase" type="Button" parent="."]
|
|
margin_left = 40.0
|
|
margin_top = 40.0
|
|
margin_right = 250.0
|
|
margin_bottom = 120.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
text = "Purchase in app"
|
|
|
|
[node name="consume" type="Button" parent="."]
|
|
margin_left = 40.0
|
|
margin_top = 150.0
|
|
margin_right = 250.0
|
|
margin_bottom = 230.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
text = "Consume in app"
|
|
|
|
[node name="request" type="Button" parent="."]
|
|
margin_left = 40.0
|
|
margin_top = 260.0
|
|
margin_right = 250.0
|
|
margin_bottom = 340.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
text = "Request purchased"
|
|
|
|
[node name="query" type="Button" parent="."]
|
|
margin_left = 40.0
|
|
margin_top = 370.0
|
|
margin_right = 250.0
|
|
margin_bottom = 450.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
text = "Query in app items"
|
|
|
|
[node name="alert" type="AcceptDialog" parent="."]
|
|
margin_left = 290.0
|
|
margin_top = 60.0
|
|
margin_right = 700.0
|
|
margin_bottom = 290.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 2
|
|
|
|
[node name="Label" type="Label" parent="."]
|
|
margin_left = 300.0
|
|
margin_top = 40.0
|
|
margin_right = 932.0
|
|
margin_bottom = 207.0
|
|
size_flags_horizontal = 2
|
|
size_flags_vertical = 0
|
|
text = "\"iap\" is located in Autoloads. See Project > Project Settings > AutoLoad
|
|
|
|
To enable IAP module
|
|
|
|
1. Project > Project Settings
|
|
2. write [Category : android] / [Property : modules] / [Type : String] and click Add
|
|
3. Click \"Android\" on left panel
|
|
4. double click on right filed of \"modules\"
|
|
5. write \"org/godotengine/godot/GodotPaymentV3\"
|
|
|
|
To test in-app purchase on android device,
|
|
|
|
1. Need to add \"com.android.vending.BILLING\" permission at Project > Export > Android > User Permissions
|
|
2. Export APK and upload it as alpha or beta stage to Google Play Developer Console and publish it.
|
|
(It's not published to public, but you and tester can access it.)
|
|
3. There should be activated in-app item
|
|
4. Any changes on Developer console will take 2~3 hours to take effect"
|
|
|