Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions ZeroPush-iOS/ZeroPush.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
*/
+ (NSString *)deviceTokenFromData:(NSData *)tokenData;

/**
* A convenience wrapper for [[UIApplication sharedApplication] registerForRemoteNotificationTypes:types];
* deprecated in iOS7
*/
- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types;

/**
* Preferred method for registering for notifications. Backwards compatible with iOS7
*/
Expand Down
13 changes: 4 additions & 9 deletions ZeroPush-iOS/ZeroPush.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,19 @@ -(id)init {
return self;
}

- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types;
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:types];
}

- (void)registerForRemoteNotifications
{
#ifdef __IPHONE_8_0
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
#else
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
else
#endif
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
}

- (NSDictionary *)userInfoForData:(id)data andResponse:(NSHTTPURLResponse *)response
Expand Down