Skip to content

Fixed source code warnings because of iOS 8 checks #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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