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
3 changes: 2 additions & 1 deletion plugins/apn/apn.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/*************************************************************************/

#include "apn.h"
#import "godot_apn_delegate.h"

#import <Foundation/Foundation.h>

Expand All @@ -40,7 +41,7 @@
#include "core/project_settings.h"
#endif

#import "godot_apn_delegate.h"
#import "drivers/apple_embedded/godot_app_delegate.h"

static APNPlugin *singleton;

Expand Down
13 changes: 6 additions & 7 deletions plugins/apn/godot_apn_delegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,24 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

#import "godot_apn_delegate.h"

#include "apn.h"

#import "godot_apn_delegate.h"
#import "godot_user_notification_delegate.h"

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

struct APNSInitializer {

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

String device_token;
device_token.parse_utf8([[token copy] UTF8String]);
device_token.append_utf8([[token copy] UTF8String]);

APNPlugin::get_singleton()->update_device_token(device_token);
}
Expand Down
6 changes: 3 additions & 3 deletions plugins/apn/godot_app_delegate_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
#include "core/version.h"

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

#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
@interface GodotApplicationDelegate (PushNotifications)
@interface GDTApplicationDelegate (PushNotifications)
#else
@interface GodotApplicalitionDelegate (PushNotifications)
@interface GDTApplicationDelegate (PushNotifications)
#endif

@end
16 changes: 8 additions & 8 deletions plugins/apn/godot_app_delegate_extension.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#include "godot_app_delegate_extension.h"

#if VERSION_MAJOR == 4 && VERSION_MINOR >= 4
@implementation GodotApplicationDelegate (PushNotifications)
@implementation GDTApplicationDelegate (PushNotifications)

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

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

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

#else

@implementation GodotApplicalitionDelegate (PushNotifications)
@implementation GDTApplicationDelegate (PushNotifications)

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

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

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
for (ApplicationDelegateService *service in GodotApplicalitionDelegate.services) {
for (GDTAppDelegateServiceProtocol *service in GDTApplicationDelegate.services) {
if (![service respondsToSelector:_cmd]) {
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/photo_picker/photo_picker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#import <Photos/Photos.h>

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