Skip to content

Commit 6f09772

Browse files
authored
Merge pull request #72 from bruvzg/4_4_fixes
Fix build with Godot 4.4.
2 parents 7344601 + 5421d0a commit 6f09772

File tree

6 files changed

+54
-2
lines changed

6 files changed

+54
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
./scripts/release_xcframework.sh 3.x
3434
ls -l bin/release
3535
36-
- uses: actions/upload-artifact@v2
36+
- uses: actions/upload-artifact@v4
3737
with:
3838
name: plugins
3939
path: bin/release/*

plugins/apn/godot_apn_delegate.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
struct APNSInitializer {
4444

4545
APNSInitializer() {
46+
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
47+
[GodotApplicationDelegate addService:[GodotAPNAppDelegate shared]];
48+
#else
4649
[GodotApplicalitionDelegate addService:[GodotAPNAppDelegate shared]];
50+
#endif
4751
}
4852
};
4953
static APNSInitializer initializer;

plugins/apn/godot_app_delegate_extension.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#import "platform/iphone/godot_app_delegate.h"
3737
#endif
3838

39+
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
40+
@interface GodotApplicationDelegate (PushNotifications)
41+
#else
3942
@interface GodotApplicalitionDelegate (PushNotifications)
43+
#endif
4044

4145
@end

plugins/apn/godot_app_delegate_extension.m

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,45 @@
3030

3131
#include "godot_app_delegate_extension.h"
3232

33+
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
34+
@implementation GodotApplicationDelegate (PushNotifications)
35+
36+
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
37+
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
38+
if (![service respondsToSelector:_cmd]) {
39+
continue;
40+
}
41+
42+
[service application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
43+
}
44+
}
45+
46+
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
47+
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
48+
if (![service respondsToSelector:_cmd]) {
49+
continue;
50+
}
51+
52+
[service application:application didFailToRegisterForRemoteNotificationsWithError:error];
53+
}
54+
}
55+
56+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
57+
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
58+
if (![service respondsToSelector:_cmd]) {
59+
continue;
60+
}
61+
62+
[service application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
63+
}
64+
65+
completionHandler(UIBackgroundFetchResultNoData);
66+
}
67+
68+
@end
69+
70+
#else
71+
3372
@implementation GodotApplicalitionDelegate (PushNotifications)
3473

3574
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
@@ -65,3 +104,4 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
65104
}
66105

67106
@end
107+
#endif

plugins/camera/camera_ios.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM
218218
}
219219

220220
// set our texture...
221+
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
222+
feed->set_ycbcr_images(img[0], img[1]);
223+
#else
221224
feed->set_YCbCr_imgs(img[0], img[1]);
225+
#endif
222226

223227
// update our matrix to match the orientation, note, before changing anything
224228
// here, be aware that the project orientation settings must match your xcode

plugins/inappstore/in_app_store.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ - (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedW
376376
ERR_FAIL_COND_V(!p_params.has("product_ids"), ERR_INVALID_PARAMETER);
377377

378378
GodotStringArray pids = p_params["product_ids"];
379-
printf("************ request product info! %i\n", pids.size());
379+
printf("************ request product info! %lli\n", pids.size());
380380

381381
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:pids.size()];
382382
for (int i = 0; i < pids.size(); i++) {

0 commit comments

Comments
 (0)