Skip to content

Commit

Permalink
Fixes for iOS release (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianBatchelder authored May 2, 2017
1 parent f1a74c9 commit bb4bb16
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AirshipKit/AirshipKit/UAAutomation.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#import "UAJSONPredicate.h"
#import "UAPreferenceDataStore+Internal.h"

NSUInteger const UAAutomationScheduleLimit = 1000;
NSUInteger const UAAutomationScheduleLimit = 100;
NSString *const UAAutomationEnabled = @"UAAutomationEnabled";

@implementation UAAutomation
Expand Down
6 changes: 2 additions & 4 deletions AirshipKit/AirshipKit/UAPush.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,17 @@ static const UANotificationOptions UANotificationOptionNone = 0;
* Called when the UIApplicationDelegate's application:didRegisterForRemoteNotificationsWithDeviceToken:
* delegate method is called.
*
* @param application The application instance.
* @param deviceToken The APNS device token.
*/
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void)apnsRegistrationSucceededWithDeviceToken:(NSData *)deviceToken;

/**
* Called when the UIApplicationDelegate's application:didFailToRegisterForRemoteNotificationsWithError:
* delegate method is called.
*
* @param application The application instance.
* @param error An NSError object that encapsulates information why registration did not succeed.
*/
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void)apnsRegistrationFailedWithError:(NSError *)error;

@end

Expand Down
8 changes: 4 additions & 4 deletions AirshipKit/AirshipKit/UAPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio

dispatch_async(dispatch_get_main_queue(), ^{
id strongDelegate = self.registrationDelegate;
if ([strongDelegate respondsToSelector:@selector(application:didRegisterForRemoteNotificationsWithDeviceToken:)]) {
[strongDelegate application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
if ([strongDelegate respondsToSelector:@selector(apnsRegistrationSucceededWithDeviceToken:)]) {
[strongDelegate apnsRegistrationSucceededWithDeviceToken:deviceToken];
}
});
}
Expand All @@ -657,8 +657,8 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
dispatch_async(dispatch_get_main_queue(), ^{
id strongDelegate = self.registrationDelegate;
if ([strongDelegate respondsToSelector:@selector(application:didRegisterForRemoteNotificationsWithDeviceToken:)]) {
[strongDelegate application:application didFailToRegisterForRemoteNotificationsWithError:error];
if ([strongDelegate respondsToSelector:@selector(apnsRegistrationFailedWithError:)]) {
[strongDelegate apnsRegistrationFailedWithError:error];
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions AirshipKit/AirshipKitTests/UAPushTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ -(void)testPushForwardsDidRegisterForRemoteNotificationsWithDeviceTokenToRegistr

[[[self.mockRegistrationDelegate expect] andDo:^(NSInvocation *invocation) {
[delegateCalled fulfill];
}] application:self.mockedApplication didRegisterForRemoteNotificationsWithDeviceToken:self.validAPNSDeviceToken];
}] apnsRegistrationSucceededWithDeviceToken:self.validAPNSDeviceToken];

// Expect UAPush to update its registration
[[[self.mockedChannelRegistrar expect] ignoringNonObjectArgs] registerWithChannelID:OCMOCK_ANY
Expand Down Expand Up @@ -760,7 +760,7 @@ -(void)testPushForwardsDidRegisterForRemoteNotificationsWithDeviceTokenToRegistr

[[[self.mockRegistrationDelegate expect] andDo:^(NSInvocation *invocation) {
[delegateCalled fulfill];
}] application:self.mockedApplication didRegisterForRemoteNotificationsWithDeviceToken:self.validAPNSDeviceToken];
}] apnsRegistrationSucceededWithDeviceToken:self.validAPNSDeviceToken];

// Expect UAPush to not update its registration
[[[self.mockedChannelRegistrar expect] ignoringNonObjectArgs] registerWithChannelID:OCMOCK_ANY
Expand Down Expand Up @@ -793,7 +793,7 @@ -(void)testPushForwardsDidFailToRegisterForRemoteNotificationsWithDeviceTokenToR

[[[self.mockRegistrationDelegate expect] andDo:^(NSInvocation *invocation) {
[delegateCalled fulfill];
}] application:self.mockedApplication didFailToRegisterForRemoteNotificationsWithError:error];
}] apnsRegistrationFailedWithError:error];

[self.push application:self.mockedApplication didFailToRegisterForRemoteNotificationsWithError:error];

Expand Down

0 comments on commit bb4bb16

Please sign in to comment.