2
0

Push notification support on macOS.

This commit is contained in:
Maarten Billemont 2020-04-06 23:11:36 -04:00
parent 4b5c696241
commit a91e65f72f
2 changed files with 6 additions and 1 deletions

View File

@ -125,7 +125,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
countlyConfig.host = @"https://countly.lyndir.com"; countlyConfig.host = @"https://countly.lyndir.com";
countlyConfig.appKey = decrypt( countlyKey ); countlyConfig.appKey = decrypt( countlyKey );
countlyConfig.features = @[ CLYPushNotifications ]; countlyConfig.features = @[ CLYPushNotifications ];
countlyConfig.requiresConsent = YES; //countlyConfig.requiresConsent = YES; // FIXME: https://support.count.ly/hc/en-us/community/posts/900000930423-Notifications-on-macOS
countlyConfig.alwaysUsePOST = YES; countlyConfig.alwaysUsePOST = YES;
countlyConfig.deviceID = [PearlKeyChain deviceIdentifier]; countlyConfig.deviceID = [PearlKeyChain deviceIdentifier];
countlyConfig.secretSalt = decrypt( countlySalt ); countlyConfig.secretSalt = decrypt( countlySalt );
@ -137,6 +137,9 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
countlyConfig.enableDebug = NO; countlyConfig.enableDebug = NO;
#endif #endif
[Countly.sharedInstance startWithConfig:countlyConfig]; [Countly.sharedInstance startWithConfig:countlyConfig];
[Countly.sharedInstance giveConsentForFeature:CLYConsentPushNotifications];
[Countly.sharedInstance askForNotificationPermission];
} }
@catch (id exception) { @catch (id exception) {
err( @"During Analytics Setup: %@", exception ); err( @"During Analytics Setup: %@", exception );

View File

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>com.apple.developer.aps-environment</key>
<string>development</string>
<key>com.apple.security.app-sandbox</key> <key>com.apple.security.app-sandbox</key>
<true/> <true/>
<key>com.apple.security.application-groups</key> <key>com.apple.security.application-groups</key>