mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Windowing: Fix deprecation warnings for iOS 17
This commit is contained in:
parent
dbe74e9f5d
commit
eb6ebaf5af
2 changed files with 20 additions and 6 deletions
|
|
@ -75,10 +75,7 @@
|
|||
#endif
|
||||
|
||||
#elif JUCE_IOS
|
||||
#if JUCE_PUSH_NOTIFICATIONS
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#endif
|
||||
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
|
||||
#import <MetalKit/MetalKit.h>
|
||||
#import <UIKit/UIActivityViewController.h>
|
||||
|
|
|
|||
|
|
@ -168,10 +168,27 @@ namespace juce
|
|||
app->resumed();
|
||||
}
|
||||
|
||||
struct BadgeUpdateTrait
|
||||
{
|
||||
#if defined (__IPHONE_16_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_16_0
|
||||
API_AVAILABLE (ios (16))
|
||||
static void newFn (UIApplication*)
|
||||
{
|
||||
[[UNUserNotificationCenter currentNotificationCenter] setBadgeCount: 0 withCompletionHandler: nil];
|
||||
}
|
||||
#endif
|
||||
|
||||
static void oldFn (UIApplication* app)
|
||||
{
|
||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||
app.applicationIconBadgeNumber = 0;
|
||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||
}
|
||||
};
|
||||
|
||||
- (void) applicationDidBecomeActive: (UIApplication*) application
|
||||
{
|
||||
application.applicationIconBadgeNumber = 0;
|
||||
|
||||
ifelse_17_0<BadgeUpdateTrait> (application);
|
||||
isIOSAppActive = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue