Skip to content

Commit

Permalink
Move SDK check out of debug framework
Browse files Browse the repository at this point in the history
  • Loading branch information
frankus committed Nov 26, 2016
1 parent fb7cbfd commit 242af21
Show file tree
Hide file tree
Showing 7 changed files with 490 additions and 1,168 deletions.
1 change: 0 additions & 1 deletion ApptentiveConnect/debug/Apptentive+Debugging.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)presentInteractionAtIndex:(NSInteger)index fromViewController:(UIViewController *)viewController;
- (void)presentInteractionWithJSON:(NSDictionary *)JSON fromViewController:(UIViewController *)viewController;

- (void)checkSDKConfiguration;
- (void)resetSDK;

@end
Expand Down
25 changes: 0 additions & 25 deletions ApptentiveConnect/debug/Apptentive+Debugging.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,4 @@ - (void)resetSDK {
[self setValue:nil forKey:@"engagementBackend"];
}

- (void)checkSDKConfiguration {
BOOL hasPhotoLibraryUsageDescription = [[NSBundle mainBundle].infoDictionary objectForKey:@"NSPhotoLibraryUsageDescription"] != nil;

if (!hasPhotoLibraryUsageDescription) {
ApptentiveLogError(@"No Photo Library Usage Description Set. This will cause your app to be rejected during app review.");
}

BOOL hasAppIDSet = self.appID != nil;

if (!hasAppIDSet) {
ApptentiveLogError(@"No App ID set. This may keep the ratings prompt from directing users to your app in the App Store.");
}

BOOL hasResources = [Apptentive resourceBundle] != nil;

if (!hasResources) {
ApptentiveLogError(@"Missing resources.");
#if APPTENTIVE_COCOAPODS
ApptentiveLogError(@"Try cleaning derived data and/or `pod deintegrate && pod install`.");
#else
ApptentiveLogError(@"Please make sure the resources are added to the appropriate target(s).");
#endif
}
}

@end
4 changes: 4 additions & 0 deletions ApptentiveConnect/source/Apptentive.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ Returns a Boolean value indicating whether the given event will cause an Interac

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

#if APPTENTIVE_DEBUG
- (void)checkSDKConfiguration;
#endif

@end

/**
Expand Down
27 changes: 27 additions & 0 deletions ApptentiveConnect/source/Apptentive.m
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,33 @@ - (void)setAPIKey:(NSString *)APIKey baseURL:(NSURL *)baseURL {
}
}

#if APPTENTIVE_DEBUG
- (void)checkSDKConfiguration {
BOOL hasPhotoLibraryUsageDescription = [[NSBundle mainBundle].infoDictionary objectForKey:@"NSPhotoLibraryUsageDescription"] != nil;

if (!hasPhotoLibraryUsageDescription) {
ApptentiveLogError(@"No Photo Library Usage Description Set. This will cause your app to be rejected during app review.");
}

BOOL hasAppIDSet = self.appID != nil;

if (!hasAppIDSet) {
ApptentiveLogError(@"No App ID set. This may keep the ratings prompt from directing users to your app in the App Store.");
}

BOOL hasResources = [Apptentive resourceBundle] != nil;

if (!hasResources) {
ApptentiveLogError(@"Missing resources.");
#if APPTENTIVE_COCOAPODS
ApptentiveLogError(@"Try cleaning derived data and/or `pod deintegrate && pod install`.");
#else
ApptentiveLogError(@"Please make sure the resources are added to the appropriate target(s).");
#endif
}
}
#endif

@end


Expand Down
4 changes: 0 additions & 4 deletions ApptentiveConnect/source/Persistence/ApptentiveBackend.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#import "ApptentiveEngagementBackend.h"
#import "ApptentiveMessageCenterViewController.h"

#if APPTENTIVE_DEBUG
#import "Apptentive+Debugging.h"
#endif

typedef NS_ENUM(NSInteger, ATBackendState) {
ATBackendStateStarting,
ATBackendStateWaitingForDataProtectionUnlock,
Expand Down
Loading

0 comments on commit 242af21

Please sign in to comment.