Ich versuche in meiner App eine Badge-Anzeige am Icon hinzubekommen. Klappt nicht.
Ich registriere in der didFinishLaunchingWithOptions folgendes:
Alles anzeigen
auf meinen Testgerät mit IOS8.3 kommt die 1 aus Zeile 6 - somit dürfte doch die Registrierung für den Empfang der Mitteilungen geklappt haben.
Wenn ich nun versuche die Badge-Anzeige zu verändern bzw. erstmals zu setzen mit:
oder mit:
erhalte ich die Fehlermeldung:
Attempting to badge the application icon but haven't received permission from the user to badge the application
Also fehlt doch die Erlaubnis zu Empfang der Notification?
Was mache ich falsch?
Ich registriere in der didFinishLaunchingWithOptions folgendes:
C-Quellcode
- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
- if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
- UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
- [application registerUserNotificationSettings:settings];
- [application registerForRemoteNotifications];
- NSLog(@"1");
- } else {
- NSLog(@"2");
- [application registerForRemoteNotificationTypes: UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge];
- }
- #else
- NSLog(@"3");
- [application registerForRemoteNotificationTypes: UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge];
- #endif
Wenn ich nun versuche die Badge-Anzeige zu verändern bzw. erstmals zu setzen mit:
oder mit:
Attempting to badge the application icon but haven't received permission from the user to badge the application
Also fehlt doch die Erlaubnis zu Empfang der Notification?
Was mache ich falsch?