Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ else:
print("No valid version to set flags for.")
quit();

if env['version'] == '4.0' and env['plugin'] == 'arkit':
print("'arkit' plugin is 3.x only.")
quit();

# Adding header files
if env['version'] == '3.x':
env.Append(CPPPATH=[
Expand Down
12 changes: 11 additions & 1 deletion plugins/apn/godot_apn_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@
#import "godot_user_notification_delegate.h"

#if VERSION_MAJOR == 4
#if VERSION_MINOR == 5
#import "drivers/apple_embedded/godot_app_delegate.h"
#else
#import "platform/ios/godot_app_delegate.h"
#endif
#else
#import "platform/iphone/godot_app_delegate.h"
#endif

struct APNSInitializer {

APNSInitializer() {
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5
[GDTApplicationDelegate addService:[GodotAPNAppDelegate shared]];
#elif VERSION_MAJOR == 4 && VERSION_MINOR == 4
[GodotApplicationDelegate addService:[GodotAPNAppDelegate shared]];
#else
[GodotApplicalitionDelegate addService:[GodotAPNAppDelegate shared]];
Expand Down Expand Up @@ -94,7 +100,11 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
}

String device_token;
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5
device_token.append_utf8([[token copy] UTF8String]);
#else
device_token.parse_utf8([[token copy] UTF8String]);
#endif

APNPlugin::get_singleton()->update_device_token(device_token);
}
Expand Down
8 changes: 7 additions & 1 deletion plugins/apn/godot_app_delegate_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,18 @@
#include "core/version.h"

#if VERSION_MAJOR == 4
#if VERSION_MINOR == 5
#import "drivers/apple_embedded/godot_app_delegate.h"
#else
#import "platform/ios/godot_app_delegate.h"
#endif
#else
#import "platform/iphone/godot_app_delegate.h"
#endif

#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5
@interface GDTApplicationDelegate (PushNotifications)
#elif VERSION_MAJOR == 4 && VERSION_MINOR == 4
@interface GodotApplicationDelegate (PushNotifications)
#else
@interface GodotApplicalitionDelegate (PushNotifications)
Expand Down
41 changes: 40 additions & 1 deletion plugins/apn/godot_app_delegate_extension.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,46 @@

#include "godot_app_delegate_extension.h"

#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5

@implementation GDTApplicationDelegate (PushNotifications)

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
if (![service respondsToSelector:_cmd]) {
continue;
}

[service application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
if (![service respondsToSelector:_cmd]) {
continue;
}

[service application:application didFailToRegisterForRemoteNotificationsWithError:error];
}
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
if (![service respondsToSelector:_cmd]) {
continue;
}

[service application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

completionHandler(UIBackgroundFetchResultNoData);
}

@end

#elif VERSION_MAJOR == 4 && VERSION_MINOR == 4

@implementation GodotApplicationDelegate (PushNotifications)

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
Expand Down
1 change: 1 addition & 0 deletions plugins/camera/camera_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "servers/camera_server.h"

class CameraIOS : public CameraServer {

private:
public:
CameraIOS();
Expand Down
8 changes: 8 additions & 0 deletions plugins/camera/camera_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM
// CameraFeedIOS - Subclass for camera feeds in iOS

class CameraFeedIOS : public CameraFeed {
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5
GDSOFTCLASS(CameraFeedIOS, CameraFeed);
#endif
private:
AVCaptureDevice *device;
MyCaptureSession *capture_session;
Expand All @@ -270,8 +273,13 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM

void set_device(AVCaptureDevice *p_device);

#if VERSION_MAJOR == 4 && VERSION_MINOR >= 5
bool activate_feed() override;
void deactivate_feed() override;
#else
bool activate_feed();
void deactivate_feed();
#endif
};

AVCaptureDevice *CameraFeedIOS::get_device() const {
Expand Down
5 changes: 5 additions & 0 deletions plugins/gamecenter/game_center.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
#import "game_center_delegate.h"

#if VERSION_MAJOR == 4
#if VERSION_MINOR == 5
#import "drivers/apple_embedded/godot_app_delegate.h"
#import "drivers/apple_embedded/view_controller.h"
#else
#import "platform/ios/app_delegate.h"
#import "platform/ios/view_controller.h"
#endif
#else
#import "platform/iphone/app_delegate.h"
#import "platform/iphone/view_controller.h"
Expand Down
4 changes: 4 additions & 0 deletions plugins/icloud/icloud.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
#include "icloud.h"

#if VERSION_MAJOR == 4
#if VERSION_MINOR == 5
#import "drivers/apple_embedded/godot_app_delegate.h"
#else
#import "platform/ios/app_delegate.h"
#endif
#else
#import "platform/iphone/app_delegate.h"
#endif
Expand Down
5 changes: 5 additions & 0 deletions plugins/photo_picker/photo_picker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@
#import <Photos/Photos.h>

#if VERSION_MAJOR == 4
#if VERSION_MINOR == 5
#import "drivers/apple_embedded/godot_app_delegate.h"
#import "drivers/apple_embedded/view_controller.h"
#else
#import "platform/ios/app_delegate.h"
#import "platform/ios/view_controller.h"
#endif
#else
#import "platform/iphone/app_delegate.h"
#import "platform/iphone/view_controller.h"
Expand Down
Loading