Skip to content

Commit

Permalink
Add MANAGE_GAME_MODE option for Firebase Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
theromis committed Apr 29, 2024
1 parent 4da8605 commit 8627c6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/share/godot_share_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class GodotShareData : public RefCounted {

public:
void share(const String &p_text, const String &p_subject, const String &p_title, const String &p_path);
void rate();

GodotShareData();
~GodotShareData();
Expand Down
9 changes: 9 additions & 0 deletions modules/share/godot_share_data.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#import "app_delegate.h"

#import <StoreKit/StoreKit.h>

GodotShareData *GodotShareData::singleton = nullptr;

GodotShareData::GodotShareData() {
Expand Down Expand Up @@ -70,6 +72,13 @@
[root_controller presentViewController:avc animated:YES completion:nil];
}

void GodotShareData::rate() {
if (@available(iOS 10.3, *)) {
[SKStoreReviewController requestReview];
}
}

void GodotShareData::_bind_methods() {
ClassDB::bind_method(D_METHOD("share", "text", "subject", "title", "path"), &GodotShareData::share);
ClassDB::bind_method(D_METHOD("rate"), &GodotShareData::rate);
}
1 change: 1 addition & 0 deletions platform/android/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ static const char *android_perms[] = {
"MANAGE_APP_TOKENS",
"MANAGE_DOCUMENTS",
"MANAGE_EXTERNAL_STORAGE",
"MANAGE_GAME_MODE",
"MASTER_CLEAR",
"MEDIA_CONTENT_CONTROL",
"MODIFY_AUDIO_SETTINGS",
Expand Down

0 comments on commit 8627c6f

Please sign in to comment.