Skip to content
detanaputra edited this page Jun 10, 2023 · 5 revisions

GodotInAppReviews wiki!

This is an android plugin for Godot Game Engine that interface with Google Play In-App Review API. This plugin target android 32 SDK and minimum SDK version is 24.

Initial Setup

  1. Open this release page then download GodotInAppReviews.gdap and GodotInAppReviews_release_1.0.0.aar (or newer version if any).
  2. Copy those 2 files and paste them into your Godot project in this path [root folder]\android\plugins.
  3. When you export the project, in Godot Export window and Plugin section, check the Godot In App Reviews.

Summary

This plugin has 2 methods.

  1. requestReviewInfo()
  2. launchReviewFlow()

and also has 2 callback signals.

  1. _request_reviewinfo_completed(success)
  2. _launch_reviewflow_completed(success)

Note: the success callback parameter doesn't mean that the review window has shown or not. If the user has already given a review or rating, the request review info will return true and launch review flow will also return true in every method call.

You should read the Design Guideline and When to Request Review Flow before proceeding.

Use the plugin (GDscript)

  1. Get the reference of plugin

I would create all these sample code in Godot Singleton.

var GIAR

func _ready():
    if Engine.has_singleton("GodotInAppReviews"):
        GIAR = Engine.get_singleton("GodotInAppReviews")
  1. Connect signals
signal _request_reviewinfo_completed(success)
signal _launch_reviewflow_completed(success)

func connect_signals():
    GIAR.connect("_request_reviewinfo_completed", self, "on_request_reviewinfo_completed")
    GIAR.connect("_launch_reviewflow_completed", self, "on_launch_reviewflow_completed")

func on_request_reviewinfo_completed(success: bool):
    emit_signal("_request_reviewinfo_completed", success)

func on_launch_reviewflow_completed(success: bool):
    emit_signal("_launch_reviewflow_completed", success)
  1. Create the plugin method
func request_review_info():
    GIAR.call("requestReviewInfo")

func launchReviewFlow():
    GIAR.call("launchReviewFlow")

The complete code in the singleton would look like these.

signal _request_reviewinfo_completed(success)
signal _launch_reviewflow_completed(success)

var GIAR

func _ready():
    if Engine.has_singleton("GodotInAppReviews"):
        GIAR = Engine.get_singleton("GodotInAppReviews")
        connect_signals()

func connect_signals():
    GIAR.connect("_request_reviewinfo_completed", self, "on_request_reviewinfo_completed")
    GIAR.connect("_launch_reviewflow_completed", self, "on_launch_reviewflow_completed")

func on_request_reviewinfo_completed(success: bool):
    emit_signal("_request_reviewinfo_completed", success)

func on_launch_reviewflow_completed(success: bool):
    emit_signal("_launch_reviewflow_completed", success)

func request_review_info():
    GIAR.call("requestReviewInfo")

func launch_review_flow():
    GIAR.call("launchReviewFlow")
  1. Call the singleton method
get_node("/root/GodotInAppReviews").request_review_info()

get_node("/root/GodotInAppReviews").launch_review_flow()

Debugging

using adb logcat

@ECHO OFF
cd "path\to\your\android\sdk"
adb logcat -v time GodotInAppReviews:* godot:* mono:* *:S
Clone this wiki locally