Skip to content

Commit 242af21

Browse files
committed
Move SDK check out of debug framework
1 parent fb7cbfd commit 242af21

File tree

7 files changed

+490
-1168
lines changed

7 files changed

+490
-1168
lines changed

ApptentiveConnect/debug/Apptentive+Debugging.h

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ NS_ASSUME_NONNULL_BEGIN
5050
- (void)presentInteractionAtIndex:(NSInteger)index fromViewController:(UIViewController *)viewController;
5151
- (void)presentInteractionWithJSON:(NSDictionary *)JSON fromViewController:(UIViewController *)viewController;
5252

53-
- (void)checkSDKConfiguration;
5453
- (void)resetSDK;
5554

5655
@end

ApptentiveConnect/debug/Apptentive+Debugging.m

-25
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,4 @@ - (void)resetSDK {
143143
[self setValue:nil forKey:@"engagementBackend"];
144144
}
145145

146-
- (void)checkSDKConfiguration {
147-
BOOL hasPhotoLibraryUsageDescription = [[NSBundle mainBundle].infoDictionary objectForKey:@"NSPhotoLibraryUsageDescription"] != nil;
148-
149-
if (!hasPhotoLibraryUsageDescription) {
150-
ApptentiveLogError(@"No Photo Library Usage Description Set. This will cause your app to be rejected during app review.");
151-
}
152-
153-
BOOL hasAppIDSet = self.appID != nil;
154-
155-
if (!hasAppIDSet) {
156-
ApptentiveLogError(@"No App ID set. This may keep the ratings prompt from directing users to your app in the App Store.");
157-
}
158-
159-
BOOL hasResources = [Apptentive resourceBundle] != nil;
160-
161-
if (!hasResources) {
162-
ApptentiveLogError(@"Missing resources.");
163-
#if APPTENTIVE_COCOAPODS
164-
ApptentiveLogError(@"Try cleaning derived data and/or `pod deintegrate && pod install`.");
165-
#else
166-
ApptentiveLogError(@"Please make sure the resources are added to the appropriate target(s).");
167-
#endif
168-
}
169-
}
170-
171146
@end

ApptentiveConnect/source/Apptentive.h

+4
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,10 @@ Returns a Boolean value indicating whether the given event will cause an Interac
566566

567567
- (void)setPushNotificationIntegration:(ApptentivePushProvider)pushProvider withDeviceToken:(NSData *)deviceToken APPTENTIVE_SWIFT_NAME(setPushProvider(_:deviceToken:));
568568

569+
#if APPTENTIVE_DEBUG
570+
- (void)checkSDKConfiguration;
571+
#endif
572+
569573
@end
570574

571575
/**

ApptentiveConnect/source/Apptentive.m

+27
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,33 @@ - (void)setAPIKey:(NSString *)APIKey baseURL:(NSURL *)baseURL {
609609
}
610610
}
611611

612+
#if APPTENTIVE_DEBUG
613+
- (void)checkSDKConfiguration {
614+
BOOL hasPhotoLibraryUsageDescription = [[NSBundle mainBundle].infoDictionary objectForKey:@"NSPhotoLibraryUsageDescription"] != nil;
615+
616+
if (!hasPhotoLibraryUsageDescription) {
617+
ApptentiveLogError(@"No Photo Library Usage Description Set. This will cause your app to be rejected during app review.");
618+
}
619+
620+
BOOL hasAppIDSet = self.appID != nil;
621+
622+
if (!hasAppIDSet) {
623+
ApptentiveLogError(@"No App ID set. This may keep the ratings prompt from directing users to your app in the App Store.");
624+
}
625+
626+
BOOL hasResources = [Apptentive resourceBundle] != nil;
627+
628+
if (!hasResources) {
629+
ApptentiveLogError(@"Missing resources.");
630+
#if APPTENTIVE_COCOAPODS
631+
ApptentiveLogError(@"Try cleaning derived data and/or `pod deintegrate && pod install`.");
632+
#else
633+
ApptentiveLogError(@"Please make sure the resources are added to the appropriate target(s).");
634+
#endif
635+
}
636+
}
637+
#endif
638+
612639
@end
613640

614641

ApptentiveConnect/source/Persistence/ApptentiveBackend.m

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
#import "ApptentiveEngagementBackend.h"
2727
#import "ApptentiveMessageCenterViewController.h"
2828

29-
#if APPTENTIVE_DEBUG
30-
#import "Apptentive+Debugging.h"
31-
#endif
32-
3329
typedef NS_ENUM(NSInteger, ATBackendState) {
3430
ATBackendStateStarting,
3531
ATBackendStateWaitingForDataProtectionUnlock,

0 commit comments

Comments
 (0)