Browse Source

Fixed some warnings in the macOS and iOS push notifications code

tags/2021-05-28
ed 6 years ago
parent
commit
23f211ab35
2 changed files with 10 additions and 6 deletions
  1. +4
    -2
      modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp
  2. +6
    -4
      modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp

+ 4
- 2
modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp View File

@@ -300,7 +300,9 @@ namespace PushNotificationsDelegateDetails
if (n.fireDate != nil)
{
NSDate* dateNow = [NSDate date];
notif.triggerIntervalSec = [dateNow timeIntervalSinceDate: n.fireDate];
NSDate* fireDate = n.fireDate;
notif.triggerIntervalSec = [dateNow timeIntervalSinceDate: fireDate];
}
notif.soundToPlay = URL (nsStringToJuce (n.soundName));
@@ -849,7 +851,7 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
{
NSMutableString* hexString = [NSMutableString stringWithCapacity: (length * 2)];
for (int i = 0; i < length; ++i)
for (NSUInteger i = 0; i < length; ++i)
[hexString appendFormat:@"%02x", buffer[i]];
return nsStringToJuce ([hexString copy]);


+ 6
- 4
modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp View File

@@ -151,7 +151,9 @@ namespace PushNotificationsDelegateDetailsOsx
else
{
NSDate* dateNow = [NSDate date];
notif.triggerIntervalSec = [dateNow timeIntervalSinceDate: n.deliveryDate];
NSDate* deliveryDate = n.deliveryDate;
notif.triggerIntervalSec = [dateNow timeIntervalSinceDate: deliveryDate];
}
notif.soundToPlay = URL (nsStringToJuce (n.soundName));
@@ -367,7 +369,7 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
NSRemoteNotificationType types = NSUInteger ((bool) settings.allowBadge);
if (isAtLeastMountainLion)
types |= ((bool) settings.allowSound << 1 | (bool) settings.allowAlert << 2);
types |= (NSUInteger) ((bool) settings.allowSound << 1 | (bool) settings.allowAlert << 2);
[[NSApplication sharedApplication] registerForRemoteNotificationTypes: types];
}
@@ -477,7 +479,7 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
{
NSMutableString* hexString = [NSMutableString stringWithCapacity: (length * 2)];
for (int i = 0; i < length; ++i)
for (NSUInteger i = 0; i < length; ++i)
[hexString appendFormat:@"%02x", buffer[i]];
return nsStringToJuce ([hexString copy]);
@@ -530,7 +532,7 @@ struct PushNotifications::Pimpl : private PushNotificationsDelegate
}
}
bool shouldPresentNotification (NSUserNotification* notification) override { return true; }
bool shouldPresentNotification (NSUserNotification*) override { return true; }
void subscribeToTopic (const String& topic) { ignoreUnused (topic); }
void unsubscribeFromTopic (const String& topic) { ignoreUnused (topic); }


Loading…
Cancel
Save