Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c91a8e08c4 | |||
| 6a8a48dfd9 | |||
| 5b46a5c6de | |||
| a854649e09 | |||
| 36de866909 | |||
| 9371147fd1 | |||
| 60288f8454 | |||
| 5b4a2e5e94 | |||
| 2d1b534f4d | |||
| 26d42ca585 | |||
| 900b107dc0 | |||
| 65738cad39 | |||
| ff5768048c | |||
| 9b6770afe1 | |||
| b4c0e1e72b | |||
| 5bab81d099 | |||
| 3622125a62 | |||
| 4850bfbb38 | |||
| 9dd461a972 | |||
| 0469f7ae05 | |||
| fc18d96ff4 | |||
| bd5d2e80f5 | |||
| bdbeb1be5f | |||
| d0868e486c | |||
| 766aee9700 | |||
| 8c4e208eda | |||
| 9325a4ac64 | |||
| bee2611e60 | |||
| e638a42547 | |||
| a8c6176b04 | |||
| b5d1acba22 | |||
| 7474d4fba4 | |||
| 9570efd717 | |||
| 671c168e56 | |||
| dd354b9629 | |||
| a8cd4e598d | |||
| 2458c41eb6 | |||
| a4215b3f06 | |||
| 0078f3d9fe | |||
| 57be4eecd9 | |||
| 504ab4d111 | |||
| 4f83e4ae03 | |||
| fee9e1ba80 | |||
| d4af68951f | |||
| 49ca3dd04a | |||
| 8ce6167bf2 | |||
| 97b9f54d60 | |||
| 4bf0730f90 | |||
| 1d88d5284d | |||
| f1fc60312a | |||
| 911d456b2d | |||
| 6bf99f4906 | |||
| 95e1e2c90d | |||
| 7e623e8ece | |||
| d92a31d302 |
+45
@@ -3,6 +3,51 @@ Change Log
|
||||
|
||||
### master (unreleased)
|
||||
|
||||
* add certificate type to description
|
||||
|
||||
### 0.7.5 (2017-04-25)
|
||||
|
||||
* Add support for new certificate type (passes)
|
||||
* Fix rich text (#49)
|
||||
* Fix app name (#47)
|
||||
* Update docs pushing to macOS
|
||||
|
||||
### 0.7.4 (2017-01-16)
|
||||
|
||||
* Add support for handshake error (internal error)
|
||||
* Add detection of p12 without password
|
||||
|
||||
### 0.7.3 (2016-09-19)
|
||||
|
||||
* Add support for Watch Kit certificates (DanielFontes)
|
||||
* Add support for handshake error (certificate unknown)
|
||||
|
||||
### 0.7.2 (2016-07-19)
|
||||
|
||||
* Added support for Carthage, thanks to @zats
|
||||
|
||||
### 0.7.1 (2016-04-27)
|
||||
|
||||
* Remove Mac enum from Touch target
|
||||
|
||||
### 0.7.0 (2016-01-07)
|
||||
|
||||
* Add support for simplified certificates (pull request by 666tos)
|
||||
|
||||
### 0.6.4 (2015-12-20)
|
||||
|
||||
* Add support for new certificate types (web, simplified, voip)
|
||||
* Add support for handshake errors (dark wake and closed abort)
|
||||
|
||||
### 0.6.3 (2015-01-22)
|
||||
|
||||
* Add certificate expiration date to listing
|
||||
* Add expiration and revocation error message
|
||||
|
||||
### 0.6.2 (2015-01-15)
|
||||
|
||||
* Add underlying error reason code
|
||||
|
||||
### 0.6.1 (2015-01-14)
|
||||
|
||||
* Add SSL handshake error codes
|
||||
|
||||
+11
-4
@@ -53,18 +53,18 @@
|
||||
- (instancetype)initWithPusher:(NWPusher *)pusher delegate:(id<NWHubDelegate>)delegate;
|
||||
|
||||
/** Create, connect and returns an instance with delegate and identity. */
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Create, connect and returns an instance with delegate and identity. */
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** @name Connecting */
|
||||
|
||||
/** Connect the pusher using the identity to setup the SSL connection. */
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Connect the pusher using the PKCS #12 data to setup the SSL connection. */
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Reconnect with the server, to recover from a closed or defect connection. */
|
||||
- (BOOL)reconnectWithError:(NSError **)error;
|
||||
@@ -143,4 +143,11 @@
|
||||
*/
|
||||
- (BOOL)trimIdentifiers;
|
||||
|
||||
// deprecated
|
||||
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
|
||||
@end
|
||||
|
||||
+30
-8
@@ -42,14 +42,14 @@
|
||||
|
||||
#pragma mark - Connecting
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [_pusher connectWithIdentity:identity error:error];
|
||||
return [_pusher connectWithIdentity:identity environment:environment error:error];
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [_pusher connectWithPKCS12Data:data password:password error:error];
|
||||
return [_pusher connectWithPKCS12Data:data password:password environment:environment error:error];
|
||||
}
|
||||
|
||||
- (BOOL)reconnectWithError:(NSError *__autoreleasing *)error
|
||||
@@ -62,16 +62,16 @@
|
||||
[_pusher disconnect];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWHub *hub = [[NWHub alloc] initWithDelegate:delegate];
|
||||
return identity && [hub connectWithIdentity:identity error:error] ? hub : nil;
|
||||
return identity && [hub connectWithIdentity:identity environment:environment error:error] ? hub : nil;
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWHub *hub = [[NWHub alloc] initWithDelegate:delegate];
|
||||
return data && [hub connectWithPKCS12Data:data password:password error:error] ? hub : nil;
|
||||
return data && [hub connectWithPKCS12Data:data password:password environment:environment error:error] ? hub : nil;
|
||||
}
|
||||
|
||||
#pragma mark - Pushing without NSError
|
||||
@@ -205,4 +205,26 @@
|
||||
return !!old.count;
|
||||
}
|
||||
|
||||
#pragma mark - Deprecated
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithIdentity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithPKCS12Data:data password:password environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate identity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithDelegate:delegate identity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithDelegate:(id<NWHubDelegate>)delegate PKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithDelegate:delegate identity:data environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,18 +27,18 @@
|
||||
/** @name Initialization */
|
||||
|
||||
/** Setup connection with feedback service based on identity. */
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Setup connection with feedback service based on PKCS #12 data. */
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** @name Connecting */
|
||||
|
||||
/** Connect with feedback service based on identity. */
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Connect with feedback service based on PKCS #12 data. */
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Disconnect from feedback service. The server will automatically drop the connection after all feedback data has been read. */
|
||||
- (void)disconnect;
|
||||
@@ -54,4 +54,11 @@
|
||||
/** Read all (or max) token-date pairs, where token is hex string. */
|
||||
- (NSArray *)readTokenDatePairsWithMax:(NSUInteger)max error:(NSError **)error;
|
||||
|
||||
// deprecated
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
|
||||
@end
|
||||
|
||||
+33
-10
@@ -20,10 +20,11 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
|
||||
#pragma mark - Connecting
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
if (_connection) [_connection disconnect]; _connection = nil;
|
||||
NSString *host = [NWSecTools isSandboxIdentity:identity] ? NWSandboxPushHost : NWPushHost;
|
||||
if (environment == NWEnvironmentAuto) environment = [NWSecTools environmentForIdentity:identity];
|
||||
NSString *host = (environment == NWEnvironmentSandbox) ? NWSandboxPushHost : NWPushHost;
|
||||
NWSSLConnection *connection = [[NWSSLConnection alloc] initWithHost:host port:NWPushPort identity:identity];
|
||||
BOOL connected = [connection connectWithError:error];
|
||||
if (!connected) {
|
||||
@@ -33,13 +34,13 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWIdentityRef identity = [NWSecTools identityWithPKCS12Data:data password:password error:error];
|
||||
if (!identity) {
|
||||
return NO;
|
||||
}
|
||||
return [self connectWithIdentity:identity error:error];
|
||||
return [self connectWithIdentity:identity environment:environment error:error];
|
||||
}
|
||||
|
||||
- (void)disconnect
|
||||
@@ -47,16 +48,16 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
[_connection disconnect]; _connection = nil;
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWPushFeedback *feedback = [[NWPushFeedback alloc] init];
|
||||
return identity && [feedback connectWithIdentity:identity error:error] ? feedback : nil;
|
||||
return identity && [feedback connectWithIdentity:identity environment:environment error:error] ? feedback : nil;
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWPushFeedback *feedback = [[NWPushFeedback alloc] init];
|
||||
return data && [feedback connectWithPKCS12Data:data password:password error:error] ? feedback : nil;
|
||||
return data && [feedback connectWithPKCS12Data:data password:password environment:environment error:error] ? feedback : nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +74,7 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
return read;
|
||||
}
|
||||
if (length != data.length) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorFeedbackLength error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorFeedbackLength reason:length error:error];
|
||||
}
|
||||
uint32_t time = 0;
|
||||
[data getBytes:&time range:NSMakeRange(0, 4)];
|
||||
@@ -82,7 +83,7 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
[data getBytes:&l range:NSMakeRange(4, 2)];
|
||||
NSUInteger tokenLength = htons(l);
|
||||
if (tokenLength != NWTokenMaxSize) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorFeedbackTokenLength error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorFeedbackTokenLength reason:tokenLength error:error];
|
||||
}
|
||||
*token = [data subdataWithRange:NSMakeRange(6, length - 6)];
|
||||
return YES;
|
||||
@@ -122,4 +123,26 @@ static NSUInteger const NWTokenMaxSize = 32;
|
||||
return pairs;
|
||||
}
|
||||
|
||||
#pragma mark - Deprecated
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithIdentity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithPKCS12Data:data password:password environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithIdentity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithPKCS12Data:data password:password environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+11
-4
@@ -32,18 +32,18 @@
|
||||
/** @name Initialization */
|
||||
|
||||
/** Creates, connects and returns a pusher object based on the provided identity. */
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Creates, connects and returns a pusher object based on the PKCS #12 data. */
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** @name Connecting */
|
||||
|
||||
/** Connect with the APNs using the identity. */
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Connect with the APNs using the identity from PKCS #12 data. */
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError **)error;
|
||||
|
||||
/** Reconnect using the same identity, disconnects if necessary. */
|
||||
- (BOOL)reconnectWithError:(NSError **)error;
|
||||
@@ -67,4 +67,11 @@
|
||||
/** Read back multiple notification identifiers of, up to max, failed pushes. */
|
||||
- (NSArray *)readFailedIdentifierErrorPairsWithMax:(NSUInteger)max error:(NSError **)error;
|
||||
|
||||
// deprecated
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError **)error __deprecated;
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError **)error __deprecated;
|
||||
|
||||
@end
|
||||
|
||||
+34
-11
@@ -19,10 +19,11 @@ static NSUInteger const NWPushPort = 2195;
|
||||
|
||||
#pragma mark - Connecting
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
if (_connection) [_connection disconnect]; _connection = nil;
|
||||
NSString *host = [NWSecTools isSandboxIdentity:identity] ? NWSandboxPushHost : NWPushHost;
|
||||
if (environment == NWEnvironmentAuto) environment = [NWSecTools environmentForIdentity:identity];
|
||||
NSString *host = (environment == NWEnvironmentSandbox) ? NWSandboxPushHost : NWPushHost;
|
||||
NWSSLConnection *connection = [[NWSSLConnection alloc] initWithHost:host port:NWPushPort identity:identity];
|
||||
BOOL connected = [connection connectWithError:error];
|
||||
if (!connected) {
|
||||
@@ -32,13 +33,13 @@ static NSUInteger const NWPushPort = 2195;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWIdentityRef identity = [NWSecTools identityWithPKCS12Data:data password:password error:error];
|
||||
if (!identity) {
|
||||
return NO;
|
||||
}
|
||||
return [self connectWithIdentity:identity error:error];
|
||||
return [self connectWithIdentity:identity environment:environment error:error];
|
||||
}
|
||||
|
||||
- (BOOL)reconnectWithError:(NSError *__autoreleasing *)error
|
||||
@@ -54,16 +55,16 @@ static NSUInteger const NWPushPort = 2195;
|
||||
[_connection disconnect]; _connection = nil;
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWPusher *pusher = [[NWPusher alloc] init];
|
||||
return identity && [pusher connectWithIdentity:identity error:error] ? pusher : nil;
|
||||
return identity && [pusher connectWithIdentity:identity environment:environment error:error] ? pusher : nil;
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password environment:(NWEnvironment)environment error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NWPusher *pusher = [[NWPusher alloc] init];
|
||||
return data && [pusher connectWithPKCS12Data:data password:password error:error] ? pusher : nil;
|
||||
return data && [pusher connectWithPKCS12Data:data password:password environment:environment error:error] ? pusher : nil;
|
||||
}
|
||||
|
||||
#pragma mark - Pushing payload
|
||||
@@ -82,7 +83,7 @@ static NSUInteger const NWPushPort = 2195;
|
||||
return written;
|
||||
}
|
||||
if (length != data.length) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorPushWriteFail error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorPushWriteFail reason:length error:error];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
@@ -101,7 +102,7 @@ static NSUInteger const NWPushPort = 2195;
|
||||
uint8_t command = 0;
|
||||
[data getBytes:&command range:NSMakeRange(0, 1)];
|
||||
if (command != 8) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorPushResponseCommand error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorPushResponseCommand reason:command error:error];
|
||||
}
|
||||
uint8_t status = 0;
|
||||
[data getBytes:&status range:NSMakeRange(1, 1)];
|
||||
@@ -118,7 +119,7 @@ static NSUInteger const NWPushPort = 2195;
|
||||
case 7: [NWErrorUtil noWithErrorCode:kNWErrorAPNInvalidPayloadSize error:apnError]; break;
|
||||
case 8: [NWErrorUtil noWithErrorCode:kNWErrorAPNInvalidTokenContent error:apnError]; break;
|
||||
case 10: [NWErrorUtil noWithErrorCode:kNWErrorAPNShutdown error:apnError]; break;
|
||||
default: [NWErrorUtil noWithErrorCode:kNWErrorAPNUnknownErrorCode error:apnError]; break;
|
||||
default: [NWErrorUtil noWithErrorCode:kNWErrorAPNUnknownErrorCode reason:status error:apnError]; break;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
@@ -141,4 +142,26 @@ static NSUInteger const NWPushPort = 2195;
|
||||
return pairs;
|
||||
}
|
||||
|
||||
#pragma mark - Deprecated
|
||||
|
||||
- (BOOL)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithIdentity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
- (BOOL)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithPKCS12Data:data password:password environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithIdentity:(NWIdentityRef)identity error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithIdentity:identity environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
+ (instancetype)connectWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self connectWithPKCS12Data:data password:password environment:NWEnvironmentAuto error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+19
-11
@@ -68,7 +68,7 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
{
|
||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketCreate error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketCreate reason:sock error:error];
|
||||
}
|
||||
struct sockaddr_in addr;
|
||||
memset(&addr, 0, sizeof(struct sockaddr_in));
|
||||
@@ -83,15 +83,15 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
addr.sin_family = AF_INET;
|
||||
int conn = connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
|
||||
if (conn < 0) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketConnect error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketConnect reason:conn error:error];
|
||||
}
|
||||
int cntl = fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
if (cntl < 0) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketFileControl error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketFileControl reason:cntl error:error];
|
||||
}
|
||||
int set = 1, sopt = setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int));
|
||||
if (sopt < 0) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketOptions error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSocketOptions reason:sopt error:error];
|
||||
}
|
||||
_socket = sock;
|
||||
return YES;
|
||||
@@ -105,19 +105,19 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
}
|
||||
OSStatus setio = SSLSetIOFuncs(context, NWSSLRead, NWSSLWrite);
|
||||
if (setio != errSecSuccess) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLIOFuncs error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLIOFuncs reason:setio error:error];
|
||||
}
|
||||
OSStatus setconn = SSLSetConnection(context, (SSLConnectionRef)(NSInteger)_socket);
|
||||
if (setconn != errSecSuccess) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLConnection error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLConnection reason:setconn error:error];
|
||||
}
|
||||
OSStatus setpeer = SSLSetPeerDomainName(context, _host.UTF8String, strlen(_host.UTF8String));
|
||||
if (setpeer != errSecSuccess) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLPeerDomainName error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLPeerDomainName reason:setpeer error:error];
|
||||
}
|
||||
OSStatus setcert = SSLSetCertificate(context, (__bridge CFArrayRef)@[_identity]);
|
||||
if (setcert != errSecSuccess) {
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLCertificate error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLCertificate reason:setcert error:error];
|
||||
}
|
||||
_context = context;
|
||||
return YES;
|
||||
@@ -140,8 +140,16 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
case errSSLXCertChainInvalid: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeXCertChainInvalid error:error];
|
||||
case errSSLClientCertRequested: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeClientCertRequested error:error];
|
||||
case errSSLServerAuthCompleted: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeServerAuthCompleted error:error];
|
||||
case errSSLPeerCertExpired: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertExpired error:error];
|
||||
case errSSLPeerCertRevoked: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertRevoked error:error];
|
||||
case errSSLPeerCertUnknown: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakePeerCertUnknown error:error];
|
||||
case errSSLInternal: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeInternalError error:error];
|
||||
#if !TARGET_OS_IPHONE
|
||||
case errSecInDarkWake: return [NWErrorUtil noWithErrorCode:kNWErrorSSLInDarkWake error:error];
|
||||
#endif
|
||||
case errSSLClosedAbort: return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeClosedAbort error:error];
|
||||
}
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeFail error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorSSLHandshakeFail reason:status error:error];
|
||||
}
|
||||
|
||||
- (void)disconnect
|
||||
@@ -166,7 +174,7 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
case errSSLClosedAbort: return [NWErrorUtil noWithErrorCode:kNWErrorReadClosedAbort error:error];
|
||||
case errSSLClosedGraceful: return [NWErrorUtil noWithErrorCode:kNWErrorReadClosedGraceful error:error];
|
||||
}
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorReadFail error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorReadFail reason:status error:error];
|
||||
}
|
||||
|
||||
- (BOOL)write:(NSData *)data length:(NSUInteger *)length error:(NSError *__autoreleasing *)error
|
||||
@@ -182,7 +190,7 @@ OSStatus NWSSLWrite(SSLConnectionRef connection, const void *data, size_t *lengt
|
||||
case errSSLClosedAbort: return [NWErrorUtil noWithErrorCode:kNWErrorWriteClosedAbort error:error];
|
||||
case errSSLClosedGraceful: return [NWErrorUtil noWithErrorCode:kNWErrorWriteClosedGraceful error:error];
|
||||
}
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorWriteFail error:error];
|
||||
return [NWErrorUtil noWithErrorCode:kNWErrorWriteFail reason:status error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+22
-4
@@ -43,14 +43,17 @@
|
||||
|
||||
/** @name Inspection */
|
||||
|
||||
/** Extracts the type and summary string. */
|
||||
+ (NWCertType)typeWithCertificate:(NWCertificateRef)certificate summary:(NSString **)summary;
|
||||
|
||||
/** Extracts the summary string. */
|
||||
+ (NSString *)summaryWithCertificate:(NWCertificateRef)certificate;
|
||||
|
||||
/** Tells if the identity is for pushing to the Development (sandbox) server. */
|
||||
+ (BOOL)isSandboxIdentity:(NWIdentityRef)identity;
|
||||
/** Tells what environment options can be used with this identity (Development(sandbox)/Production server or both). */
|
||||
+ (NWEnvironmentOptions)environmentOptionsForIdentity:(NWIdentityRef)identity;
|
||||
|
||||
/** Tells if the certificate is for pushing to the Development (sandbox) server. */
|
||||
+ (BOOL)isSandboxCertificate:(NWCertificateRef)certificate;
|
||||
/** Tells what environment options can be used with this certificate (Development(sandbox)/Production server or both). */
|
||||
+ (NWEnvironmentOptions)environmentOptionsForCertificate:(NWCertificateRef)certificate;
|
||||
|
||||
/** Tells if the certificate can be used for connecting with APNs. */
|
||||
+ (BOOL)isPushCertificate:(NWCertificateRef)certificate;
|
||||
@@ -58,4 +61,19 @@
|
||||
/** Composes a dictionary describing the characteristics of the identity. */
|
||||
+ (NSDictionary *)inspectIdentity:(NWIdentityRef)identity;
|
||||
|
||||
#if !TARGET_OS_IPHONE
|
||||
/** Extracts the expiration date. */
|
||||
+ (NSDate *)expirationWithCertificate:(NWCertificateRef)certificate;
|
||||
|
||||
/** Extracts given properties of certificate, see `SecCertificateOIDs.h`, use `nil` to get all. */
|
||||
+ (NSDictionary *)valuesWithCertificate:(NWCertificateRef)certificate keys:(NSArray *)keys error:(NSError **)error;
|
||||
#endif
|
||||
|
||||
// deprecated
|
||||
|
||||
+ (BOOL)isSandboxIdentity:(NWIdentityRef)identity __deprecated;
|
||||
+ (BOOL)isSandboxCertificate:(NWCertificateRef)certificate __deprecated;
|
||||
+ (NWEnvironment)environmentForIdentity:(NWIdentityRef)identity;
|
||||
+ (NWEnvironment)environmentForCertificate:(NWCertificateRef)certificate;
|
||||
|
||||
@end
|
||||
|
||||
+89
-29
@@ -7,23 +7,6 @@
|
||||
|
||||
#import "NWSecTools.h"
|
||||
|
||||
/** Types of push certificates. */
|
||||
typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
/** None. */
|
||||
kNWCertTypeNone = 0,
|
||||
/** iOS Development. */
|
||||
kNWCertTypeIOSDevelopment = 1,
|
||||
/** iOS Production. */
|
||||
kNWCertTypeIOSProduction = 2,
|
||||
/** OS X Development. */
|
||||
kNWCertTypeMacDevelopment = 3,
|
||||
/** OS X Production. */
|
||||
kNWCertTypeMacProduction = 4,
|
||||
/** Unknown. */
|
||||
kNWCertTypeUnknown = 5,
|
||||
};
|
||||
|
||||
|
||||
@implementation NWSecTools
|
||||
|
||||
#pragma mark - Initialization
|
||||
@@ -38,7 +21,7 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12NoItems error:error];
|
||||
}
|
||||
if (identities.count > 1) {
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12MultipleItems error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12MultipleItems reason:identities.count error:error];
|
||||
}
|
||||
return identities.lastObject;
|
||||
}
|
||||
@@ -111,25 +94,33 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
return result;
|
||||
}
|
||||
|
||||
+ (BOOL)isSandboxIdentity:(NWIdentityRef)identity
|
||||
+ (NWEnvironmentOptions)environmentOptionsForIdentity:(NWIdentityRef)identity
|
||||
{
|
||||
NWCertificateRef certificate = [self certificateWithIdentity:identity error:nil];
|
||||
return [self isSandboxCertificate:certificate];
|
||||
return [self environmentOptionsForCertificate:certificate];
|
||||
}
|
||||
|
||||
+ (BOOL)isSandboxCertificate:(NWCertificateRef)certificate
|
||||
+ (NWEnvironmentOptions)environmentOptionsForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
switch ([self typeWithCertificate:certificate summary:nil]) {
|
||||
case kNWCertTypeIOSDevelopment:
|
||||
case kNWCertTypeMacDevelopment:
|
||||
return YES;
|
||||
return NWEnvironmentOptionSandbox;
|
||||
|
||||
case kNWCertTypeIOSProduction:
|
||||
case kNWCertTypeMacProduction:
|
||||
return NWEnvironmentOptionProduction;
|
||||
case kNWCertTypeSimplified:
|
||||
case kNWCertTypeWebProduction:
|
||||
case kNWCertTypeVoIPServices:
|
||||
case kNWCertTypeWatchKitServices:
|
||||
case kNWCertTypePasses:
|
||||
return NWEnvironmentOptionAny;
|
||||
case kNWCertTypeNone:
|
||||
case kNWCertTypeUnknown:
|
||||
break;
|
||||
}
|
||||
return NO;
|
||||
return NWEnvironmentOptionNone;
|
||||
}
|
||||
|
||||
+ (BOOL)isPushCertificate:(NWCertificateRef)certificate
|
||||
@@ -139,6 +130,11 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
case kNWCertTypeMacDevelopment:
|
||||
case kNWCertTypeIOSProduction:
|
||||
case kNWCertTypeMacProduction:
|
||||
case kNWCertTypeSimplified:
|
||||
case kNWCertTypeWebProduction:
|
||||
case kNWCertTypeVoIPServices:
|
||||
case kNWCertTypeWatchKitServices:
|
||||
case kNWCertTypePasses:
|
||||
return YES;
|
||||
case kNWCertTypeNone:
|
||||
case kNWCertTypeUnknown:
|
||||
@@ -154,6 +150,11 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
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 kNWCertTypeSimplified: return @"Apple Push Services: ";
|
||||
case kNWCertTypeWebProduction: return @"Website Push ID: ";
|
||||
case kNWCertTypeVoIPServices: return @"VoIP Services: ";
|
||||
case kNWCertTypeWatchKitServices: return @"WatchKit Services: ";
|
||||
case kNWCertTypePasses: return @"Pass Type ID: ";
|
||||
case kNWCertTypeNone:
|
||||
case kNWCertTypeUnknown:
|
||||
break;
|
||||
@@ -208,7 +209,7 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
OSStatus status = identity ? SecIdentityCopyCertificate((__bridge SecIdentityRef)identity, &cert) : errSecParam;
|
||||
NWCertificateRef certificate = CFBridgingRelease(cert);
|
||||
if (status != errSecSuccess || !cert) {
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorIdentityCopyCertificate error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorIdentityCopyCertificate reason:status error:error];
|
||||
}
|
||||
return certificate;
|
||||
}
|
||||
@@ -219,14 +220,14 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
OSStatus status = identity ? SecIdentityCopyPrivateKey((__bridge SecIdentityRef)identity, &k) : errSecParam;
|
||||
NWKeyRef key = CFBridgingRelease(k);
|
||||
if (status != errSecSuccess || !k) {
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorIdentityCopyPrivateKey error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorIdentityCopyPrivateKey reason:status error:error];
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
+ (NSArray *)allIdentitiesWithPKCS12Data:(NSData *)data password:(NSString *)password error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NSDictionary *options = @{(__bridge id)kSecImportExportPassphrase: password};
|
||||
NSDictionary *options = password ? @{(__bridge id)kSecImportExportPassphrase: password} : @{};
|
||||
CFArrayRef items = NULL;
|
||||
OSStatus status = data ? SecPKCS12Import((__bridge CFDataRef)data, (__bridge CFDictionaryRef)options, &items) : errSecParam;
|
||||
NSArray *dicts = CFBridgingRelease(items);
|
||||
@@ -236,9 +237,10 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
case errSecAuthFailed: return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12AuthFailed error:error];
|
||||
#if !TARGET_OS_IPHONE
|
||||
case errSecPkcs12VerifyFailure: return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12Password error:error];
|
||||
case errSecPassphraseRequired: return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12PasswordRequired error:error];
|
||||
#endif
|
||||
}
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12Import error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorPKCS12Import reason:status error:error];
|
||||
}
|
||||
return dicts;
|
||||
}
|
||||
@@ -251,7 +253,7 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)options, (CFTypeRef *)&certs);
|
||||
NSArray *certificates = CFBridgingRelease(certs);
|
||||
if (status != errSecSuccess || !certs) {
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorKeychainCopyMatching error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorKeychainCopyMatching reason:status error:error];
|
||||
}
|
||||
return certificates;
|
||||
}
|
||||
@@ -266,10 +268,68 @@ typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
switch (status) {
|
||||
case errSecItemNotFound: return [NWErrorUtil nilWithErrorCode:kNWErrorKeychainItemNotFound error:error];
|
||||
}
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorKeychainCreateIdentity error:error];
|
||||
return [NWErrorUtil nilWithErrorCode:kNWErrorKeychainCreateIdentity reason:status error:error];
|
||||
}
|
||||
return identity;
|
||||
}
|
||||
|
||||
+ (NSDate *)expirationWithCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
return [self valueWithCertificate:certificate key:(__bridge id)kSecOIDInvalidityDate];
|
||||
}
|
||||
|
||||
+ (id)valueWithCertificate:(NWCertificateRef)certificate key:(id)key
|
||||
{
|
||||
return [self valuesWithCertificate:certificate keys:@[key] error:nil][key][(__bridge id)kSecPropertyKeyValue];
|
||||
}
|
||||
|
||||
+ (NSDictionary *)valuesWithCertificate:(NWCertificateRef)certificate keys:(NSArray *)keys error:(NSError **)error
|
||||
{
|
||||
CFErrorRef e = NULL;
|
||||
NSDictionary *result = CFBridgingRelease(SecCertificateCopyValues((__bridge SecCertificateRef)certificate, (__bridge CFArrayRef)keys, &e));
|
||||
if (error) *error = CFBridgingRelease(e);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark - Deprecated
|
||||
|
||||
+ (BOOL)isSandboxIdentity:(NWIdentityRef)identity
|
||||
{
|
||||
return [self environmentForIdentity:identity] == NWEnvironmentSandbox;
|
||||
}
|
||||
|
||||
+ (BOOL)isSandboxCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
return [self environmentForCertificate:certificate] == NWEnvironmentSandbox;
|
||||
}
|
||||
|
||||
+ (NWEnvironment)environmentForIdentity:(NWIdentityRef)identity
|
||||
{
|
||||
NWCertificateRef certificate = [self certificateWithIdentity:identity error:nil];
|
||||
return [self environmentForCertificate:certificate];
|
||||
}
|
||||
|
||||
+ (NWEnvironment)environmentForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
switch ([self typeWithCertificate:certificate summary:nil]) {
|
||||
case kNWCertTypeIOSDevelopment:
|
||||
case kNWCertTypeMacDevelopment:
|
||||
return NWEnvironmentSandbox;
|
||||
|
||||
case kNWCertTypeIOSProduction:
|
||||
case kNWCertTypeMacProduction:
|
||||
return NWEnvironmentProduction;
|
||||
case kNWCertTypeSimplified:
|
||||
case kNWCertTypeWebProduction:
|
||||
case kNWCertTypeVoIPServices:
|
||||
case kNWCertTypeWatchKitServices:
|
||||
case kNWCertTypePasses:
|
||||
case kNWCertTypeNone:
|
||||
case kNWCertTypeUnknown:
|
||||
break;
|
||||
}
|
||||
return NWEnvironmentNone;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+66
-1
@@ -17,6 +17,32 @@ typedef NS_ENUM(NSInteger, NWNotificationType) {
|
||||
kNWNotificationType2 = 2,
|
||||
};
|
||||
|
||||
/** Types of push certificates. */
|
||||
typedef NS_ENUM(NSInteger, NWCertType) {
|
||||
/** None. */
|
||||
kNWCertTypeNone = 0,
|
||||
/** iOS Development. */
|
||||
kNWCertTypeIOSDevelopment = 1,
|
||||
/** iOS Production. */
|
||||
kNWCertTypeIOSProduction = 2,
|
||||
/** OS X Development. */
|
||||
kNWCertTypeMacDevelopment = 3,
|
||||
/** OS X Production. */
|
||||
kNWCertTypeMacProduction = 4,
|
||||
/** Simplified Certificate Handling. */
|
||||
kNWCertTypeSimplified = 5,
|
||||
/** Web Push Production. */
|
||||
kNWCertTypeWebProduction = 6,
|
||||
/** VoIP Services. */
|
||||
kNWCertTypeVoIPServices = 7,
|
||||
/** WatchKit Services. */
|
||||
kNWCertTypeWatchKitServices = 8,
|
||||
/** Pass Type ID. */
|
||||
kNWCertTypePasses = 9,
|
||||
/** Unknown. */
|
||||
kNWCertTypeUnknown = 10,
|
||||
};
|
||||
|
||||
/** An ARC-friendly replacement of SecIdentityRef. */
|
||||
typedef id NWIdentityRef;
|
||||
|
||||
@@ -97,7 +123,7 @@ typedef NS_ENUM(NSInteger, NWError) {
|
||||
kNWErrorSSLHandshakeUnknownRootCert = -223,
|
||||
/** SSL handshake chain not verifiable to root. */
|
||||
kNWErrorSSLHandshakeNoRootCert = -224,
|
||||
/** SSL handshake chain has expired certificates. */
|
||||
/** SSL handshake expired certificates. */
|
||||
kNWErrorSSLHandshakeCertExpired = -225,
|
||||
/** SSL handshake invalid certificate chain. */
|
||||
kNWErrorSSLHandshakeXCertChainInvalid = -226,
|
||||
@@ -105,6 +131,18 @@ typedef NS_ENUM(NSInteger, NWError) {
|
||||
kNWErrorSSLHandshakeClientCertRequested = -227,
|
||||
/** SSL handshake auth interrupted. */
|
||||
kNWErrorSSLHandshakeServerAuthCompleted = -228,
|
||||
/** SSL handshake certificate expired. */
|
||||
kNWErrorSSLHandshakePeerCertExpired = -229,
|
||||
/** SSL handshake certificate revoked. */
|
||||
kNWErrorSSLHandshakePeerCertRevoked = -230,
|
||||
/** SSL handshake certificate unknown. */
|
||||
kNWErrorSSLHandshakePeerCertUnknown = -233,
|
||||
/** SSL handshake internal error. */
|
||||
kNWErrorSSLHandshakeInternalError = -234,
|
||||
/** SSL handshake in dark wake. */
|
||||
kNWErrorSSLInDarkWake = -231,
|
||||
/** SSL handshake connection closed via error. */
|
||||
kNWErrorSSLHandshakeClosedAbort = -232,
|
||||
/** SSL handshake timeout. */
|
||||
kNWErrorSSLHandshakeTimeout = -218,
|
||||
|
||||
@@ -141,6 +179,8 @@ typedef NS_ENUM(NSInteger, NWError) {
|
||||
kNWErrorPKCS12AuthFailed = -312,
|
||||
/** PKCS12 data wrong password. */
|
||||
kNWErrorPKCS12Password = -313,
|
||||
/** PKCS12 data password required. */
|
||||
kNWErrorPKCS12PasswordRequired = -314,
|
||||
/** PKCS12 data contains no identities. */
|
||||
kNWErrorPKCS12NoItems = -307,
|
||||
/** PKCS12 data contains multiple identities. */
|
||||
@@ -154,18 +194,43 @@ typedef NS_ENUM(NSInteger, NWError) {
|
||||
kNWErrorKeychainCreateIdentity = -303,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, NWEnvironment) {
|
||||
NWEnvironmentNone = 0,
|
||||
NWEnvironmentSandbox = 1,
|
||||
NWEnvironmentProduction = 2,
|
||||
NWEnvironmentAuto = 3,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, NWEnvironmentOptions) {
|
||||
NWEnvironmentOptionNone = 0,
|
||||
NWEnvironmentOptionSandbox = 1 << NWEnvironmentSandbox,
|
||||
NWEnvironmentOptionProduction = 1 << NWEnvironmentProduction,
|
||||
NWEnvironmentOptionAny = NWEnvironmentOptionSandbox | NWEnvironmentOptionProduction
|
||||
};
|
||||
|
||||
/** NSError dictionary key for integer code that indicates underlying reason. */
|
||||
extern NSString * const NWErrorReasonCodeKey;
|
||||
|
||||
/** A collection of helper methods to support Cocoa-style error handling (`NSError`).
|
||||
|
||||
Most methods in this framework return `NO` or `nil` to indicate an error occurred. In that case an error object will be assigned. This class provides a mapping from codes to description string and some methods to instantiate the `NSError` object.
|
||||
*/
|
||||
|
||||
/** Returns string for given environment, for logging purposes */
|
||||
NSString * descriptionForEnvironentOptions(NWEnvironmentOptions environmentOptions);
|
||||
NSString * descriptionForEnvironent(NWEnvironment environment);
|
||||
NSString * descriptionForCertType(NWCertType type);
|
||||
|
||||
@interface NWErrorUtil : NSObject
|
||||
|
||||
/** @name Helpers */
|
||||
|
||||
/** Assigns the error with provided code and associated description, for returning `NO`. */
|
||||
+ (BOOL)noWithErrorCode:(NWError)code error:(NSError **)error;
|
||||
+ (BOOL)noWithErrorCode:(NWError)code reason:(NSInteger)reason error:(NSError **)error;
|
||||
|
||||
/** Assigns the error with provided code and associated description, for returning `nil`. */
|
||||
+ (id)nilWithErrorCode:(NWError)code error:(NSError **)error;
|
||||
+ (id)nilWithErrorCode:(NWError)code reason:(NSInteger)reason error:(NSError **)error;
|
||||
|
||||
@end
|
||||
|
||||
+67
-5
@@ -7,6 +7,48 @@
|
||||
|
||||
#import "NWType.h"
|
||||
|
||||
NSString * const NWErrorReasonCodeKey = @"NWErrorReasonCodeKey";
|
||||
|
||||
NSString * descriptionForEnvironentOptions(NWEnvironmentOptions environmentOptions)
|
||||
{
|
||||
switch (environmentOptions) {
|
||||
case NWEnvironmentOptionNone: return @"No environment";
|
||||
case NWEnvironmentOptionSandbox: return @"Sandbox";
|
||||
case NWEnvironmentOptionProduction: return @"Production";
|
||||
case NWEnvironmentOptionAny: return @"Sandbox|Production";
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString * descriptionForEnvironent(NWEnvironment environment)
|
||||
{
|
||||
switch (environment) {
|
||||
case NWEnvironmentNone: return @"none";
|
||||
case NWEnvironmentProduction: return @"production";
|
||||
case NWEnvironmentSandbox: return @"sandbox";
|
||||
case NWEnvironmentAuto: return @"auto";
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString * descriptionForCertType(NWCertType type)
|
||||
{
|
||||
switch (type) {
|
||||
case kNWCertTypeNone: return @"none";
|
||||
case kNWCertTypeIOSDevelopment:
|
||||
case kNWCertTypeIOSProduction: return @"iOS";
|
||||
case kNWCertTypeMacDevelopment:
|
||||
case kNWCertTypeMacProduction: return @"macOS";
|
||||
case kNWCertTypeSimplified: return @"All";
|
||||
case kNWCertTypeWebProduction: return @"Website";
|
||||
case kNWCertTypeVoIPServices: return @"VoIP";
|
||||
case kNWCertTypeWatchKitServices: return @"WatchKit";
|
||||
case kNWCertTypePasses: return @"Pass";
|
||||
case kNWCertTypeUnknown: return @"unknown";
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@implementation NWErrorUtil
|
||||
|
||||
+ (NSString *)stringWithCode:(NWError)code
|
||||
@@ -49,10 +91,16 @@
|
||||
case kNWErrorSSLHandshakeFail : return @"SSL handshake failed";
|
||||
case kNWErrorSSLHandshakeUnknownRootCert : return @"SSL handshake root not a known anchor";
|
||||
case kNWErrorSSLHandshakeNoRootCert : return @"SSL handshake chain not verifiable to root";
|
||||
case kNWErrorSSLHandshakeCertExpired : return @"SSL handshake chain has expired certificates";
|
||||
case kNWErrorSSLHandshakeCertExpired : return @"SSL handshake expired certificates";
|
||||
case kNWErrorSSLHandshakeXCertChainInvalid : return @"SSL handshake invalid certificate chain";
|
||||
case kNWErrorSSLHandshakeClientCertRequested : return @"SSL handshake expecting client cert";
|
||||
case kNWErrorSSLHandshakeServerAuthCompleted : return @"SSL handshake auth interrupted";
|
||||
case kNWErrorSSLHandshakePeerCertExpired : return @"SSL handshake certificate expired";
|
||||
case kNWErrorSSLHandshakePeerCertRevoked : return @"SSL handshake certificate revoked";
|
||||
case kNWErrorSSLHandshakePeerCertUnknown : return @"SSL handshake certificate unknown";
|
||||
case kNWErrorSSLHandshakeInternalError : return @"SSL handshake internal error";
|
||||
case kNWErrorSSLInDarkWake : return @"SSL handshake in dark wake";
|
||||
case kNWErrorSSLHandshakeClosedAbort : return @"SSL handshake connection closed via error";
|
||||
case kNWErrorSSLHandshakeTimeout : return @"SSL handshake timeout";
|
||||
|
||||
case kNWErrorReadDroppedByServer : return @"Read connection dropped by server";
|
||||
@@ -73,6 +121,7 @@
|
||||
case kNWErrorPKCS12Decode : return @"PKCS12 data cannot be read or is malformed";
|
||||
case kNWErrorPKCS12AuthFailed : return @"PKCS12 data password incorrect";
|
||||
case kNWErrorPKCS12Password : return @"PKCS12 data wrong password";
|
||||
case kNWErrorPKCS12PasswordRequired : return @"PKCS12 data password required";
|
||||
case kNWErrorPKCS12NoItems : return @"PKCS12 data contains no identities";
|
||||
case kNWErrorPKCS12MultipleItems : return @"PKCS12 data contains multiple identities";
|
||||
|
||||
@@ -85,23 +134,36 @@
|
||||
|
||||
#pragma mark - Helpers
|
||||
|
||||
+ (NSError *)errorWithErrorCode:(NWError)code
|
||||
+ (NSError *)errorWithErrorCode:(NWError)code reason:(NSInteger)reason
|
||||
{
|
||||
NSDictionary *info = @{ NSLocalizedDescriptionKey: [self stringWithCode:code] };
|
||||
NSString *description = [self stringWithCode:code];
|
||||
if (reason) description = [NSString stringWithFormat:@"%@ (%i)", description, (int)reason];
|
||||
NSMutableDictionary *info = @{ NSLocalizedDescriptionKey:description }.mutableCopy;
|
||||
if (reason) [info setValue:@(reason) forKey:NWErrorReasonCodeKey];
|
||||
return [NSError errorWithDomain:@"NWPusherErrorDomain" code:code userInfo:info];
|
||||
}
|
||||
|
||||
+ (BOOL)noWithErrorCode:(NWError)code error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self noWithErrorCode:code reason:0 error:error];
|
||||
}
|
||||
|
||||
+ (BOOL)noWithErrorCode:(NWError)code reason:(NSInteger)reason error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NSAssert(code != kNWErrorNone, @"code != kNWErrorNone");
|
||||
if (error) *error = [self errorWithErrorCode:code];
|
||||
if (error) *error = [self errorWithErrorCode:code reason:reason];
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (id)nilWithErrorCode:(NWError)code error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
return [self nilWithErrorCode:code reason:0 error:error];
|
||||
}
|
||||
|
||||
+ (id)nilWithErrorCode:(NWError)code reason:(NSInteger)reason error:(NSError *__autoreleasing *)error
|
||||
{
|
||||
NSAssert(code != kNWErrorNone, @"code != kNWErrorNone");
|
||||
if (error) *error = [self errorWithErrorCode:code];
|
||||
if (error) *error = [self errorWithErrorCode:code reason:reason];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
+51
-38
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner">
|
||||
@@ -63,7 +64,7 @@
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit NewApplication" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<menuItem title="Pusher" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
@@ -158,7 +159,7 @@
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="600" height="300"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
|
||||
<value key="minSize" type="size" width="500" height="200"/>
|
||||
<view key="contentView" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="300"/>
|
||||
@@ -192,20 +193,8 @@
|
||||
<action selector="certificateSelected:" target="kaW-YJ-UA5" id="Asf-IM-UFv"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xpc-0j-elb">
|
||||
<rect key="frame" x="20" y="230" width="563" height="23"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Device push token (only first 64 hex chars used, other text is ignored)" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="Dzy-yi-6QY">
|
||||
<font key="font" size="10" name="Monaco"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</comboBoxCell>
|
||||
<connections>
|
||||
<action selector="tokenSelected:" target="kaW-YJ-UA5" id="p9a-qh-3Nh"/>
|
||||
<outlet property="delegate" destination="kaW-YJ-UA5" id="ZZ9-SB-ZBN"/>
|
||||
</connections>
|
||||
</comboBox>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="imk-VN-mp1">
|
||||
<rect key="frame" x="18" y="202" width="155" height="26"/>
|
||||
<rect key="frame" x="18" y="180" width="155" height="26"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="150" id="rN0-Vp-M6c"/>
|
||||
</constraints>
|
||||
@@ -227,7 +216,7 @@
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="c5v-al-Hn5">
|
||||
<rect key="frame" x="176" y="202" width="160" height="26"/>
|
||||
<rect key="frame" x="176" y="180" width="160" height="26"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="155" id="DV9-wc-su5"/>
|
||||
</constraints>
|
||||
@@ -244,7 +233,7 @@
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EnU-aP-5PD">
|
||||
<rect key="frame" x="461" y="199" width="121" height="24"/>
|
||||
<rect key="frame" x="456" y="177" width="126" height="24"/>
|
||||
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="Olm-G5-Man">
|
||||
<font key="font" metaFont="system"/>
|
||||
<segments>
|
||||
@@ -278,28 +267,29 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q6j-iu-9I9">
|
||||
<rect key="frame" x="20" y="45" width="560" height="152"/>
|
||||
<rect key="frame" x="20" y="45" width="560" height="130"/>
|
||||
<clipView key="contentView" id="e4e-ov-ymY">
|
||||
<rect key="frame" x="1" y="1" width="558" height="150"/>
|
||||
<rect key="frame" x="1" y="1" width="558" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView importsGraphics="NO" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="ad5-lb-L5u">
|
||||
<rect key="frame" x="0.0" y="0.0" width="558" height="150"/>
|
||||
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="panel" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" allowsNonContiguousLayout="YES" textCompletion="NO" id="ad5-lb-L5u">
|
||||
<rect key="frame" x="0.0" y="0.0" width="558" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="558" height="150"/>
|
||||
<size key="minSize" width="558" height="128"/>
|
||||
<size key="maxSize" width="573" height="10000000"/>
|
||||
<attributedString key="textStorage">
|
||||
<fragment content="..">
|
||||
<attributes>
|
||||
<font key="NSFont" metaFont="controlContent" size="11"/>
|
||||
<font key="NSFont" metaFont="smallSystem"/>
|
||||
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
|
||||
</attributes>
|
||||
</fragment>
|
||||
</attributedString>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="558" height="150"/>
|
||||
<size key="maxSize" width="573" height="10000000"/>
|
||||
<allowedInputSourceLocales>
|
||||
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
|
||||
</allowedInputSourceLocales>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="kaW-YJ-UA5" id="bUh-Oq-w5B"/>
|
||||
</connections>
|
||||
@@ -312,7 +302,7 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="sbz-Qw-fOe">
|
||||
<rect key="frame" x="543" y="1" width="16" height="150"/>
|
||||
<rect key="frame" x="543" y="1" width="16" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
@@ -328,20 +318,18 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<scrollView hidden="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z4n-XE-cfI">
|
||||
<rect key="frame" x="20" y="45" width="560" height="152"/>
|
||||
<rect key="frame" x="20" y="45" width="560" height="130"/>
|
||||
<clipView key="contentView" id="uaF-sl-etn">
|
||||
<rect key="frame" x="1" y="1" width="558" height="150"/>
|
||||
<rect key="frame" x="1" y="1" width="558" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView importsGraphics="NO" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" usesFontPanel="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="pi6-RR-ayT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="558" height="150"/>
|
||||
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="pi6-RR-ayT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="558" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" name="windowBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="558" height="150"/>
|
||||
<size key="minSize" width="558" height="128"/>
|
||||
<size key="maxSize" width="573" height="10000000"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="558" height="150"/>
|
||||
<size key="maxSize" width="573" height="10000000"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
@@ -351,10 +339,32 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="pny-Of-exT">
|
||||
<rect key="frame" x="543" y="1" width="16" height="150"/>
|
||||
<rect key="frame" x="543" y="1" width="16" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="hU6-Ym-KR3">
|
||||
<rect key="frame" x="18" y="235" width="223" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Should use sandbox environment" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ros-Zj-bni">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="sanboxCheckBoxDidPressed:" target="kaW-YJ-UA5" id="kzM-IO-iQv"/>
|
||||
</connections>
|
||||
</button>
|
||||
<comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xpc-0j-elb">
|
||||
<rect key="frame" x="20" y="208" width="563" height="23"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="Device push token (only first 64 hex chars used, other text is ignored)" drawsBackground="YES" completes="NO" numberOfVisibleItems="5" id="Dzy-yi-6QY">
|
||||
<font key="font" size="10" name="Monaco"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</comboBoxCell>
|
||||
<connections>
|
||||
<action selector="tokenSelected:" target="kaW-YJ-UA5" id="p9a-qh-3Nh"/>
|
||||
<outlet property="delegate" destination="kaW-YJ-UA5" id="ZZ9-SB-ZBN"/>
|
||||
</connections>
|
||||
</comboBox>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="pAB-wf-piT" secondAttribute="trailing" constant="20" id="1DK-KM-tMh"/>
|
||||
@@ -376,9 +386,11 @@
|
||||
<constraint firstItem="c5v-al-Hn5" firstAttribute="leading" secondItem="imk-VN-mp1" secondAttribute="trailing" constant="8" id="Syg-OZ-s0W"/>
|
||||
<constraint firstItem="2E1-cP-egh" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="20" id="VPW-kd-JRb"/>
|
||||
<constraint firstItem="pAB-wf-piT" firstAttribute="top" secondItem="z4n-XE-cfI" secondAttribute="bottom" constant="4" id="VSi-vV-wpY"/>
|
||||
<constraint firstItem="xpc-0j-elb" firstAttribute="top" secondItem="aJR-Gv-8Xr" secondAttribute="bottom" constant="8" id="ejA-7v-S2S"/>
|
||||
<constraint firstItem="hU6-Ym-KR3" firstAttribute="top" secondItem="aJR-Gv-8Xr" secondAttribute="bottom" constant="8" symbolic="YES" id="ZTZ-NV-b30"/>
|
||||
<constraint firstItem="EnU-aP-5PD" firstAttribute="top" secondItem="c5v-al-Hn5" secondAttribute="top" constant="4" id="emm-N1-qPy"/>
|
||||
<constraint firstAttribute="trailing" secondItem="z4n-XE-cfI" secondAttribute="trailing" constant="20" id="gM0-t7-RqF"/>
|
||||
<constraint firstItem="hU6-Ym-KR3" firstAttribute="leading" secondItem="aJR-Gv-8Xr" secondAttribute="leading" id="h8B-8W-BTt"/>
|
||||
<constraint firstItem="xpc-0j-elb" firstAttribute="top" secondItem="hU6-Ym-KR3" secondAttribute="bottom" constant="8" symbolic="YES" id="hqj-w5-p6V"/>
|
||||
<constraint firstItem="M70-t1-JuG" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="20" id="ief-Fk-3Mg"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gQs-Aa-IJi" secondAttribute="trailing" constant="28" id="oT0-VS-Mam"/>
|
||||
<constraint firstAttribute="bottom" secondItem="M70-t1-JuG" secondAttribute="bottom" constant="23" id="pWW-7F-Cxq"/>
|
||||
@@ -403,6 +415,7 @@
|
||||
<outlet property="_priorityPopup" destination="c5v-al-Hn5" id="6zL-7L-7t3"/>
|
||||
<outlet property="_pushButton" destination="pAB-wf-piT" id="ndY-Uh-dgS"/>
|
||||
<outlet property="_reconnectButton" destination="2E1-cP-egh" id="4CL-8O-MKG"/>
|
||||
<outlet property="_sanboxCheckBox" destination="hU6-Ym-KR3" id="9Zb-UH-d23"/>
|
||||
<outlet property="_tokenCombo" destination="xpc-0j-elb" id="f1o-6I-zGl"/>
|
||||
<outlet property="window" destination="F0z-JX-Cv5" id="a4g-51-daC"/>
|
||||
</connections>
|
||||
|
||||
+88
-48
@@ -6,12 +6,7 @@
|
||||
//
|
||||
|
||||
#import "NWAppDelegate.h"
|
||||
#import "NWHub.h"
|
||||
#import "NWNotification.h"
|
||||
#import "NWSecTools.h"
|
||||
#import "NWLCore.h"
|
||||
#import "NWPushFeedback.h"
|
||||
|
||||
#import <PusherKit/PusherKit.h>
|
||||
|
||||
@interface NWAppDelegate () <NWHubDelegate> @end
|
||||
|
||||
@@ -27,6 +22,7 @@
|
||||
IBOutlet NSPopUpButton *_expiryPopup;
|
||||
IBOutlet NSPopUpButton *_priorityPopup;
|
||||
IBOutlet NSScrollView *_logScroll;
|
||||
IBOutlet NSButton *_sanboxCheckBox;
|
||||
|
||||
NWHub *_hub;
|
||||
NSDictionary *_config;
|
||||
@@ -109,6 +105,14 @@
|
||||
[self reconnect];
|
||||
}
|
||||
|
||||
- (IBAction)sanboxCheckBoxDidPressed:(NSButton *)sender
|
||||
{
|
||||
if (_selectedCertificate)
|
||||
{
|
||||
[self reconnect];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)notification:(NWNotification *)notification didFailWithError:(NSError *)error
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@@ -138,10 +142,10 @@
|
||||
NWLogWarn(@"No push certificates in keychain.");
|
||||
}
|
||||
certs = [certs sortedArrayUsingComparator:^NSComparisonResult(NWCertificateRef a, NWCertificateRef b) {
|
||||
BOOL adev = [NWSecTools isSandboxCertificate:a];
|
||||
BOOL bdev = [NWSecTools isSandboxCertificate:b];
|
||||
if (adev != bdev) {
|
||||
return adev ? NSOrderedAscending : NSOrderedDescending;
|
||||
NWEnvironmentOptions envOptionsA = [NWSecTools environmentOptionsForCertificate:a];
|
||||
NWEnvironmentOptions envOptionsB = [NWSecTools environmentOptionsForCertificate:b];
|
||||
if (envOptionsA != envOptionsB) {
|
||||
return envOptionsA < envOptionsB;
|
||||
}
|
||||
NSString *aname = [NWSecTools summaryWithCertificate:a];
|
||||
NSString *bname = [NWSecTools summaryWithCertificate:b];
|
||||
@@ -159,13 +163,20 @@
|
||||
NSMutableString *suffix = @" ".mutableCopy;
|
||||
[_certificatePopup removeAllItems];
|
||||
[_certificatePopup addItemWithTitle:@"Select Push Certificate"];
|
||||
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setDateStyle:NSDateFormatterShortStyle];
|
||||
[formatter setTimeStyle:NSDateFormatterShortStyle];
|
||||
for (NSArray *pair in _certificateIdentityPairs) {
|
||||
NWCertificateRef certificate = pair[0];
|
||||
BOOL hasIdentity = (pair[1] != NSNull.null);
|
||||
BOOL sandbox = [NWSecTools isSandboxCertificate:certificate];
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
NSString *summary = nil;
|
||||
NWCertType certType = [NWSecTools typeWithCertificate:certificate summary:&summary];
|
||||
NSString *type = descriptionForCertType(certType);
|
||||
NSDate *date = [NWSecTools expirationWithCertificate:certificate];
|
||||
NSString *expire = [NSString stringWithFormat:@" [%@]", date ? [formatter stringFromDate:date] : @"expired"];
|
||||
// summary = @"com.example.app";
|
||||
[_certificatePopup addItemWithTitle:[NSString stringWithFormat:@"%@%@%@%@", hasIdentity ? @"imported: " : @"", summary, sandbox ? @" (sandbox)" : @"", suffix]];
|
||||
[_certificatePopup addItemWithTitle:[NSString stringWithFormat:@"%@%@ (%@ %@)%@%@", hasIdentity ? @"imported: " : @"", summary, type, descriptionForEnvironentOptions(environmentOptions), expire, suffix]];
|
||||
[suffix appendString:@" "];
|
||||
}
|
||||
[_certificatePopup addItemWithTitle:@"Import PKCS #12 file (.p12)..."];
|
||||
@@ -197,6 +208,9 @@
|
||||
NSData *data = [NSData dataWithContentsOfURL:url];
|
||||
NSError *error = nil;
|
||||
NSArray *ids = [NWSecTools identitiesWithPKCS12Data:data password:password error:&error];
|
||||
if (!ids && password.length == 0 && error.code == kNWErrorPKCS12Password) {
|
||||
ids = [NWSecTools identitiesWithPKCS12Data:data password:nil error:&error];
|
||||
}
|
||||
if (!ids) {
|
||||
NWLogWarn(@"Unable to read p12 file: %@", error.localizedDescription);
|
||||
return;
|
||||
@@ -272,6 +286,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NWEnvironment)selectedEnvironmentForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
return (_sanboxCheckBox.state & NSOnState) ? NWEnvironmentSandbox : NWEnvironmentProduction;
|
||||
}
|
||||
|
||||
- (NWEnvironment)preferredEnvironmentForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
|
||||
return (environmentOptions & NWEnvironmentOptionSandbox) ? NWEnvironmentSandbox : NWEnvironmentProduction;
|
||||
}
|
||||
|
||||
#pragma mark - Connection
|
||||
|
||||
- (void)connectWithCertificateAtIndex:(NSUInteger)index
|
||||
@@ -279,14 +305,16 @@
|
||||
if (index == 0) {
|
||||
[_certificatePopup selectItemAtIndex:0];
|
||||
_lastSelectedIndex = 0;
|
||||
[self selectCertificate:nil identity:nil];
|
||||
[self selectCertificate:nil identity:nil environment:NWEnvironmentSandbox];
|
||||
_tokenCombo.enabled = NO;
|
||||
[self loadSelectedToken];
|
||||
} else if (index <= _certificateIdentityPairs.count) {
|
||||
[_certificatePopup selectItemAtIndex:index];
|
||||
_lastSelectedIndex = index;
|
||||
NSArray *pair = [_certificateIdentityPairs objectAtIndex:index - 1];
|
||||
[self selectCertificate:pair[0] identity:pair[1] == NSNull.null ? nil : pair[1]];
|
||||
NWCertificateRef certificate = pair[0];
|
||||
NWIdentityRef identity = pair[1];
|
||||
[self selectCertificate:certificate identity:identity == NSNull.null ? nil : identity environment:[self preferredEnvironmentForCertificate:certificate]];
|
||||
_tokenCombo.enabled = YES;
|
||||
[self loadSelectedToken];
|
||||
} else {
|
||||
@@ -295,12 +323,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)selectCertificate:(NWCertificateRef)certificate identity:(NWIdentityRef)identity
|
||||
- (void)disableButtons
|
||||
{
|
||||
_pushButton.enabled = NO;
|
||||
_reconnectButton.enabled = NO;
|
||||
_sanboxCheckBox.enabled = NO;
|
||||
}
|
||||
|
||||
- (void)enableButtonsForCertificate:(NWCertificateRef)certificate environment:(NWEnvironment)environment
|
||||
{
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
|
||||
BOOL shouldEnableEnvButton = (environmentOptions == NWEnvironmentOptionAny);
|
||||
BOOL shouldSelectSandboxEnv = (environment == NWEnvironmentSandbox);
|
||||
|
||||
_pushButton.enabled = YES;
|
||||
_reconnectButton.enabled = YES;
|
||||
_sanboxCheckBox.enabled = shouldEnableEnvButton;
|
||||
_sanboxCheckBox.state = shouldSelectSandboxEnv ? NSOnState : NSOffState;
|
||||
}
|
||||
|
||||
- (void)selectCertificate:(NWCertificateRef)certificate identity:(NWIdentityRef)identity environment:(NWEnvironment)environment
|
||||
{
|
||||
if (_hub) {
|
||||
[_hub disconnect]; _hub = nil;
|
||||
_pushButton.enabled = NO;
|
||||
_reconnectButton.enabled = NO;
|
||||
|
||||
[self disableButtons];
|
||||
NWLogInfo(@"Disconnected from APN");
|
||||
}
|
||||
|
||||
@@ -308,20 +356,20 @@
|
||||
[self updateTokenCombo];
|
||||
|
||||
if (certificate) {
|
||||
BOOL sandbox = [NWSecTools isSandboxCertificate:certificate];
|
||||
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
NWLogInfo(@"Connecting to APN.. (%@%@)", summary, sandbox ? @" sandbox" : @"");
|
||||
NWLogInfo(@"Connecting to APN... (%@ %@)", summary, descriptionForEnvironent(environment));
|
||||
|
||||
dispatch_async(_serial, ^{
|
||||
NSError *error = nil;
|
||||
NWIdentityRef ident = identity ?: [NWSecTools keychainIdentityWithCertificate:certificate error:&error];
|
||||
NWHub *hub = [NWHub connectWithDelegate:self identity:ident error:&error];
|
||||
NWHub *hub = [NWHub connectWithDelegate:self identity:ident environment:environment error:&error];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (hub) {
|
||||
NWLogInfo(@"Connected (%@%@)", summary, sandbox ? @" sandbox" : @"");
|
||||
NWLogInfo(@"Connected (%@ %@)", summary, descriptionForEnvironent(environment));
|
||||
_hub = hub;
|
||||
_pushButton.enabled = YES;
|
||||
_reconnectButton.enabled = YES;
|
||||
|
||||
[self enableButtonsForCertificate:certificate environment:environment];
|
||||
} else {
|
||||
NWLogWarn(@"Unable to connect: %@", error.localizedDescription);
|
||||
[hub disconnect];
|
||||
@@ -334,22 +382,12 @@
|
||||
|
||||
- (void)reconnect
|
||||
{
|
||||
NWLogInfo(@"Reconnecting..");
|
||||
_pushButton.enabled = NO;
|
||||
_reconnectButton.enabled = NO;
|
||||
dispatch_async(_serial, ^{
|
||||
NSError *error = nil;
|
||||
BOOL connected = [_hub reconnectWithError:&error];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (connected) {
|
||||
NWLogInfo(@"Reconnected");
|
||||
_pushButton.enabled = YES;
|
||||
} else {
|
||||
NWLogWarn(@"Unable to reconnect: %@", error.localizedDescription);
|
||||
}
|
||||
_reconnectButton.enabled = YES;
|
||||
});
|
||||
});
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:_selectedCertificate];
|
||||
NWEnvironment environment = [self selectedEnvironmentForCertificate:_selectedCertificate];
|
||||
|
||||
NWLogInfo(@"Reconnecting to APN...(%@ %@)", summary, descriptionForEnvironent(environment));
|
||||
|
||||
[self selectCertificate:_selectedCertificate identity:nil environment:environment];
|
||||
}
|
||||
|
||||
- (void)push
|
||||
@@ -372,7 +410,7 @@
|
||||
if (read) {
|
||||
if (!failed) NWLogInfo(@"Payload has been pushed");
|
||||
} else {
|
||||
NWLogWarn(@"Unable to read failed: %@", error.localizedDescription);
|
||||
NWLogWarn(@"Unable to read: %@", error.localizedDescription);
|
||||
}
|
||||
[_hub trimIdentifiers];
|
||||
});
|
||||
@@ -390,17 +428,17 @@
|
||||
NWLogWarn(@"Unable to connect to feedback service: no certificate selected");
|
||||
return;
|
||||
}
|
||||
BOOL sandbox = [NWSecTools isSandboxCertificate:certificate];
|
||||
NWEnvironment environment = [self selectedEnvironmentForCertificate:certificate];
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
NWLogInfo(@"Connecting to feedback service.. (%@%@)", summary, sandbox ? @" sandbox" : @"");
|
||||
NWLogInfo(@"Connecting to feedback service.. (%@ %@)", summary, descriptionForEnvironent(environment));
|
||||
NSError *error = nil;
|
||||
NWIdentityRef identity = [NWSecTools keychainIdentityWithCertificate:_selectedCertificate error:&error];
|
||||
NWPushFeedback *feedback = [NWPushFeedback connectWithIdentity:identity error:&error];
|
||||
NWPushFeedback *feedback = [NWPushFeedback connectWithIdentity:identity environment:[self selectedEnvironmentForCertificate:certificate] error:&error];
|
||||
if (!feedback) {
|
||||
NWLogWarn(@"Unable to connect to feedback service: %@", error.localizedDescription);
|
||||
return;
|
||||
}
|
||||
NWLogInfo(@"Reading feedback service.. (%@%@)", summary, sandbox ? @" sandbox" : @"");
|
||||
NWLogInfo(@"Reading feedback service.. (%@ %@)", summary, descriptionForEnvironent(environment));
|
||||
NSArray *pairs = [feedback readTokenDatePairsWithMax:1000 error:&error];
|
||||
if (!pairs) {
|
||||
NWLogWarn(@"Unable to read feedback: %@", error.localizedDescription);
|
||||
@@ -421,14 +459,16 @@
|
||||
|
||||
- (NSString *)identifierWithCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
BOOL sandbox = [NWSecTools isSandboxCertificate:certificate];
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
return summary ? [NSString stringWithFormat:@"%@%@", summary, sandbox ? @"-sandbox" : @""] : nil;
|
||||
return summary ? [NSString stringWithFormat:@"%@-%@", summary, descriptionForEnvironentOptions(environmentOptions)] : nil;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)tokensWithCertificate:(NWCertificateRef)certificate create:(BOOL)create
|
||||
{
|
||||
NSString *identifier = [self identifierWithCertificate:certificate];
|
||||
NWEnvironment environment = [self selectedEnvironmentForCertificate:_selectedCertificate];
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
NSString *identifier = summary ? [NSString stringWithFormat:@"%@%@", summary, environment == NWEnvironmentSandbox ? @"-sandbox" : @""] : nil;
|
||||
if (!identifier) return nil;
|
||||
NSArray *result = _config[@"identifiers"][identifier];
|
||||
if (create && !result) result = (_config[@"identifiers"][identifier] = @[].mutableCopy);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icon</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.noodlewerk.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.6.1</string>
|
||||
<string>0.7.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>12</string>
|
||||
<string>19</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.developer-tools</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'NWPusher'
|
||||
s.version = '0.6.1'
|
||||
s.version = '0.7.5'
|
||||
s.summary = 'OS X and iOS application and framework to play with the Apple Push Notification service (APNs).'
|
||||
s.homepage = 'https://github.com/noodlewerk/NWPusher'
|
||||
s.license = { :type => 'BSD', :file => 'LICENSE.txt' }
|
||||
|
||||
@@ -7,9 +7,45 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5C7803881D3C4668002107FB /* PusherKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7803861D3C4668002107FB /* PusherKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78038B1D3C4668002107FB /* PusherKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C7803841D3C4668002107FB /* PusherKit.framework */; };
|
||||
5C78038C1D3C4668002107FB /* PusherKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C7803841D3C4668002107FB /* PusherKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
5C7803911D3C4683002107FB /* NWHub.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A1189682D30043DA98 /* NWHub.m */; };
|
||||
5C7803921D3C4683002107FB /* NWNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A3189682D30043DA98 /* NWNotification.m */; };
|
||||
5C7803931D3C4683002107FB /* NWPusher.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A5189682D30043DA98 /* NWPusher.m */; };
|
||||
5C7803941D3C4683002107FB /* NWPushFeedback.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A7189682D30043DA98 /* NWPushFeedback.m */; };
|
||||
5C7803951D3C4683002107FB /* NWSecTools.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A9189682D30043DA98 /* NWSecTools.m */; };
|
||||
5C7803961D3C4683002107FB /* NWSSLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232AB189682D30043DA98 /* NWSSLConnection.m */; };
|
||||
5C7803971D3C4683002107FB /* NWType.m in Sources */ = {isa = PBXBuildFile; fileRef = B34BF1B318DDF401004BA9F7 /* NWType.m */; };
|
||||
5C7803981D3C4698002107FB /* NWLCore.c in Sources */ = {isa = PBXBuildFile; fileRef = B3376A61172BB71200242EBB /* NWLCore.c */; };
|
||||
5C7803991D3C4749002107FB /* NWHub.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A0189682D30043DA98 /* NWHub.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039A1D3C4749002107FB /* NWNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A2189682D30043DA98 /* NWNotification.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039B1D3C4749002107FB /* NWPusher.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A4189682D30043DA98 /* NWPusher.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039C1D3C4749002107FB /* NWPushFeedback.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A6189682D30043DA98 /* NWPushFeedback.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039D1D3C4749002107FB /* NWSecTools.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A8189682D30043DA98 /* NWSecTools.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039E1D3C4749002107FB /* NWSSLConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232AA189682D30043DA98 /* NWSSLConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C78039F1D3C4749002107FB /* NWType.h in Headers */ = {isa = PBXBuildFile; fileRef = B34BF1B218DDF401004BA9F7 /* NWType.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803A01D3C4749002107FB /* NWLCore.h in Headers */ = {isa = PBXBuildFile; fileRef = B3376A62172BB71200242EBB /* NWLCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803AA1D3C4826002107FB /* PusherKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7803A81D3C4826002107FB /* PusherKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803AD1D3C4826002107FB /* PusherKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C7803A61D3C4826002107FB /* PusherKit.framework */; };
|
||||
5C7803AF1D3C4826002107FB /* PusherKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 5C7803A61D3C4826002107FB /* PusherKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
5C7803B31D3C486F002107FB /* NWLCore.c in Sources */ = {isa = PBXBuildFile; fileRef = B3376A61172BB71200242EBB /* NWLCore.c */; };
|
||||
5C7803B41D3C487B002107FB /* NWHub.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A1189682D30043DA98 /* NWHub.m */; };
|
||||
5C7803B51D3C487B002107FB /* NWNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A3189682D30043DA98 /* NWNotification.m */; };
|
||||
5C7803B61D3C487B002107FB /* NWPusher.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A5189682D30043DA98 /* NWPusher.m */; };
|
||||
5C7803B71D3C487B002107FB /* NWPushFeedback.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A7189682D30043DA98 /* NWPushFeedback.m */; };
|
||||
5C7803B81D3C487B002107FB /* NWSecTools.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A9189682D30043DA98 /* NWSecTools.m */; };
|
||||
5C7803B91D3C487B002107FB /* NWSSLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232AB189682D30043DA98 /* NWSSLConnection.m */; };
|
||||
5C7803BA1D3C487B002107FB /* NWType.m in Sources */ = {isa = PBXBuildFile; fileRef = B34BF1B318DDF401004BA9F7 /* NWType.m */; };
|
||||
5C7803BB1D3C488C002107FB /* NWHub.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A0189682D30043DA98 /* NWHub.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803BC1D3C488C002107FB /* NWNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A2189682D30043DA98 /* NWNotification.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803BD1D3C488C002107FB /* NWPusher.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A4189682D30043DA98 /* NWPusher.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803BE1D3C488C002107FB /* NWPushFeedback.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A6189682D30043DA98 /* NWPushFeedback.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803BF1D3C488C002107FB /* NWSecTools.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232A8189682D30043DA98 /* NWSecTools.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803C01D3C488C002107FB /* NWSSLConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = B3F232AA189682D30043DA98 /* NWSSLConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803C11D3C488C002107FB /* NWType.h in Headers */ = {isa = PBXBuildFile; fileRef = B34BF1B218DDF401004BA9F7 /* NWType.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5C7803C21D3C488C002107FB /* NWLCore.h in Headers */ = {isa = PBXBuildFile; fileRef = B3376A62172BB71200242EBB /* NWLCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
B3005FC318F43659009BB7C3 /* Application.xib in Resources */ = {isa = PBXBuildFile; fileRef = B3005FC218F43659009BB7C3 /* Application.xib */; };
|
||||
B3376A63172BB71200242EBB /* NWLCore.c in Sources */ = {isa = PBXBuildFile; fileRef = B3376A61172BB71200242EBB /* NWLCore.c */; };
|
||||
B3376A64172BB71200242EBB /* NWLCore.c in Sources */ = {isa = PBXBuildFile; fileRef = B3376A61172BB71200242EBB /* NWLCore.c */; };
|
||||
B33FB1C8172B185C006529CE /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = B33FB1BB172B185C006529CE /* icon.icns */; };
|
||||
B33FB1C9172B185C006529CE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B33FB1BC172B185C006529CE /* main.m */; };
|
||||
B33FB1CB172B185C006529CE /* NWAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B33FB1BF172B185C006529CE /* NWAppDelegate.m */; };
|
||||
@@ -26,8 +62,6 @@
|
||||
B33FB215172B303D006529CE /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B33FB211172B303D006529CE /* Icon-72@2x.png */; };
|
||||
B33FB216172B303D006529CE /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B33FB212172B303D006529CE /* icon.png */; };
|
||||
B33FB217172B303D006529CE /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B33FB213172B303D006529CE /* Icon@2x.png */; };
|
||||
B34BF1B418DDF401004BA9F7 /* NWType.m in Sources */ = {isa = PBXBuildFile; fileRef = B34BF1B318DDF401004BA9F7 /* NWType.m */; };
|
||||
B34BF1B518DDF401004BA9F7 /* NWType.m in Sources */ = {isa = PBXBuildFile; fileRef = B34BF1B318DDF401004BA9F7 /* NWType.m */; };
|
||||
B395BA12172BC17A00631932 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = B3C6BE0015FD30E900F1F3F1 /* README.md */; };
|
||||
B3AFABEF172C81910027346A /* config.plist in Resources */ = {isa = PBXBuildFile; fileRef = B3AFABEE172C81910027346A /* config.plist */; };
|
||||
B3B4DCD318A7998300F9F258 /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = B3B4DCD218A7998300F9F258 /* LICENSE.txt */; };
|
||||
@@ -36,21 +70,57 @@
|
||||
B3C6BDD315FD27E900F1F3F1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C6BDD215FD27E900F1F3F1 /* Security.framework */; };
|
||||
B3C6BE0115FD30E900F1F3F1 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = B3C6BE0015FD30E900F1F3F1 /* README.md */; };
|
||||
B3F23256189657DA0043DA98 /* pusher.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B3F23255189657DA0043DA98 /* pusher.p12 */; };
|
||||
B3F232AE189682D30043DA98 /* NWHub.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A1189682D30043DA98 /* NWHub.m */; };
|
||||
B3F232AF189682D30043DA98 /* NWHub.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A1189682D30043DA98 /* NWHub.m */; };
|
||||
B3F232B0189682D30043DA98 /* NWNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A3189682D30043DA98 /* NWNotification.m */; };
|
||||
B3F232B1189682D30043DA98 /* NWNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A3189682D30043DA98 /* NWNotification.m */; };
|
||||
B3F232B2189682D30043DA98 /* NWPusher.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A5189682D30043DA98 /* NWPusher.m */; };
|
||||
B3F232B3189682D30043DA98 /* NWPusher.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A5189682D30043DA98 /* NWPusher.m */; };
|
||||
B3F232B4189682D30043DA98 /* NWPushFeedback.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A7189682D30043DA98 /* NWPushFeedback.m */; };
|
||||
B3F232B5189682D30043DA98 /* NWPushFeedback.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A7189682D30043DA98 /* NWPushFeedback.m */; };
|
||||
B3F232B6189682D30043DA98 /* NWSecTools.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A9189682D30043DA98 /* NWSecTools.m */; };
|
||||
B3F232B7189682D30043DA98 /* NWSecTools.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232A9189682D30043DA98 /* NWSecTools.m */; };
|
||||
B3F232B8189682D30043DA98 /* NWSSLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232AB189682D30043DA98 /* NWSSLConnection.m */; };
|
||||
B3F232B9189682D30043DA98 /* NWSSLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = B3F232AB189682D30043DA98 /* NWSSLConnection.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
5C7803891D3C4668002107FB /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = B3C6BD7215FD24D200F1F3F1 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 5C7803831D3C4668002107FB;
|
||||
remoteInfo = "PusherKit-iOS";
|
||||
};
|
||||
5C7803AB1D3C4826002107FB /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = B3C6BD7215FD24D200F1F3F1 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 5C7803A51D3C4826002107FB;
|
||||
remoteInfo = "PusherKit-OSX";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
5C7803901D3C4668002107FB /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
5C78038C1D3C4668002107FB /* PusherKit.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
5C7803AE1D3C4826002107FB /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
5C7803AF1D3C4826002107FB /* PusherKit.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
5C7803841D3C4668002107FB /* PusherKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PusherKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5C7803861D3C4668002107FB /* PusherKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PusherKit.h; sourceTree = "<group>"; };
|
||||
5C7803871D3C4668002107FB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
5C7803A61D3C4826002107FB /* PusherKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PusherKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5C7803A81D3C4826002107FB /* PusherKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PusherKit.h; sourceTree = "<group>"; };
|
||||
5C7803A91D3C4826002107FB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
B3005FC218F43659009BB7C3 /* Application.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Application.xib; sourceTree = "<group>"; };
|
||||
B3376A61172BB71200242EBB /* NWLCore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = NWLCore.c; path = Mac/NWLCore.c; sourceTree = SOURCE_ROOT; };
|
||||
B3376A62172BB71200242EBB /* NWLCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NWLCore.h; path = Mac/NWLCore.h; sourceTree = SOURCE_ROOT; };
|
||||
@@ -106,11 +176,26 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
5C7803801D3C4668002107FB /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
5C7803A21D3C4826002107FB /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
B33FB1CE172B1A66006529CE /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B33FB20F172B1EC2006529CE /* Security.framework in Frameworks */,
|
||||
5C78038B1D3C4668002107FB /* PusherKit.framework in Frameworks */,
|
||||
B33FB204172B1BAD006529CE /* CoreGraphics.framework in Frameworks */,
|
||||
B33FB202172B1BA5006529CE /* Foundation.framework in Frameworks */,
|
||||
B33FB200172B1B9F006529CE /* UIKit.framework in Frameworks */,
|
||||
@@ -123,12 +208,31 @@
|
||||
files = (
|
||||
B3C6BDD315FD27E900F1F3F1 /* Security.framework in Frameworks */,
|
||||
B3C6BD8015FD24D200F1F3F1 /* Cocoa.framework in Frameworks */,
|
||||
5C7803AD1D3C4826002107FB /* PusherKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
5C7803851D3C4668002107FB /* PusherKit-iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5C7803861D3C4668002107FB /* PusherKit.h */,
|
||||
5C7803871D3C4668002107FB /* Info.plist */,
|
||||
);
|
||||
path = "PusherKit-iOS";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5C7803A71D3C4826002107FB /* PusherKit-OSX */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5C7803A81D3C4826002107FB /* PusherKit.h */,
|
||||
5C7803A91D3C4826002107FB /* Info.plist */,
|
||||
);
|
||||
path = "PusherKit-OSX";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B3376A5F172B9EFD00242EBB /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -193,6 +297,8 @@
|
||||
B3F2329D189682D30043DA98 /* Classes */,
|
||||
B33FB1BA172B185C006529CE /* Mac */,
|
||||
B33FB1ED172B1A7A006529CE /* Touch */,
|
||||
5C7803851D3C4668002107FB /* PusherKit-iOS */,
|
||||
5C7803A71D3C4826002107FB /* PusherKit-OSX */,
|
||||
B3C6BD7E15FD24D200F1F3F1 /* Frameworks */,
|
||||
B3C6BD7C15FD24D200F1F3F1 /* Products */,
|
||||
);
|
||||
@@ -203,6 +309,8 @@
|
||||
children = (
|
||||
B3C6BD7B15FD24D200F1F3F1 /* Pusher.app */,
|
||||
B33FB1D1172B1A66006529CE /* PusherTouch.app */,
|
||||
5C7803841D3C4668002107FB /* PusherKit.framework */,
|
||||
5C7803A61D3C4826002107FB /* PusherKit.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -245,7 +353,78 @@
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
5C7803811D3C4668002107FB /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5C7803881D3C4668002107FB /* PusherKit.h in Headers */,
|
||||
5C7803991D3C4749002107FB /* NWHub.h in Headers */,
|
||||
5C78039A1D3C4749002107FB /* NWNotification.h in Headers */,
|
||||
5C78039B1D3C4749002107FB /* NWPusher.h in Headers */,
|
||||
5C78039C1D3C4749002107FB /* NWPushFeedback.h in Headers */,
|
||||
5C78039D1D3C4749002107FB /* NWSecTools.h in Headers */,
|
||||
5C78039E1D3C4749002107FB /* NWSSLConnection.h in Headers */,
|
||||
5C78039F1D3C4749002107FB /* NWType.h in Headers */,
|
||||
5C7803A01D3C4749002107FB /* NWLCore.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
5C7803A31D3C4826002107FB /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5C7803AA1D3C4826002107FB /* PusherKit.h in Headers */,
|
||||
5C7803BB1D3C488C002107FB /* NWHub.h in Headers */,
|
||||
5C7803BC1D3C488C002107FB /* NWNotification.h in Headers */,
|
||||
5C7803BD1D3C488C002107FB /* NWPusher.h in Headers */,
|
||||
5C7803BE1D3C488C002107FB /* NWPushFeedback.h in Headers */,
|
||||
5C7803BF1D3C488C002107FB /* NWSecTools.h in Headers */,
|
||||
5C7803C01D3C488C002107FB /* NWSSLConnection.h in Headers */,
|
||||
5C7803C11D3C488C002107FB /* NWType.h in Headers */,
|
||||
5C7803C21D3C488C002107FB /* NWLCore.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
5C7803831D3C4668002107FB /* PusherKit-iOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 5C78038F1D3C4668002107FB /* Build configuration list for PBXNativeTarget "PusherKit-iOS" */;
|
||||
buildPhases = (
|
||||
5C78037F1D3C4668002107FB /* Sources */,
|
||||
5C7803801D3C4668002107FB /* Frameworks */,
|
||||
5C7803811D3C4668002107FB /* Headers */,
|
||||
5C7803821D3C4668002107FB /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "PusherKit-iOS";
|
||||
productName = "PusherKit-iOS";
|
||||
productReference = 5C7803841D3C4668002107FB /* PusherKit.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
5C7803A51D3C4826002107FB /* PusherKit-OSX */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 5C7803B01D3C4826002107FB /* Build configuration list for PBXNativeTarget "PusherKit-OSX" */;
|
||||
buildPhases = (
|
||||
5C7803A11D3C4826002107FB /* Sources */,
|
||||
5C7803A21D3C4826002107FB /* Frameworks */,
|
||||
5C7803A31D3C4826002107FB /* Headers */,
|
||||
5C7803A41D3C4826002107FB /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "PusherKit-OSX";
|
||||
productName = "PusherKit-OSX";
|
||||
productReference = 5C7803A61D3C4826002107FB /* PusherKit.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
B33FB1D0172B1A66006529CE /* PusherTouch */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = B33FB1EA172B1A66006529CE /* Build configuration list for PBXNativeTarget "PusherTouch" */;
|
||||
@@ -253,10 +432,12 @@
|
||||
B33FB1CD172B1A66006529CE /* Sources */,
|
||||
B33FB1CE172B1A66006529CE /* Frameworks */,
|
||||
B33FB1CF172B1A66006529CE /* Resources */,
|
||||
5C7803901D3C4668002107FB /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
5C78038A1D3C4668002107FB /* PBXTargetDependency */,
|
||||
);
|
||||
name = PusherTouch;
|
||||
productName = PusherTouch;
|
||||
@@ -270,10 +451,12 @@
|
||||
B3C6BD7715FD24D200F1F3F1 /* Sources */,
|
||||
B3C6BD7815FD24D200F1F3F1 /* Frameworks */,
|
||||
B3C6BD7915FD24D200F1F3F1 /* Resources */,
|
||||
5C7803AE1D3C4826002107FB /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
5C7803AC1D3C4826002107FB /* PBXTargetDependency */,
|
||||
);
|
||||
name = PusherMac;
|
||||
productName = Pusher;
|
||||
@@ -287,8 +470,18 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
CLASSPREFIX = NW;
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = noodlewerk;
|
||||
TargetAttributes = {
|
||||
5C7803831D3C4668002107FB = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
5C7803A51D3C4826002107FB = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = B3C6BD7515FD24D200F1F3F1 /* Build configuration list for PBXProject "NWPusher" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -304,11 +497,27 @@
|
||||
targets = (
|
||||
B3C6BD7A15FD24D200F1F3F1 /* PusherMac */,
|
||||
B33FB1D0172B1A66006529CE /* PusherTouch */,
|
||||
5C7803831D3C4668002107FB /* PusherKit-iOS */,
|
||||
5C7803A51D3C4826002107FB /* PusherKit-OSX */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
5C7803821D3C4668002107FB /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
5C7803A41D3C4826002107FB /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
B33FB1CF172B1A66006529CE /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -341,20 +550,42 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
5C78037F1D3C4668002107FB /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5C7803951D3C4683002107FB /* NWSecTools.m in Sources */,
|
||||
5C7803961D3C4683002107FB /* NWSSLConnection.m in Sources */,
|
||||
5C7803911D3C4683002107FB /* NWHub.m in Sources */,
|
||||
5C7803941D3C4683002107FB /* NWPushFeedback.m in Sources */,
|
||||
5C7803981D3C4698002107FB /* NWLCore.c in Sources */,
|
||||
5C7803921D3C4683002107FB /* NWNotification.m in Sources */,
|
||||
5C7803971D3C4683002107FB /* NWType.m in Sources */,
|
||||
5C7803931D3C4683002107FB /* NWPusher.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
5C7803A11D3C4826002107FB /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5C7803B81D3C487B002107FB /* NWSecTools.m in Sources */,
|
||||
5C7803B41D3C487B002107FB /* NWHub.m in Sources */,
|
||||
5C7803BA1D3C487B002107FB /* NWType.m in Sources */,
|
||||
5C7803B71D3C487B002107FB /* NWPushFeedback.m in Sources */,
|
||||
5C7803B61D3C487B002107FB /* NWPusher.m in Sources */,
|
||||
5C7803B51D3C487B002107FB /* NWNotification.m in Sources */,
|
||||
5C7803B31D3C486F002107FB /* NWLCore.c in Sources */,
|
||||
5C7803B91D3C487B002107FB /* NWSSLConnection.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
B33FB1CD172B1A66006529CE /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B33FB1FC172B1A7A006529CE /* main.m in Sources */,
|
||||
B3F232B5189682D30043DA98 /* NWPushFeedback.m in Sources */,
|
||||
B33FB1FD172B1A7A006529CE /* NWAppDelegate.m in Sources */,
|
||||
B34BF1B518DDF401004BA9F7 /* NWType.m in Sources */,
|
||||
B3F232AF189682D30043DA98 /* NWHub.m in Sources */,
|
||||
B3F232B7189682D30043DA98 /* NWSecTools.m in Sources */,
|
||||
B3F232B3189682D30043DA98 /* NWPusher.m in Sources */,
|
||||
B3F232B9189682D30043DA98 /* NWSSLConnection.m in Sources */,
|
||||
B3F232B1189682D30043DA98 /* NWNotification.m in Sources */,
|
||||
B3376A64172BB71200242EBB /* NWLCore.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -362,22 +593,207 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B3F232B4189682D30043DA98 /* NWPushFeedback.m in Sources */,
|
||||
B3F232AE189682D30043DA98 /* NWHub.m in Sources */,
|
||||
B3F232B6189682D30043DA98 /* NWSecTools.m in Sources */,
|
||||
B34BF1B418DDF401004BA9F7 /* NWType.m in Sources */,
|
||||
B3F232B2189682D30043DA98 /* NWPusher.m in Sources */,
|
||||
B3F232B8189682D30043DA98 /* NWSSLConnection.m in Sources */,
|
||||
B3F232B0189682D30043DA98 /* NWNotification.m in Sources */,
|
||||
B33FB1C9172B185C006529CE /* main.m in Sources */,
|
||||
B33FB1CB172B185C006529CE /* NWAppDelegate.m in Sources */,
|
||||
B3376A63172BB71200242EBB /* NWLCore.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
5C78038A1D3C4668002107FB /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 5C7803831D3C4668002107FB /* PusherKit-iOS */;
|
||||
targetProxy = 5C7803891D3C4668002107FB /* PBXContainerItemProxy */;
|
||||
};
|
||||
5C7803AC1D3C4826002107FB /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 5C7803A51D3C4826002107FB /* PusherKit-OSX */;
|
||||
targetProxy = 5C7803AB1D3C4826002107FB /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
5C78038D1D3C4668002107FB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "PusherKit-iOS/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.zats.PusherKit-iOS";
|
||||
PRODUCT_NAME = PusherKit;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5C78038E1D3C4668002107FB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "PusherKit-iOS/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.zats.PusherKit-iOS";
|
||||
PRODUCT_NAME = PusherKit;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
5C7803B11D3C4826002107FB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "PusherKit-OSX/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.zats.PusherKit-OSX";
|
||||
PRODUCT_NAME = PusherKit;
|
||||
SKIP_INSTALL = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5C7803B21D3C4826002107FB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "PusherKit-OSX/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.zats.PusherKit-OSX";
|
||||
PRODUCT_NAME = PusherKit;
|
||||
SKIP_INSTALL = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
B33FB1EB172B1A66006529CE /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -398,7 +814,9 @@
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = "Touch/PusherTouch-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.noodlewerk.pusher;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -423,8 +841,10 @@
|
||||
GCC_PREFIX_HEADER = "Touch/PusherTouch-Prefix.pch";
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "NWL_LIB=Pusher";
|
||||
INFOPLIST_FILE = "Touch/PusherTouch-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.noodlewerk.pusher;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -439,11 +859,22 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -452,7 +883,9 @@
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -466,14 +899,26 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.8;
|
||||
SDKROOT = macosx;
|
||||
@@ -483,6 +928,7 @@
|
||||
B3C6BD9A15FD24D200F1F3F1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Mac/PusherMac-Prefix.pch";
|
||||
@@ -491,7 +937,9 @@
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = "Mac/PusherMac-Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.noodlewerk.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pusher;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
@@ -500,6 +948,7 @@
|
||||
B3C6BD9B15FD24D200F1F3F1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "Mac/PusherMac-Prefix.pch";
|
||||
@@ -508,7 +957,9 @@
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = "Mac/PusherMac-Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.noodlewerk.${PRODUCT_NAME:rfc1034identifier}";
|
||||
PRODUCT_NAME = Pusher;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
@@ -517,6 +968,24 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
5C78038F1D3C4668002107FB /* Build configuration list for PBXNativeTarget "PusherKit-iOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5C78038D1D3C4668002107FB /* Debug */,
|
||||
5C78038E1D3C4668002107FB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
5C7803B01D3C4826002107FB /* Build configuration list for PBXNativeTarget "PusherKit-OSX" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5C7803B11D3C4826002107FB /* Debug */,
|
||||
5C7803B21D3C4826002107FB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
B33FB1EA172B1A66006529CE /* Build configuration list for PBXNativeTarget "PusherTouch" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803A51D3C4826002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-OSX"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803A51D3C4826002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-OSX"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803A51D3C4826002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-OSX"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803831D3C4668002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-iOS"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803831D3C4668002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-iOS"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5C7803831D3C4668002107FB"
|
||||
BuildableName = "PusherKit.framework"
|
||||
BlueprintName = "PusherKit-iOS"
|
||||
ReferencedContainer = "container:NWPusher.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016 noodlewerk. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// PusherKit-OSX.h
|
||||
// PusherKit-OSX
|
||||
//
|
||||
// Created by Sash Zats on 7/17/16.
|
||||
// Copyright © 2016 noodlewerk. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
//! Project version number for PusherKit-OSX.
|
||||
FOUNDATION_EXPORT double PusherKit_OSXVersionNumber;
|
||||
|
||||
//! Project version string for PusherKit-OSX.
|
||||
FOUNDATION_EXPORT const unsigned char PusherKit_OSXVersionString[];
|
||||
|
||||
#import <PusherKit/NWHub.h>
|
||||
#import <PusherKit/NWLCore.h>
|
||||
#import <PusherKit/NWNotification.h>
|
||||
#import <PusherKit/NWPushFeedback.h>
|
||||
#import <PusherKit/NWPusher.h>
|
||||
#import <PusherKit/NWSSLConnection.h>
|
||||
#import <PusherKit/NWSecTools.h>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// PusherKit-iOS.h
|
||||
// PusherKit-iOS
|
||||
//
|
||||
// Created by Sash Zats on 7/17/16.
|
||||
// Copyright © 2016 noodlewerk. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for PusherKit-iOS.
|
||||
FOUNDATION_EXPORT double PusherKit_iOSVersionNumber;
|
||||
|
||||
//! Project version string for PusherKit-iOS.
|
||||
FOUNDATION_EXPORT const unsigned char PusherKit_iOSVersionString[];
|
||||
|
||||
#import <PusherKit/NWHub.h>
|
||||
#import <PusherKit/NWLCore.h>
|
||||
#import <PusherKit/NWNotification.h>
|
||||
#import <PusherKit/NWPusher.h>
|
||||
#import <PusherKit/NWSSLConnection.h>
|
||||
#import <PusherKit/NWSecTools.h>
|
||||
#import <PusherKit/NWPushFeedback.h>
|
||||
@@ -11,7 +11,7 @@ Pusher
|
||||
|
||||
Installation
|
||||
------------
|
||||
Install the Mac app using [Homebrew cask](https://github.com/phinze/homebrew-cask):
|
||||
Install the Mac app using [Homebrew cask](https://github.com/caskroom/homebrew-cask):
|
||||
|
||||
```shell
|
||||
brew cask install pusher
|
||||
@@ -21,10 +21,16 @@ Or download the latest `Pusher.app` binary:
|
||||
|
||||
- [Download latest binary](https://github.com/noodlewerk/NWPusher/releases/latest)
|
||||
|
||||
Alternatively, you can include NWPusher as a framework, using [CocoaPods](http://cocoapods.org/):
|
||||
Alternatively, you can include NWPusher as a framework, using [CocoaPods](https://cocoapods.org/):
|
||||
|
||||
```ruby
|
||||
pod 'NWPusher', '~> 0.6.1'
|
||||
pod 'NWPusher', '~> 0.7.0'
|
||||
```
|
||||
|
||||
or [Carthage](https://github.com/Carthage/Carthage) (iOS 8+ is required to use Cocoa Touch Frameworks)
|
||||
|
||||
```
|
||||
github "noodlewerk/NWPusher"
|
||||
```
|
||||
|
||||
Or simply include the source files you need. NWPusher has a modular architecture and does not have any external dependencies, so use what you like.
|
||||
@@ -179,7 +185,7 @@ Pushing from code
|
||||
Pusher can also be used as a framework to send notifications programmatically. The included Xcode project provides examples for both OS X and iOS. The easiest way to include NWPusher is through CocoaPods:
|
||||
|
||||
```ruby
|
||||
pod 'NWPusher', '~> 0.6.1'
|
||||
pod 'NWPusher', '~> 0.7.0'
|
||||
```
|
||||
|
||||
CocoaPods also compiles documentation, which can be accessed through [CocoaDocs](http://cocoadocs.org/docsets/NWPusher). Alternatively you can include just the files you need from the `Classes` folder. Make sure you link with `Foundation.framework` and `Security.framework`.
|
||||
@@ -228,7 +234,7 @@ After a second or so, we can take a look to see if the notification was accepted
|
||||
} else if (read) {
|
||||
NSLog(@"Read and none failed");
|
||||
} else {
|
||||
NSLog(@"Unable to read failed: %@", error);
|
||||
NSLog(@"Unable to read: %@", error);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -292,6 +298,46 @@ When connected read the device token and date of invalidation:
|
||||
|
||||
Apple closes the connection after the last device token is read.
|
||||
|
||||
Pushing to macOS
|
||||
---------------
|
||||
|
||||
On macOS, you obtain a device token for your app by calling the `registerForRemoteNotificationTypes:` method of the `NSApplication` object. It is recommended that you call this method at launch time as part of your normal startup sequence. The first time your app calls this method, the app object requests the token from APNs. After the initial call, the app object contacts APNs only when the device token changes; otherwise, it returns the existing token quickly.
|
||||
|
||||
The app object notifies its delegate asynchronously upon the successful or unsuccessful retrieval of the device token. You use these delegate callbacks to process the device token or to handle any errors that arose. You must implement the following delegate methods to track whether registration was successful:
|
||||
|
||||
- Use the `application:didRegisterForRemoteNotificationsWithDeviceToken:` to receive the device token and forward it to your server.
|
||||
- Use the `application:didFailToRegisterForRemoteNotificationsWithError:` to respond to errors.
|
||||
|
||||
Note: If the device token changes while your app is running, the app object calls the appropriate delegate method again to notify you of the change.
|
||||
|
||||
The app delegate calls the `registerForRemoteNotificationTypes:` method as part of its regular launch-time setup, passing along the types of interactions that you intend to use. Upon receiving the device token, the `application:didRegisterForRemoteNotificationsWithDeviceToken:` method forwards it to the app’s associated server using a custom method. If an error occurs during registration, the app temporarily disables any features related to remote notifications. Those features are re-enabled when a valid device token is received.
|
||||
|
||||
```objective-c
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
// Configure the user interactions first.
|
||||
[self configureUserInteractions];
|
||||
|
||||
[NSApp registerForRemoteNotificationTypes:(NSRemoteNotificationTypeAlert | NSRemoteNotificationTypeSound)];
|
||||
}
|
||||
```
|
||||
|
||||
```objective-c
|
||||
- (void)application:(NSApplication *)application
|
||||
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
||||
// Forward the token to your server.
|
||||
[self forwardTokenToServer:deviceToken];
|
||||
}
|
||||
```
|
||||
|
||||
```objective-c
|
||||
- (void)application:(NSApplication *)application
|
||||
didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
|
||||
NSLog(@"Remote notification support is unavailable due to error: %@", error);
|
||||
[self disableRemoteNotificationFeatures];
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Certificate and key files
|
||||
-------------------------
|
||||
Pusher reads certificate and key data from PKCS12 files. This is a binary format that bundles both X.509 certificates and a private key in one file. Conversion from other file formats to and from PKCS12 is provided by the OpenSSL CLI.
|
||||
@@ -360,6 +406,8 @@ If it fails to connect then check:
|
||||
|
||||
- Can you connect with the push servers? Try `[NWPusher connectWithIdentity:identity error:&error]` or `[NWPusher connectWithPKCS12Data:pkcs12 password:password error:&error]`.
|
||||
|
||||
- Pusher connects on port `2195` with hosts `gateway.push.apple.com` and `gateway.sandbox.push.apple.com`, and on port `2196` with hosts `feedback.push.apple.com` and `feedback.sandbox.push.apple.com`. Make sure your firewall is configured to allow these connections.
|
||||
|
||||
If nothing is delivered to the device then check:
|
||||
|
||||
- Is the device online? Is it able to receive push notifications from other services? Try to get pushes from other apps, for example a messenger. Many wireless connections work visibly fine, but do not deliver push notifications. Try to switch to another wifi or cellular network.
|
||||
|
||||
+132
-40
@@ -6,12 +6,7 @@
|
||||
//
|
||||
|
||||
#import "NWAppDelegate.h"
|
||||
#import "NWHub.h"
|
||||
#import "NWPusher.h"
|
||||
#import "NWNotification.h"
|
||||
#import "NWLCore.h"
|
||||
#import "NWSSLConnection.h"
|
||||
#import "NWSecTools.h"
|
||||
#import <PusherKit/PusherKit.h>
|
||||
|
||||
// TODO: Export your push certificate and key in PKCS12 format to pusher.p12 in the root of the project directory.
|
||||
static NSString * const pkcs12FileName = @"pusher.p12";
|
||||
@@ -32,9 +27,13 @@ static NWPusherViewController *controller = nil;
|
||||
UITextField *_textField;
|
||||
UIButton *_pushButton;
|
||||
UILabel *_infoLabel;
|
||||
UISwitch *_sanboxSwitch;
|
||||
NWHub *_hub;
|
||||
NSUInteger _index;
|
||||
dispatch_queue_t _serial;
|
||||
|
||||
NWIdentityRef _identity;
|
||||
NWCertificateRef _certificate;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
@@ -47,11 +46,22 @@ static NWPusherViewController *controller = nil;
|
||||
_serial = dispatch_queue_create("NWAppDelegate", DISPATCH_QUEUE_SERIAL);
|
||||
|
||||
_connectButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
_connectButton.frame = CGRectMake(20, 20, self.view.bounds.size.width - 40, 40);
|
||||
_connectButton.frame = CGRectMake(20, 20, (self.view.bounds.size.width - 40)/2, 40);
|
||||
[_connectButton setTitle:@"Connect" forState:UIControlStateNormal];
|
||||
[_connectButton addTarget:self action:@selector(connect) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_connectButton addTarget:self action:@selector(connectButtonPressed) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.view addSubview:_connectButton];
|
||||
|
||||
_sanboxSwitch = [[UISwitch alloc] init];
|
||||
_sanboxSwitch.frame = CGRectMake((self.view.bounds.size.width + 40)/2, 20, 40, 40);
|
||||
[_sanboxSwitch addTarget:self action:@selector(sanboxCheckBoxDidPressed:) forControlEvents:UIControlEventValueChanged];
|
||||
[self.view addSubview:_sanboxSwitch];
|
||||
|
||||
UILabel *sandboxLabel = [[UILabel alloc] init];
|
||||
sandboxLabel.frame = CGRectMake(CGRectGetMaxX(_sanboxSwitch.frame) + 10, 20, 80, 40);
|
||||
sandboxLabel.font = [UIFont systemFontOfSize:12];
|
||||
sandboxLabel.text = @"Use sandbox";
|
||||
[self.view addSubview:sandboxLabel];
|
||||
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.frame = CGRectMake(20, 70, self.view.bounds.size.width - 40, 26);
|
||||
_textField.text = @"Testing..";
|
||||
@@ -66,46 +76,107 @@ static NWPusherViewController *controller = nil;
|
||||
[self.view addSubview:_pushButton];
|
||||
|
||||
_infoLabel = [[UILabel alloc] init];
|
||||
_infoLabel.frame = CGRectMake(20, 156, self.view.bounds.size.width - 40, 26);
|
||||
_infoLabel.frame = CGRectMake(20, 156, self.view.bounds.size.width - 40, 60);
|
||||
_infoLabel.font = [UIFont systemFontOfSize:12];
|
||||
_infoLabel.numberOfLines = 0;
|
||||
[self.view addSubview:_infoLabel];
|
||||
|
||||
NWLogInfo(@"Connect with Apple's Push Notification service");
|
||||
|
||||
[self loadCertificate];
|
||||
}
|
||||
|
||||
- (void)connect
|
||||
- (void)loadCertificate
|
||||
{
|
||||
if (!_hub) {
|
||||
NWLogInfo(@"Connecting..");
|
||||
_connectButton.enabled = NO;
|
||||
dispatch_async(_serial, ^{
|
||||
NSURL *url = [NSBundle.mainBundle URLForResource:pkcs12FileName withExtension:nil];
|
||||
NSData *pkcs12 = [NSData dataWithContentsOfURL:url];
|
||||
NSError *error = nil;
|
||||
NWHub *hub = [NWHub connectWithDelegate:self PKCS12Data:pkcs12 password:pkcs12Password error:&error];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (hub) {
|
||||
NSError *error = nil;
|
||||
NWCertificateRef certificate = [NWSecTools certificateWithIdentity:hub.pusher.connection.identity error:&error];
|
||||
NWError(error);
|
||||
BOOL sandbox = [NWSecTools isSandboxCertificate:certificate];
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:certificate];
|
||||
NWLogInfo(@"Connected to APN: %@%@", summary, sandbox ? @" (sandbox)" : @"");
|
||||
_hub = hub;
|
||||
_pushButton.enabled = YES;
|
||||
[_connectButton setTitle:@"Disconnect" forState:UIControlStateNormal];
|
||||
} else {
|
||||
NWLogWarn(@"Unable to connect: %@", error.localizedDescription);
|
||||
}
|
||||
_connectButton.enabled = YES;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
_pushButton.enabled = NO;
|
||||
[_hub disconnect]; _hub = nil;
|
||||
NWLogInfo(@"Disconnected");
|
||||
[_connectButton setTitle:@"Connect" forState:UIControlStateNormal];
|
||||
NSURL *url = [NSBundle.mainBundle URLForResource:pkcs12FileName withExtension:nil];
|
||||
NSData *pkcs12 = [NSData dataWithContentsOfURL:url];
|
||||
NSError *error = nil;
|
||||
|
||||
NSArray *ids = [NWSecTools identitiesWithPKCS12Data:pkcs12 password:pkcs12Password error:&error];
|
||||
if (!ids) {
|
||||
NWLogWarn(@"Unable to read p12 file: %@", error.localizedDescription);
|
||||
return;
|
||||
}
|
||||
for (NWIdentityRef identity in ids) {
|
||||
NSError *error = nil;
|
||||
NWCertificateRef certificate = [NWSecTools certificateWithIdentity:identity error:&error];
|
||||
if (!certificate) {
|
||||
NWLogWarn(@"Unable to import p12 file: %@", error.localizedDescription);
|
||||
return;
|
||||
}
|
||||
|
||||
_identity = identity;
|
||||
_certificate = certificate;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)sanboxCheckBoxDidPressed:(UISwitch *)sender
|
||||
{
|
||||
if (_certificate)
|
||||
{
|
||||
[self disconnect];
|
||||
[self connectToEnvironment:[self selectedEnvironmentForCertificate:_certificate]];
|
||||
}
|
||||
}
|
||||
|
||||
- (NWEnvironment)selectedEnvironmentForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
return _sanboxSwitch.isOn ? NWEnvironmentSandbox : NWEnvironmentProduction;
|
||||
}
|
||||
|
||||
- (NWEnvironment)preferredEnvironmentForCertificate:(NWCertificateRef)certificate
|
||||
{
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
|
||||
return (environmentOptions & NWEnvironmentOptionSandbox) ? NWEnvironmentSandbox : NWEnvironmentProduction;
|
||||
}
|
||||
|
||||
- (void)connectButtonPressed
|
||||
{
|
||||
if (_hub)
|
||||
{
|
||||
[self disconnect];
|
||||
_connectButton.enabled = YES;
|
||||
[_connectButton setTitle:@"Connect" forState:UIControlStateNormal];
|
||||
return;
|
||||
}
|
||||
|
||||
NWEnvironment preferredEnvironment = [self preferredEnvironmentForCertificate:_certificate];
|
||||
|
||||
[self connectToEnvironment:preferredEnvironment];
|
||||
}
|
||||
|
||||
- (void)disconnect
|
||||
{
|
||||
[self disableButtons];
|
||||
[_hub disconnect]; _hub = nil;
|
||||
NWLogInfo(@"Disconnected");
|
||||
}
|
||||
|
||||
- (void)connectToEnvironment:(NWEnvironment)environment
|
||||
{
|
||||
[self disableButtons];
|
||||
|
||||
NWLogInfo(@"Connecting..");
|
||||
dispatch_async(_serial, ^{
|
||||
NSError *error = nil;
|
||||
|
||||
NWHub *hub = [NWHub connectWithDelegate:self identity:_identity environment:environment error:&error];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (hub) {
|
||||
NSString *summary = [NWSecTools summaryWithCertificate:_certificate];
|
||||
NWLogInfo(@"Connected to APN: %@ (%@)", summary, descriptionForEnvironent(environment));
|
||||
_hub = hub;
|
||||
|
||||
[_connectButton setTitle:@"Disconnect" forState:UIControlStateNormal];
|
||||
} else {
|
||||
NWLogWarn(@"Unable to connect: %@", error.localizedDescription);
|
||||
}
|
||||
|
||||
[self enableButtonsForCertificate:_certificate environment:environment];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (void)push
|
||||
@@ -131,6 +202,27 @@ static NWPusherViewController *controller = nil;
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - BUtton states
|
||||
|
||||
- (void)disableButtons
|
||||
{
|
||||
_pushButton.enabled = NO;
|
||||
_connectButton.enabled = NO;
|
||||
_sanboxSwitch.enabled = NO;
|
||||
}
|
||||
|
||||
- (void)enableButtonsForCertificate:(NWCertificateRef)certificate environment:(NWEnvironment)environment
|
||||
{
|
||||
NWEnvironmentOptions environmentOptions = [NWSecTools environmentOptionsForCertificate:certificate];
|
||||
|
||||
BOOL shouldEnableEnvButton = (environmentOptions == NWEnvironmentOptionAny);
|
||||
BOOL shouldSelectSandboxEnv = (environment == NWEnvironmentSandbox);
|
||||
|
||||
_pushButton.enabled = YES;
|
||||
_connectButton.enabled = YES;
|
||||
_sanboxSwitch.enabled = shouldEnableEnvButton;
|
||||
_sanboxSwitch.on = shouldSelectSandboxEnv;
|
||||
}
|
||||
|
||||
#pragma mark - NWLogging
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.noodlewerk.pusher</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -32,11 +32,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.6.1</string>
|
||||
<string>0.7.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>12</string>
|
||||
<string>19</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIPrerenderedIcon</key>
|
||||
|
||||
Reference in New Issue
Block a user