added firebase and rudimentary leaderboard support

This commit is contained in:
derek
2025-04-09 11:19:02 -05:00
parent ce08df66e6
commit 25eb9e725a
121 changed files with 4987 additions and 4 deletions

View File

@@ -0,0 +1,41 @@
/*************************************************************************/
/* godot_svc.mm */
/*************************************************************************/
#include "godot_svc.h"
#import "platform/iphone/app_delegate.h"
#import "platform/iphone/view_controller.h"
#import "godot_svc_delegate.mm"
#import <Foundation/Foundation.h>
GodotSvc *GodotSvc::instance = NULL;
GodotSvcDelegate *godot_svc_delegate = nil;
void GodotSvc::_bind_methods() {
ClassDB::bind_method(D_METHOD("popup"), &GodotSvc::popup);
ClassDB::bind_method(D_METHOD("close"), &GodotSvc::close);
}
GodotSvc::GodotSvc() {
ERR_FAIL_COND(instance != NULL);
instance = this;
godot_svc_delegate = [[GodotSvcDelegate alloc] init];
}
void GodotSvc::popup(String url){
NSString *nsURL = [[NSString alloc] initWithUTF8String:url.utf8().get_data()];
[godot_svc_delegate loadSvc:nsURL];
}
void GodotSvc::close(){
[godot_svc_delegate closeSvc];
}
GodotSvc *GodotSvc::get_singleton() {
return instance;
};
GodotSvc::~GodotSvc() {
if (godot_svc_delegate) {
godot_svc_delegate = nil;
}
}