File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
iOS_SDK/OneSignalSDK/Source Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2715,6 +2715,11 @@ + (void)onSessionEnding:(NSArray<OSInfluence *> *)lastInfluences {
27152715#pragma clang diagnostic ignored "-Wincomplete-implementation"
27162716@implementation UIApplication (OneSignal)
27172717+ (void )load {
2718+
2719+ if ([self shouldDisableBasedOnProcessArguments ]) {
2720+ [OneSignal onesignal_Log: ONE_S_LL_WARN message: @" OneSignal method swizzling is disabled. Make sure the feature is enabled for production." ];
2721+ return ;
2722+ }
27182723 [OneSignal onesignal_Log: ONE_S_LL_VERBOSE message: @" UIApplication(OneSignal) LOADED!" ];
27192724
27202725 // Prevent Xcode storyboard rendering process from crashing with custom IBDesignable Views
@@ -2760,6 +2765,12 @@ +(void)setupUNUserNotificationCenterDelegate {
27602765 [OneSignalHelper registerAsUNNotificationCenterDelegate ];
27612766}
27622767
2768+ +(BOOL ) shouldDisableBasedOnProcessArguments {
2769+ if ([NSProcessInfo .processInfo.arguments containsObject: @" DISABLE_ONESIGNAL_SWIZZLING" ]) {
2770+ return YES ;
2771+ }
2772+ return NO ;
2773+ }
27632774@end
27642775
27652776#pragma clang diagnostic pop
You can’t perform that action at this time.
0 commit comments