Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

badge count frozen #240

Closed
ackman678 opened this issue Dec 6, 2014 · 1 comment
Closed

badge count frozen #240

ackman678 opened this issue Dec 6, 2014 · 1 comment

Comments

@ackman678
Copy link

The icon Badge Count is frozen and won't change.

iOS 8.1.1, iPhone 5s

Shows count 3 event though I have Badge Count set to Priority A Tasks, but there are only two Priority A tasks in the file:

img_3257
img_3258
img_3259

Then setting the Badge Count to 'none' doesn't change anything:

img_3261
img_3262

Tried making edits to todo.txt file, but this doesn't force update either:

img_3263
img_3264

Deleting and reinstalling the app through iCloud doesn't fix it either.

@ackman678
Copy link
Author

The error was:

Attempting to badge the application icon but haven't received permission from the user to badge the application

Adding ability to register for the iOS 8 Notifications fixed it as discussed on stackoverflow

Added the following within TodoTxtAppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // registering for remote notifications
    [self registerForRemoteNotification];

...and

- (void)registerForRemoteNotification {
    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
        UIUserNotificationType types = UIUserNotificationTypeSound | UIUserNotificationTypeBadge | UIUserNotificationTypeAlert;
        UIUserNotificationSettings *notificationSettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
        [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
    } else {
        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
    }
}

#ifdef __IPHONE_8_0
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
    [application registerForRemoteNotifications];
}
#endif

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant