From 518ba25faeacfa73a657729ce287104f9935717c Mon Sep 17 00:00:00 2001 From: Sergey Minakov Date: Wed, 3 Feb 2021 14:57:41 +0300 Subject: [PATCH] [iOS] Remove remote notifications code Using any remote notification method (even indirectly) causes App Store to trigger APNS warning email. (cherry picked from commit 4fda1ae6b881f305dc594d9c43fa2a49a89f5cb1) --- platform/iphone/godot_app_delegate.h | 24 --------------------- platform/iphone/godot_app_delegate.m | 32 +--------------------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/platform/iphone/godot_app_delegate.h b/platform/iphone/godot_app_delegate.h index 76d8aa409fd..6335ada50eb 100644 --- a/platform/iphone/godot_app_delegate.h +++ b/platform/iphone/godot_app_delegate.h @@ -31,7 +31,6 @@ #import typedef NSObject ApplicationDelegateService; -typedef void (^APNSNotification)(UIBackgroundFetchResult); @interface GodotApplicalitionDelegate : NSObject @@ -39,27 +38,4 @@ typedef void (^APNSNotification)(UIBackgroundFetchResult); + (void)addService:(ApplicationDelegateService *)service; -- (void)godot:(UIApplication *)application receivedNotificationToken:(NSData *)deviceToken; -- (void)godot:(UIApplication *)application receivedNotificationError:(NSError *)error; -- (void)godot:(UIApplication *)application receivedNotification:(NSDictionary *)userInfo completion:(APNSNotification)completionHandler; - @end - -#define GODOT_ENABLE_PUSH_NOTIFICATIONS \ - @interface GodotApplicalitionDelegate (PushNotifications) \ - @end \ - @implementation GodotApplicalitionDelegate (PushNotifications) \ - -(void)application : (UIApplication *)application \ - didRegisterForRemoteNotificationsWithDeviceToken : (NSData *)deviceToken { \ - [self godot:application receivedNotificationToken:deviceToken]; \ - } \ - -(void)application : (UIApplication *)application \ - didFailToRegisterForRemoteNotificationsWithError : (NSError *)error { \ - [self godot:application receivedNotificationError:error]; \ - } \ - -(void)application : (UIApplication *)application \ - didReceiveRemoteNotification : (NSDictionary *)userInfo \ - fetchCompletionHandler : (APNSNotification)completionHandler { \ - [self godot:application receivedNotification:userInfo completion:completionHandler]; \ - } \ - @end diff --git a/platform/iphone/godot_app_delegate.m b/platform/iphone/godot_app_delegate.m index b416c51457b..fb42c37ee2d 100644 --- a/platform/iphone/godot_app_delegate.m +++ b/platform/iphone/godot_app_delegate.m @@ -302,37 +302,7 @@ static NSMutableArray *services = nil; // MARK: Remote Notification -- (void)godot:(UIApplication *)application receivedNotificationToken:(NSData *)deviceToken { - for (ApplicationDelegateService *service in services) { - if (![service respondsToSelector:_cmd]) { - continue; - } - - [service application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; - } -} - -- (void)godot:(UIApplication *)application receivedNotificationError:(NSError *)error { - for (ApplicationDelegateService *service in services) { - if (![service respondsToSelector:_cmd]) { - continue; - } - - [service application:application didFailToRegisterForRemoteNotificationsWithError:error]; - } -} - -- (void)godot:(UIApplication *)application receivedNotification:(NSDictionary *)userInfo completion:(APNSNotification)completionHandler { - for (ApplicationDelegateService *service in services) { - if (![service respondsToSelector:_cmd]) { - continue; - } - - [service application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; - } - - completionHandler(UIBackgroundFetchResultNoData); -} +// Moved to the iOS Plugin // MARK: User Activity and Handling Quick Actions