Skip to content

Commit 7a2b96d

Browse files
committed
[APN] Fixed build errors from new apple embedded changes
1 parent 6f09772 commit 7a2b96d

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

plugins/apn/apn.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
/*************************************************************************/
3030

3131
#include "apn.h"
32+
#import "godot_apn_delegate.h"
3233

3334
#import <Foundation/Foundation.h>
3435

@@ -40,7 +41,7 @@
4041
#include "core/project_settings.h"
4142
#endif
4243

43-
#import "godot_apn_delegate.h"
44+
#import "drivers/apple_embedded/godot_app_delegate.h"
4445

4546
static APNPlugin *singleton;
4647

plugins/apn/godot_apn_delegate.mm

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,24 @@
2828
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
2929
/*************************************************************************/
3030

31-
#import "godot_apn_delegate.h"
3231

3332
#include "apn.h"
34-
33+
#import "godot_apn_delegate.h"
3534
#import "godot_user_notification_delegate.h"
3635

3736
#if VERSION_MAJOR == 4
38-
#import "platform/ios/godot_app_delegate.h"
37+
#import "drivers/apple_embedded/godot_app_delegate.h"
3938
#else
40-
#import "platform/iphone/godot_app_delegate.h"
39+
#import "godot_app_delegate.h"
4140
#endif
4241

4342
struct APNSInitializer {
4443

4544
APNSInitializer() {
4645
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
47-
[GodotApplicationDelegate addService:[GodotAPNAppDelegate shared]];
46+
[GDTApplicationDelegate addService:[GodotAPNAppDelegate shared]];
4847
#else
49-
[GodotApplicalitionDelegate addService:[GodotAPNAppDelegate shared]];
48+
[GDTApplicationDelegate addService:[GodotAPNAppDelegate shared]];
5049
#endif
5150
}
5251
};
@@ -94,7 +93,7 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
9493
}
9594

9695
String device_token;
97-
device_token.parse_utf8([[token copy] UTF8String]);
96+
device_token.append_utf8([[token copy] UTF8String]);
9897

9998
APNPlugin::get_singleton()->update_device_token(device_token);
10099
}

plugins/apn/godot_app_delegate_extension.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
#include "core/version.h"
3232

3333
#if VERSION_MAJOR == 4
34-
#import "platform/ios/godot_app_delegate.h"
34+
#import "drivers/apple_embedded/godot_app_delegate.h"
3535
#else
3636
#import "platform/iphone/godot_app_delegate.h"
3737
#endif
3838

3939
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
40-
@interface GodotApplicationDelegate (PushNotifications)
40+
@interface GDTApplicationDelegate (PushNotifications)
4141
#else
42-
@interface GodotApplicalitionDelegate (PushNotifications)
42+
@interface GDTApplicationDelegate (PushNotifications)
4343
#endif
4444

4545
@end

plugins/apn/godot_app_delegate_extension.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
#include "godot_app_delegate_extension.h"
3232

3333
#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
34-
@implementation GodotApplicationDelegate (PushNotifications)
34+
@implementation GDTApplicationDelegate (PushNotifications)
3535

3636
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
37-
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
37+
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
3838
if (![service respondsToSelector:_cmd]) {
3939
continue;
4040
}
@@ -44,7 +44,7 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
4444
}
4545

4646
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
47-
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
47+
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
4848
if (![service respondsToSelector:_cmd]) {
4949
continue;
5050
}
@@ -54,7 +54,7 @@ - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotif
5454
}
5555

5656
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
57-
for (ApplicationDelegateService *service in GodotApplicationDelegate.services) {
57+
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
5858
if (![service respondsToSelector:_cmd]) {
5959
continue;
6060
}
@@ -69,10 +69,10 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
6969

7070
#else
7171

72-
@implementation GodotApplicalitionDelegate (PushNotifications)
72+
@implementation GDTApplicationDelegate (PushNotifications)
7373

7474
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
75-
for (ApplicationDelegateService *service in GodotApplicalitionDelegate.services) {
75+
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
7676
if (![service respondsToSelector:_cmd]) {
7777
continue;
7878
}
@@ -82,7 +82,7 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
8282
}
8383

8484
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
85-
for (ApplicationDelegateService *service in GodotApplicalitionDelegate.services) {
85+
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
8686
if (![service respondsToSelector:_cmd]) {
8787
continue;
8888
}
@@ -92,7 +92,7 @@ - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotif
9292
}
9393

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

0 commit comments

Comments
 (0)