Skip to content

Commit

Permalink
Add support for Web Push
Browse files Browse the repository at this point in the history
Safari can setup Web Push notifications. Those
differ from both Mac Push Notification and iOS
notifications in that they are configured and
prompted from Safari - and are managed by Safari.

I have created a few certificates using the online
console as development, but Apple doesn’t seem to
support the Sandbox for Web Push.
  • Loading branch information
Ómar Kjartan Yasin committed Oct 20, 2015
1 parent 97b9f54 commit 8ce6167
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/NWSecTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ typedef NS_ENUM(NSInteger, NWCertType) {
kNWCertTypeMacDevelopment = 3,
/** OS X Production. */
kNWCertTypeMacProduction = 4,
/** Web Push Production. */
kNWCertTypeWebProduction = 5,
/** Unknown. */
kNWCertTypeUnknown = 5,
kNWCertTypeUnknown = 6,
};


Expand Down Expand Up @@ -125,6 +127,7 @@ + (BOOL)isSandboxCertificate:(NWCertificateRef)certificate
return YES;
case kNWCertTypeIOSProduction:
case kNWCertTypeMacProduction:
case kNWCertTypeWebProduction:
case kNWCertTypeNone:
case kNWCertTypeUnknown:
break;
Expand All @@ -139,6 +142,7 @@ + (BOOL)isPushCertificate:(NWCertificateRef)certificate
case kNWCertTypeMacDevelopment:
case kNWCertTypeIOSProduction:
case kNWCertTypeMacProduction:
case kNWCertTypeWebProduction:
return YES;
case kNWCertTypeNone:
case kNWCertTypeUnknown:
Expand All @@ -154,6 +158,7 @@ + (NSString *)prefixWithCertType:(NWCertType)type
case kNWCertTypeIOSProduction: return @"Apple Production IOS Push Services: ";
case kNWCertTypeMacDevelopment: return @"Apple Development Mac Push Services: ";
case kNWCertTypeMacProduction: return @"Apple Production Mac Push Services: ";
case kNWCertTypeWebProduction: return @"Website Push ID: ";
case kNWCertTypeNone:
case kNWCertTypeUnknown:
break;
Expand Down

0 comments on commit 8ce6167

Please sign in to comment.