added firebase and rudimentary leaderboard support
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_armv7</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>godot_svc-device.release_debug.a</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>godot_svc-simulator.release_debug.a</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
17
ios_plugins/godot_svc/bin 3.x/godot_svc.gdip
Normal file
17
ios_plugins/godot_svc/bin 3.x/godot_svc.gdip
Normal file
@@ -0,0 +1,17 @@
|
||||
[config]
|
||||
name="GodotSVC"
|
||||
binary="godot_svc.xcframework"
|
||||
|
||||
initialization="register_godot_svc_plugin"
|
||||
deinitialization="unregister_godot_svc_plugin"
|
||||
|
||||
[dependencies]
|
||||
linked=[]
|
||||
embedded=[]
|
||||
system=[]
|
||||
|
||||
capabilities=[]
|
||||
|
||||
files=[]
|
||||
|
||||
[plist]
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>AvailableLibraries</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_armv7</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>godot_svc-device.release.a</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LibraryIdentifier</key>
|
||||
<string>ios-arm64_x86_64-simulator</string>
|
||||
<key>LibraryPath</key>
|
||||
<string>godot_svc-simulator.release.a</string>
|
||||
<key>SupportedArchitectures</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
<string>x86_64</string>
|
||||
</array>
|
||||
<key>SupportedPlatform</key>
|
||||
<string>ios</string>
|
||||
<key>SupportedPlatformVariant</key>
|
||||
<string>simulator</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XFWK</string>
|
||||
<key>XCFrameworkFormatVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Binary file not shown.
17
ios_plugins/godot_svc/src/godot_svc.gdip
Normal file
17
ios_plugins/godot_svc/src/godot_svc.gdip
Normal file
@@ -0,0 +1,17 @@
|
||||
[config]
|
||||
name="GodotSVC"
|
||||
binary="godot_svc.xcframework"
|
||||
|
||||
initialization="register_godot_svc_plugin"
|
||||
deinitialization="unregister_godot_svc_plugin"
|
||||
|
||||
[dependencies]
|
||||
linked=[]
|
||||
embedded=[]
|
||||
system=[]
|
||||
|
||||
capabilities=[]
|
||||
|
||||
files=[]
|
||||
|
||||
[plist]
|
||||
30
ios_plugins/godot_svc/src/godot_svc.h
Normal file
30
ios_plugins/godot_svc/src/godot_svc.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*************************************************************************/
|
||||
/* godot_svc.h */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef GODOTSVC_H
|
||||
#define GODOTSVC_H
|
||||
|
||||
#include "core/version.h"
|
||||
#if VERSION_MAJOR == 4
|
||||
#include "core/object/class_db.h"
|
||||
#else
|
||||
#include "core/object.h"
|
||||
#endif
|
||||
|
||||
class GodotSvc : public Object {
|
||||
|
||||
GDCLASS(GodotSvc, Object);
|
||||
|
||||
static GodotSvc *instance;
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
static GodotSvc *get_singleton();
|
||||
void popup(String url);
|
||||
void close();
|
||||
GodotSvc();
|
||||
~GodotSvc();
|
||||
};
|
||||
|
||||
#endif
|
||||
41
ios_plugins/godot_svc/src/godot_svc.mm
Normal file
41
ios_plugins/godot_svc/src/godot_svc.mm
Normal 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;
|
||||
}
|
||||
}
|
||||
36
ios_plugins/godot_svc/src/godot_svc_delegate.mm
Normal file
36
ios_plugins/godot_svc/src/godot_svc_delegate.mm
Normal file
@@ -0,0 +1,36 @@
|
||||
/*************************************************************************/
|
||||
/* godot_svc_delegate.mm */
|
||||
/*************************************************************************/
|
||||
#import "platform/iphone/view_controller.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "WebKit/WebKit.h"
|
||||
#import <SafariServices/SafariServices.h>
|
||||
|
||||
@interface GodotSvcDelegate : NSObject
|
||||
- (void)loadSvc:(NSString *)url;
|
||||
- (void)closeSvc;
|
||||
@end
|
||||
|
||||
@implementation GodotSvcDelegate
|
||||
- (void)loadSvc:(NSString *)url {
|
||||
// Parses String Into URL Request
|
||||
NSURL *nsurl=[NSURL URLWithString:url];
|
||||
// Gets root controller to present the safari view controller
|
||||
UIViewController *root_controller = [[UIApplication sharedApplication] delegate].window.rootViewController;
|
||||
// add svc
|
||||
SFSafariViewController *svc = [[SFSafariViewController alloc] initWithURL:nsurl];
|
||||
svc.delegate = (id) self;
|
||||
[root_controller presentViewController:svc animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)closeSvc {
|
||||
UIViewController *root_controller = [[UIApplication sharedApplication] delegate].window.rootViewController;
|
||||
[root_controller dismissViewControllerAnimated:true completion:nil];
|
||||
|
||||
}
|
||||
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller {
|
||||
UIViewController *root_controller = [[UIApplication sharedApplication] delegate].window.rootViewController;
|
||||
[root_controller dismissViewControllerAnimated:true completion:nil];
|
||||
}
|
||||
@end
|
||||
|
||||
23
ios_plugins/godot_svc/src/godot_svc_module.cpp
Normal file
23
ios_plugins/godot_svc/src/godot_svc_module.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
/*************************************************************************/
|
||||
/* godot_svc_module.cpp */
|
||||
/*************************************************************************/
|
||||
#include "godot_svc_module.h"
|
||||
#include "core/version.h"
|
||||
#if VERSION_MAJOR == 4
|
||||
#include "core/config/engine.h"
|
||||
#else
|
||||
#include "core/engine.h"
|
||||
#endif
|
||||
#include "godot_svc.h"
|
||||
|
||||
GodotSvc *godot_svc;
|
||||
void register_godot_svc_plugin() {
|
||||
godot_svc = memnew(GodotSvc);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSvc", godot_svc));
|
||||
}
|
||||
|
||||
void unregister_godot_svc_plugin() {
|
||||
if (godot_svc) {
|
||||
memdelete(godot_svc);
|
||||
}
|
||||
}
|
||||
6
ios_plugins/godot_svc/src/godot_svc_module.h
Normal file
6
ios_plugins/godot_svc/src/godot_svc_module.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/*************************************************************************/
|
||||
/* godot_svc_module.h */
|
||||
/*************************************************************************/
|
||||
|
||||
void register_godot_svc_plugin();
|
||||
void unregister_godot_svc_plugin();
|
||||
Reference in New Issue
Block a user