[iOS] Remove remote notifications code

Using any remote notification method (even indirectly) causes App Store to trigger APNS warning email.

(cherry picked from commit 4fda1ae6b8)
This commit is contained in:
Sergey Minakov 2021-02-03 14:57:41 +03:00 committed by Rémi Verschelde
parent f3c030aa47
commit 518ba25fae
2 changed files with 1 additions and 55 deletions

View file

@ -31,7 +31,6 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
typedef NSObject<UIApplicationDelegate> ApplicationDelegateService; typedef NSObject<UIApplicationDelegate> ApplicationDelegateService;
typedef void (^APNSNotification)(UIBackgroundFetchResult);
@interface GodotApplicalitionDelegate : NSObject <UIApplicationDelegate> @interface GodotApplicalitionDelegate : NSObject <UIApplicationDelegate>
@ -39,27 +38,4 @@ typedef void (^APNSNotification)(UIBackgroundFetchResult);
+ (void)addService:(ApplicationDelegateService *)service; + (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 @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

View file

@ -302,37 +302,7 @@ static NSMutableArray<ApplicationDelegateService *> *services = nil;
// MARK: Remote Notification // MARK: Remote Notification
- (void)godot:(UIApplication *)application receivedNotificationToken:(NSData *)deviceToken { // Moved to the iOS Plugin
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);
}
// MARK: User Activity and Handling Quick Actions // MARK: User Activity and Handling Quick Actions