diff --git a/RNNotifications/OCMock/NSNotificationCenter+OCMAdditions.h b/RNNotifications/OCMock/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000000000000000000000000000000000000..7d58aabea84f2e17023f13483292c7c63957d3d2 --- /dev/null +++ b/RNNotifications/OCMock/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/RNNotifications/OCMock/OCMArg.h b/RNNotifications/OCMock/OCMArg.h new file mode 100644 index 0000000000000000000000000000000000000000..6df735e99ef9ad5daf1104c2fca1c70609f81a8b --- /dev/null +++ b/RNNotifications/OCMock/OCMArg.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2009-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first,... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + #define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) +#else + #define OCMOCK_VALUE(variable) [NSValue value:&variable withObjCType:@encode(__typeof__(variable))] +#endif + diff --git a/RNNotifications/OCMock/OCMConstraint.h b/RNNotifications/OCMock/OCMConstraint.h new file mode 100644 index 0000000000000000000000000000000000000000..19fc1a713cdb4c8be21e2fc6e8da29914ac76b28 --- /dev/null +++ b/RNNotifications/OCMock/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ + @public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ + @public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + + +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] diff --git a/RNNotifications/OCMock/OCMFunctions.h b/RNNotifications/OCMock/OCMFunctions.h new file mode 100644 index 0000000000000000000000000000000000000000..b0c2df353c583b6eed29bebf03fe8fee30f315d4 --- /dev/null +++ b/RNNotifications/OCMock/OCMFunctions.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2014-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); diff --git a/RNNotifications/OCMock/OCMLocation.h b/RNNotifications/OCMock/OCMLocation.h new file mode 100644 index 0000000000000000000000000000000000000000..7870c5297838bde520810c190d731b784a0528a6 --- /dev/null +++ b/RNNotifications/OCMock/OCMLocation.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import "OCMFunctions.h" + + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/RNNotifications/OCMock/OCMMacroState.h b/RNNotifications/OCMock/OCMMacroState.h new file mode 100644 index 0000000000000000000000000000000000000000..dba41bebdc0ada515cd9a8ebf77ff4d6240fe52b --- /dev/null +++ b/RNNotifications/OCMock/OCMMacroState.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +@end diff --git a/RNNotifications/OCMock/OCMRecorder.h b/RNNotifications/OCMock/OCMRecorder.h new file mode 100644 index 0000000000000000000000000000000000000000..9670d085f4bd07ef76d7b03dd52f63e31fb4d852 --- /dev/null +++ b/RNNotifications/OCMock/OCMRecorder.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2014-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; + +- (OCMInvocationMatcher *)invocationMatcher; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end diff --git a/RNNotifications/OCMock/OCMStubRecorder.h b/RNNotifications/OCMock/OCMStubRecorder.h new file mode 100644 index 0000000000000000000000000000000000000000..e32029fc222a78d91f598ce2e6cc2ae024e677c0 --- /dev/null +++ b/RNNotifications/OCMock/OCMStubRecorder.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2004-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +@end + + + diff --git a/RNNotifications/OCMock/OCMock.h b/RNNotifications/OCMock/OCMock.h new file mode 100644 index 0000000000000000000000000000000000000000..9d558135bff2348fd224468aec08a63404d7eca7 --- /dev/null +++ b/RNNotifications/OCMock/OCMock.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2004-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define ClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#define OCMVerifyAll(mock) [mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/RNNotifications/OCMock/OCMockObject.h b/RNNotifications/OCMock/OCMockObject.h new file mode 100644 index 0000000000000000000000000000000000000000..31f7ac41d9e3d833e6038514ff0ce1b965044ecc --- /dev/null +++ b/RNNotifications/OCMock/OCMockObject.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2004-2016 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock; + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; + +@end + diff --git a/RNNotifications/RNBridgeModule.m b/RNNotifications/RNBridgeModule.m index fd5653b77a9703f01f9366ece6d7a3acd1f76497..04e357cdc5c12522ef57244e65088db8b4a96e5e 100644 --- a/RNNotifications/RNBridgeModule.m +++ b/RNNotifications/RNBridgeModule.m @@ -3,6 +3,7 @@ #import "RCTConvert+RNNotifications.h" #import "RNNotificationsStore.h" #import +#import @implementation RNBridgeModule { RNCommandsHandler* _commandsHandler; diff --git a/RNNotifications/RNCommandsHandler.h b/RNNotifications/RNCommandsHandler.h index 244726803494ce4f4408d0f297b11de21bab492a..b8bf9b4165cdc8b50ab796cf9aad6fdc15156e6d 100644 --- a/RNNotifications/RNCommandsHandler.h +++ b/RNNotifications/RNCommandsHandler.h @@ -1,5 +1,4 @@ #import -#import #import "RNNotificationCenter.h" @interface RNCommandsHandler : NSObject diff --git a/RNNotifications/RNNotificationCenter.h b/RNNotifications/RNNotificationCenter.h index 472ef2eee561fdd1a2a367cd530ead586f9dbb21..b9f461caeff5a1ddc0a2c61eaee40e18659c2eda 100644 --- a/RNNotifications/RNNotificationCenter.h +++ b/RNNotifications/RNNotificationCenter.h @@ -1,5 +1,9 @@ #import -#import + +typedef void (^RCTPromiseResolveBlock)(id result); +typedef void (^RCTResponseSenderBlock)(NSArray *response); +typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error); + @import UserNotifications; @interface RNNotificationCenter : NSObject diff --git a/RNNotifications/RNNotificationCenter.m b/RNNotifications/RNNotificationCenter.m index af4c11053d9bdb78dda9415c40fe1c70340a3252..0741825ad5ebc0ba30132ad5e40127b05736f350 100644 --- a/RNNotifications/RNNotificationCenter.m +++ b/RNNotifications/RNNotificationCenter.m @@ -15,20 +15,14 @@ [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:categories]; UNAuthorizationOptions authOptions = (UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert); [UNUserNotificationCenter.currentNotificationCenter requestAuthorizationWithOptions:authOptions completionHandler:^(BOOL granted, NSError * _Nullable error) { - if (error) { - - } else { - if (granted) { - [UNUserNotificationCenter.currentNotificationCenter getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { - if (settings.authorizationStatus == UNAuthorizationStatusAuthorized) { - dispatch_async(dispatch_get_main_queue(), ^{ - [[UIApplication sharedApplication] registerForRemoteNotifications]; - }); - } - }]; - } else { - - } + if (!error && granted) { + [UNUserNotificationCenter.currentNotificationCenter getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { + if (settings.authorizationStatus == UNAuthorizationStatusAuthorized) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] registerForRemoteNotifications]; + }); + } + }]; } }]; } diff --git a/RNNotifications/RNNotificationEventHandler.h b/RNNotifications/RNNotificationEventHandler.h index 413e0cd4afdbf3eb18fd9dbd73af5211793c391f..ce16fc645f505c672d4d1ef79bfb6abda8fbc445 100644 --- a/RNNotifications/RNNotificationEventHandler.h +++ b/RNNotifications/RNNotificationEventHandler.h @@ -11,6 +11,6 @@ - (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; - (void)didReceiveForegroundNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler; -- (void)didReceiveNotificationResponse:(UNNotificationResponse *)notificationResponse completionHandler:(void (^)())completionHandler; +- (void)didReceiveNotificationResponse:(UNNotificationResponse *)notificationResponse completionHandler:(void (^)(void))completionHandler; @end diff --git a/RNNotifications/RNNotificationEventHandler.m b/RNNotifications/RNNotificationEventHandler.m index 7dac47e566a8ae0dbabb69db6193357c3a8d598b..edc4fd4c41e31e2fb8132cde62f6d0a50b827bfa 100644 --- a/RNNotifications/RNNotificationEventHandler.m +++ b/RNNotifications/RNNotificationEventHandler.m @@ -28,7 +28,7 @@ [RNEventEmitter sendEvent:RNNotificationReceivedForeground body:[RNNotificationParser parseNotification:notification]]; } -- (void)didReceiveNotificationResponse:(UNNotificationResponse *)response completionHandler:(void (^)())completionHandler { +- (void)didReceiveNotificationResponse:(UNNotificationResponse *)response completionHandler:(void (^)(void))completionHandler { [_store setActionCompletionHandler:completionHandler withCompletionKey:response.notification.request.identifier]; [RNEventEmitter sendEvent:RNNotificationOpened body:[RNNotificationParser parseNotificationResponse:response]]; } diff --git a/RNNotifications/RNNotifications.m b/RNNotifications/RNNotifications.m index 714a62ac69fccf47dc4898db3ff26a0a9db5b142..501410be8ca5c4720edfc924437d2749df282845 100644 --- a/RNNotifications/RNNotifications.m +++ b/RNNotifications/RNNotifications.m @@ -1,7 +1,6 @@ #import #import -#import #import "RNNotifications.h" #import "RNNotificationCenterListener.h" #import "RNPushKit.h" diff --git a/RNNotifications/RNNotifications.xcodeproj/project.pbxproj b/RNNotifications/RNNotifications.xcodeproj/project.pbxproj index cbe7f6cb9a430a3c4c9e1e090d94084e3264b9b3..9bb00f21e5120e9a2c95ce8695b58cf932a39743 100644 --- a/RNNotifications/RNNotifications.xcodeproj/project.pbxproj +++ b/RNNotifications/RNNotifications.xcodeproj/project.pbxproj @@ -7,18 +7,32 @@ objects = { /* Begin PBXBuildFile section */ + 50002A4D22E88266008F6742 /* RNCommandsHandlerIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50002A4C22E88266008F6742 /* RNCommandsHandlerIntegrationTest.m */; }; + 50002A8022E8885A008F6742 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50002A7F22E8885A008F6742 /* libOCMock.a */; }; + 50002AC822E9D5EA008F6742 /* RNNotificationsStoreTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 50002AC722E9D5EA008F6742 /* RNNotificationsStoreTests.m */; }; + 50002ACA22E9DB8A008F6742 /* RNNotificationEventHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 50002AC922E9DB8A008F6742 /* RNNotificationEventHandlerTests.m */; }; 50351F8F22CD782F000713B3 /* RNEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 50351F8E22CD782F000713B3 /* RNEventEmitter.m */; }; 50351F9222CD7DF4000713B3 /* RNBridgeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 50351F9122CD7DF4000713B3 /* RNBridgeModule.m */; }; 50351F9522CD7FF1000713B3 /* RCTConvert+RNNotifications.m in Sources */ = {isa = PBXBuildFile; fileRef = 50351F9422CD7FF1000713B3 /* RCTConvert+RNNotifications.m */; }; 50351F9822CD8604000713B3 /* RNCommandsHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 50351F9722CD8604000713B3 /* RNCommandsHandler.m */; }; + 504D54BE22E4B8660088F2E4 /* RNBridgeModuleIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 504D54BD22E4B8660088F2E4 /* RNBridgeModuleIntegrationTest.m */; }; 507DCCF522CE3EBD005D4E0B /* RNNotifications.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D8A2F7561CB57F28002CC8F5 /* RNNotifications.h */; }; 507DCCF722CE3EF7005D4E0B /* RNBridgeModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 50351F9022CD7DF4000713B3 /* RNBridgeModule.h */; }; 507DCCF922CE3F04005D4E0B /* RNNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = D8A2F7561CB57F28002CC8F5 /* RNNotifications.h */; }; 507DCCFA22CE3F04005D4E0B /* RNEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 50351F8D22CD782F000713B3 /* RNEventEmitter.h */; }; 507DCCFB22CE3F04005D4E0B /* RNCommandsHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 50351F9622CD8604000713B3 /* RNCommandsHandler.h */; }; 507DCCFC22CE3F04005D4E0B /* RCTConvert+RNNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 50351F9322CD7FF1000713B3 /* RCTConvert+RNNotifications.h */; }; + 50858B7822E87767008272FE /* libyoga.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B7722E87767008272FE /* libyoga.a */; }; + 50858B7922E8777C008272FE /* libRNNotifications.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134814201AA4EA6300B7C361 /* libRNNotifications.a */; }; + 50858B7B22E87FBA008272FE /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B7A22E87FBA008272FE /* libRCTActionSheet.a */; }; + 50858B7D22E87FBA008272FE /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B7C22E87FBA008272FE /* libRCTImage.a */; }; + 50858B7F22E87FBA008272FE /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B7E22E87FBA008272FE /* libRCTLinking.a */; }; + 50858B8122E87FBA008272FE /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B8022E87FBA008272FE /* libRCTNetwork.a */; }; + 50858B8322E87FBA008272FE /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B8222E87FBA008272FE /* libRCTSettings.a */; }; + 50858B8522E87FBA008272FE /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B8422E87FBA008272FE /* libRCTText.a */; }; + 50858B8722E87FBA008272FE /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B8622E87FBA008272FE /* libRCTVibration.a */; }; + 50858B8922E87FBA008272FE /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50858B8822E87FBA008272FE /* libRCTWebSocket.a */; }; 508CE7CB22D12B2600357815 /* RNNotificationsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 508CE7CA22D12B2600357815 /* RNNotificationsTests.m */; }; - 508CE7CD22D12B2600357815 /* libRNNotifications.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134814201AA4EA6300B7C361 /* libRNNotifications.a */; }; 508CE7D522D12CCA00357815 /* RNNotificationEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 508CE7D322D12CCA00357815 /* RNNotificationEventHandler.h */; }; 508CE7D622D12CCA00357815 /* RNNotificationEventHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 508CE7D422D12CCA00357815 /* RNNotificationEventHandler.m */; }; 508CE81422D12FC700357815 /* RNNotificationCenterListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 508CE81322D12FC600357815 /* RNNotificationCenterListener.m */; }; @@ -31,6 +45,9 @@ 508CE82322D1372E00357815 /* RNNotificationUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 508CE82122D1372E00357815 /* RNNotificationUtils.m */; }; 50AD1FCA22D13ADB00E12362 /* RNPushKitEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 50AD1FC822D13ADB00E12362 /* RNPushKitEventHandler.h */; }; 50AD1FCB22D13ADB00E12362 /* RNPushKitEventHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 50AD1FC922D13ADB00E12362 /* RNPushKitEventHandler.m */; }; + 50E4164822E4CA500048367F /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E4164722E4CA500048367F /* libReact.a */; }; + 50E4164A22E4CA5A0048367F /* libcxxreact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50E4164922E4CA5A0048367F /* libcxxreact.a */; }; + 50E4164D22E4CA750048367F /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 504D54E422E4BCE00088F2E4 /* JavaScriptCore.framework */; }; 50E49F0722D1E4E0007160C1 /* RNNotificationsStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 50E49F0522D1E4E0007160C1 /* RNNotificationsStore.h */; }; 50E49F0822D1E4E0007160C1 /* RNNotificationsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 50E49F0622D1E4E0007160C1 /* RNNotificationsStore.m */; }; 50FED76622D3E06500DDD516 /* RNNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 50FED76422D3E06500DDD516 /* RNNotificationCenter.h */; }; @@ -65,6 +82,10 @@ /* Begin PBXFileReference section */ 134814201AA4EA6300B7C361 /* libRNNotifications.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNNotifications.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50002A4C22E88266008F6742 /* RNCommandsHandlerIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNCommandsHandlerIntegrationTest.m; sourceTree = ""; }; + 50002A7F22E8885A008F6742 /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libOCMock.a; sourceTree = ""; }; + 50002AC722E9D5EA008F6742 /* RNNotificationsStoreTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNotificationsStoreTests.m; sourceTree = ""; }; + 50002AC922E9DB8A008F6742 /* RNNotificationEventHandlerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNotificationEventHandlerTests.m; sourceTree = ""; }; 50351F8D22CD782F000713B3 /* RNEventEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNEventEmitter.h; sourceTree = ""; }; 50351F8E22CD782F000713B3 /* RNEventEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNEventEmitter.m; sourceTree = ""; }; 50351F9022CD7DF4000713B3 /* RNBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNBridgeModule.h; sourceTree = ""; }; @@ -73,7 +94,36 @@ 50351F9422CD7FF1000713B3 /* RCTConvert+RNNotifications.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+RNNotifications.m"; sourceTree = ""; }; 50351F9622CD8604000713B3 /* RNCommandsHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNCommandsHandler.h; sourceTree = ""; }; 50351F9722CD8604000713B3 /* RNCommandsHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNCommandsHandler.m; sourceTree = ""; }; - 508CE7C822D12B2600357815 /* RNNotificationsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNNotificationsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54BD22E4B8660088F2E4 /* RNBridgeModuleIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNBridgeModuleIntegrationTest.m; sourceTree = ""; }; + 504D54CC22E4BCB80088F2E4 /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54CE22E4BCB80088F2E4 /* libdouble-conversion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libdouble-conversion.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54D022E4BCB80088F2E4 /* libfishhook.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libfishhook.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54D222E4BCB80088F2E4 /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54D422E4BCB80088F2E4 /* libRCTLinking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTLinking.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54D622E4BCB80088F2E4 /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54D822E4BCB80088F2E4 /* libRCTSettings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTSettings.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54DA22E4BCB80088F2E4 /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54DC22E4BCB80088F2E4 /* libRCTVibration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTVibration.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54DE22E4BCB80088F2E4 /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54E022E4BCB80088F2E4 /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54E222E4BCB80088F2E4 /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54E422E4BCE00088F2E4 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + 504D54E622E4BDD10088F2E4 /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54E822E4BE2C0088F2E4 /* libjsi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsi.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54EA22E4BE3A0088F2E4 /* libdouble-conversion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libdouble-conversion.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54EC22E4BE470088F2E4 /* libjsiexecutor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsiexecutor.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54EE22E4BE470088F2E4 /* libjsinspector.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsinspector.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54F022E4BE470088F2E4 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTActionSheet.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 504D54F222E4BE470088F2E4 /* libthird-party.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libthird-party.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B7722E87767008272FE /* libyoga.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libyoga.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B7A22E87FBA008272FE /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTActionSheet.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B7C22E87FBA008272FE /* libRCTImage.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTImage.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B7E22E87FBA008272FE /* libRCTLinking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTLinking.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B8022E87FBA008272FE /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B8222E87FBA008272FE /* libRCTSettings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTSettings.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B8422E87FBA008272FE /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B8622E87FBA008272FE /* libRCTVibration.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTVibration.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50858B8822E87FBA008272FE /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; }; 508CE7CA22D12B2600357815 /* RNNotificationsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNotificationsTests.m; sourceTree = ""; }; 508CE7CC22D12B2600357815 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 508CE7D322D12CCA00357815 /* RNNotificationEventHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNotificationEventHandler.h; sourceTree = ""; }; @@ -88,6 +138,10 @@ 508CE82122D1372E00357815 /* RNNotificationUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNotificationUtils.m; sourceTree = ""; }; 50AD1FC822D13ADB00E12362 /* RNPushKitEventHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNPushKitEventHandler.h; sourceTree = ""; }; 50AD1FC922D13ADB00E12362 /* RNPushKitEventHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNPushKitEventHandler.m; sourceTree = ""; }; + 50E4164622E4C98B0048367F /* RNNotificationsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNNotificationsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 50E4164722E4CA500048367F /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50E4164922E4CA5A0048367F /* libcxxreact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcxxreact.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 50E4164B22E4CA6A0048367F /* libjsi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libjsi.a; sourceTree = BUILT_PRODUCTS_DIR; }; 50E49F0522D1E4E0007160C1 /* RNNotificationsStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNotificationsStore.h; sourceTree = ""; }; 50E49F0622D1E4E0007160C1 /* RNNotificationsStore.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNotificationsStore.m; sourceTree = ""; }; 50FED76422D3E06500DDD516 /* RNNotificationCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNotificationCenter.h; sourceTree = ""; }; @@ -103,7 +157,20 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 508CE7CD22D12B2600357815 /* libRNNotifications.a in Frameworks */, + 50E4164D22E4CA750048367F /* JavaScriptCore.framework in Frameworks */, + 50E4164A22E4CA5A0048367F /* libcxxreact.a in Frameworks */, + 50858B7B22E87FBA008272FE /* libRCTActionSheet.a in Frameworks */, + 50858B7D22E87FBA008272FE /* libRCTImage.a in Frameworks */, + 50858B7F22E87FBA008272FE /* libRCTLinking.a in Frameworks */, + 50858B8122E87FBA008272FE /* libRCTNetwork.a in Frameworks */, + 50858B8322E87FBA008272FE /* libRCTSettings.a in Frameworks */, + 50858B8522E87FBA008272FE /* libRCTText.a in Frameworks */, + 50858B8722E87FBA008272FE /* libRCTVibration.a in Frameworks */, + 50858B8922E87FBA008272FE /* libRCTWebSocket.a in Frameworks */, + 50858B7822E87767008272FE /* libyoga.a in Frameworks */, + 50E4164822E4CA500048367F /* libReact.a in Frameworks */, + 50858B7922E8777C008272FE /* libRNNotifications.a in Frameworks */, + 50002A8022E8885A008F6742 /* libOCMock.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -125,10 +192,70 @@ name = Products; sourceTree = ""; }; + 50002A7222E8874F008F6742 /* Utils */ = { + isa = PBXGroup; + children = ( + ); + path = Utils; + sourceTree = ""; + }; + 504D54BC22E4B83E0088F2E4 /* Integration */ = { + isa = PBXGroup; + children = ( + 50002A7222E8874F008F6742 /* Utils */, + 504D54BD22E4B8660088F2E4 /* RNBridgeModuleIntegrationTest.m */, + 50002A4C22E88266008F6742 /* RNCommandsHandlerIntegrationTest.m */, + ); + path = Integration; + sourceTree = ""; + }; + 504D54CB22E4BCB80088F2E4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 50002A7F22E8885A008F6742 /* libOCMock.a */, + 50858B7A22E87FBA008272FE /* libRCTActionSheet.a */, + 50858B7C22E87FBA008272FE /* libRCTImage.a */, + 50858B7E22E87FBA008272FE /* libRCTLinking.a */, + 50858B8022E87FBA008272FE /* libRCTNetwork.a */, + 50858B8222E87FBA008272FE /* libRCTSettings.a */, + 50858B8422E87FBA008272FE /* libRCTText.a */, + 50858B8622E87FBA008272FE /* libRCTVibration.a */, + 50858B8822E87FBA008272FE /* libRCTWebSocket.a */, + 50858B7722E87767008272FE /* libyoga.a */, + 50E4164B22E4CA6A0048367F /* libjsi.a */, + 50E4164922E4CA5A0048367F /* libcxxreact.a */, + 50E4164722E4CA500048367F /* libReact.a */, + 504D54EC22E4BE470088F2E4 /* libjsiexecutor.a */, + 504D54EE22E4BE470088F2E4 /* libjsinspector.a */, + 504D54F022E4BE470088F2E4 /* libRCTActionSheet.a */, + 504D54F222E4BE470088F2E4 /* libthird-party.a */, + 504D54EA22E4BE3A0088F2E4 /* libdouble-conversion.a */, + 504D54E822E4BE2C0088F2E4 /* libjsi.a */, + 504D54E622E4BDD10088F2E4 /* libReact.a */, + 504D54E422E4BCE00088F2E4 /* JavaScriptCore.framework */, + 504D54CC22E4BCB80088F2E4 /* libcxxreact.a */, + 504D54CE22E4BCB80088F2E4 /* libdouble-conversion.a */, + 504D54D022E4BCB80088F2E4 /* libfishhook.a */, + 504D54D222E4BCB80088F2E4 /* libRCTImage.a */, + 504D54D422E4BCB80088F2E4 /* libRCTLinking.a */, + 504D54D622E4BCB80088F2E4 /* libRCTNetwork.a */, + 504D54D822E4BCB80088F2E4 /* libRCTSettings.a */, + 504D54DA22E4BCB80088F2E4 /* libRCTText.a */, + 504D54DC22E4BCB80088F2E4 /* libRCTVibration.a */, + 504D54DE22E4BCB80088F2E4 /* libRCTWebSocket.a */, + 504D54E022E4BCB80088F2E4 /* libReact.a */, + 504D54E222E4BCB80088F2E4 /* libyoga.a */, + ); + name = Frameworks; + sourceTree = ""; + }; 508CE7C922D12B2600357815 /* RNNotificationsTests */ = { isa = PBXGroup; children = ( + 504D54BC22E4B83E0088F2E4 /* Integration */, 508CE7CA22D12B2600357815 /* RNNotificationsTests.m */, + 50002AC722E9D5EA008F6742 /* RNNotificationsStoreTests.m */, + 50002AC922E9DB8A008F6742 /* RNNotificationEventHandlerTests.m */, 508CE7CC22D12B2600357815 /* Info.plist */, ); path = RNNotificationsTests; @@ -199,7 +326,8 @@ 50351F9722CD8604000713B3 /* RNCommandsHandler.m */, 508CE7C922D12B2600357815 /* RNNotificationsTests */, 134814211AA4EA7D00B7C361 /* Products */, - 508CE7C822D12B2600357815 /* RNNotificationsTests.xctest */, + 504D54CB22E4BCB80088F2E4 /* Frameworks */, + 50E4164622E4C98B0048367F /* RNNotificationsTests.xctest */, ); sourceTree = ""; }; @@ -245,7 +373,7 @@ ); name = RNNotificationsTests; productName = RNNotificationsTests; - productReference = 508CE7C822D12B2600357815 /* RNNotificationsTests.xctest */; + productReference = 50E4164622E4C98B0048367F /* RNNotificationsTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 58B511DA1A9E6C8500147676 /* RNNotifications */ = { @@ -317,7 +445,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 50002AC822E9D5EA008F6742 /* RNNotificationsStoreTests.m in Sources */, 508CE7CB22D12B2600357815 /* RNNotificationsTests.m in Sources */, + 504D54BE22E4B8660088F2E4 /* RNBridgeModuleIntegrationTest.m in Sources */, + 50002A4D22E88266008F6742 /* RNCommandsHandlerIntegrationTest.m in Sources */, + 50002ACA22E9DB8A008F6742 /* RNNotificationEventHandlerTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -376,13 +508,30 @@ CODE_SIGN_STYLE = Automatic; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/RNNotificationsTests/OCMock", + ); INFOPLIST_FILE = RNNotificationsTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ( + "-l\"c++\"", + "-ObjC", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -412,12 +561,29 @@ CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(PROJECT_DIR)/RNNotificationsTests/OCMock", + ); INFOPLIST_FILE = RNNotificationsTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); MTL_FAST_MATH = YES; + OTHER_LDFLAGS = ( + "-l\"c++\"", + "-ObjC", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/RNNotifications/RNNotifications.xcodeproj/xcshareddata/xcschemes/RNNotifications.xcscheme b/RNNotifications/RNNotifications.xcodeproj/xcshareddata/xcschemes/RNNotifications.xcscheme new file mode 100644 index 0000000000000000000000000000000000000000..c1dbfd567723bd729be03f7b93de212f98209685 --- /dev/null +++ b/RNNotifications/RNNotifications.xcodeproj/xcshareddata/xcschemes/RNNotifications.xcscheme @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RNNotifications/RNNotificationsStore.h b/RNNotifications/RNNotificationsStore.h index 3e54aa1d6fc2ea9f247078764719218231fc5cde..312a2107261667149f5091e8801bf40e3f32f2a9 100644 --- a/RNNotifications/RNNotificationsStore.h +++ b/RNNotifications/RNNotificationsStore.h @@ -9,8 +9,10 @@ - (void)completeAction:(NSString *)completionKey; - (void)completePresentation:(NSString *)completionKey withPresentationOptions:(UNNotificationPresentationOptions)presentationOptions; -- (void)setActionCompletionHandler:(void (^)())completionHandler withCompletionKey:(NSString *)completionKey; +- (void)setActionCompletionHandler:(void (^)(void))completionHandler withCompletionKey:(NSString *)completionKey; - (void)setPresentationCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler withCompletionKey:(NSString *)completionKey; +- (void (^)(void))getActionCompletionHandler:(NSString *)key; +- (void (^)(UNNotificationPresentationOptions))getPresentationCompletionHandler:(NSString *)key; @end diff --git a/RNNotifications/RNNotificationsStore.m b/RNNotifications/RNNotificationsStore.m index 624a5d37dd461b215b45bb32248114332eb874e1..d5e953aaa09acfe530bcc8df071851cf9bd3932e 100644 --- a/RNNotifications/RNNotificationsStore.m +++ b/RNNotifications/RNNotificationsStore.m @@ -21,7 +21,7 @@ NSMutableDictionary* _presentationCompletionHandlers; return self; } -- (void)setActionCompletionHandler:(void (^)())completionHandler withCompletionKey:(NSString *)completionKey { +- (void)setActionCompletionHandler:(void (^)(void))completionHandler withCompletionKey:(NSString *)completionKey { _actionCompletionHandlers[completionKey] = completionHandler; } @@ -29,6 +29,14 @@ NSMutableDictionary* _presentationCompletionHandlers; _presentationCompletionHandlers[completionKey] = completionHandler; } +- (void (^)(void))getActionCompletionHandler:(NSString *)key { + return _actionCompletionHandlers[key]; +} + +- (void (^)(UNNotificationPresentationOptions))getPresentationCompletionHandler:(NSString *)key { + return _presentationCompletionHandlers[key]; +} + - (void)completeAction:(NSString *)completionKey { void (^completionHandler)() = (void (^)())[_actionCompletionHandlers valueForKey:completionKey]; if (completionHandler) { @@ -41,7 +49,7 @@ NSMutableDictionary* _presentationCompletionHandlers; void (^completionHandler)() = (void (^)(UNNotificationPresentationOptions))[_presentationCompletionHandlers valueForKey:completionKey]; if (completionHandler) { completionHandler(presentationOptions); - [_actionCompletionHandlers removeObjectForKey:completionKey]; + [_presentationCompletionHandlers removeObjectForKey:completionKey]; } } diff --git a/RNNotifications/RNNotificationsTests/Integration/RNBridgeModuleIntegrationTest.m b/RNNotifications/RNNotificationsTests/Integration/RNBridgeModuleIntegrationTest.m new file mode 100644 index 0000000000000000000000000000000000000000..b76da813c610d921cac35e1acac554247a633c1b --- /dev/null +++ b/RNNotifications/RNNotificationsTests/Integration/RNBridgeModuleIntegrationTest.m @@ -0,0 +1,25 @@ +#import +#import "RNBridgeModule.h" +#import + +@interface RNBridgeModuleIntegrationTest : XCTestCase + +@property (nonatomic, strong) RNBridgeModule* bridgeModule; + +@end + +@implementation RNBridgeModuleIntegrationTest + +- (void)setUp { + +} + +- (void)tearDown { + +} + +- (void)testRequestPermissionsWithCategories { + +} + +@end diff --git a/RNNotifications/RNNotificationsTests/Integration/RNCommandsHandlerIntegrationTest.m b/RNNotifications/RNNotificationsTests/Integration/RNCommandsHandlerIntegrationTest.m new file mode 100644 index 0000000000000000000000000000000000000000..39220dca6eb1f3aa9725c2157ff3e1e6d9137bc1 --- /dev/null +++ b/RNNotifications/RNNotificationsTests/Integration/RNCommandsHandlerIntegrationTest.m @@ -0,0 +1,89 @@ +#import +#import +#import +#import "RNCommandsHandler.h" +#import "RNNotificationsStore.h" + +@interface RNCommandsHandlerIntegrationTest : XCTestCase +@property (nonatomic, retain) RNCommandsHandler* uut; +@property (nonatomic, retain) id notificationCenter; +@property (nonatomic, retain) id mockUserNotifications; +@end + +@implementation RNCommandsHandlerIntegrationTest + +- (void)setUp { + _mockUserNotifications = [OCMockObject mockForProtocol:[self getMockUserNotificationCenterProtocol]]; + id notificationCenterMock = OCMClassMock([UNUserNotificationCenter class]); + OCMStub(ClassMethod([notificationCenterMock currentNotificationCenter])).andReturn(_mockUserNotifications); + + UIApplication* sharedApplication = [OCMockObject mockForClass:[UIApplication class]]; + id mockedApplicationClass = OCMClassMock([UIApplication class]); + OCMStub(ClassMethod([mockedApplicationClass sharedApplication])).andReturn(sharedApplication); + + _uut = [RNCommandsHandler new]; + _notificationCenter = [UNUserNotificationCenter currentNotificationCenter]; +} + +- (void)testRequestPermissionsWithCategories_userAuthorizedPermissions { + NSArray* json = @[@{@"identifier": @"identifier"}]; + UNAuthorizationOptions authOptions = (UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert); + UNNotificationSettings* settings = [UNNotificationSettings new]; + [settings setValue:@(UNAuthorizationStatusAuthorized) forKey:@"authorizationStatus"]; + + [[_notificationCenter expect] setNotificationCategories:[OCMArg any]]; + [[_notificationCenter expect] requestAuthorizationWithOptions:authOptions completionHandler:[OCMArg invokeBlockWithArgs:@(YES), [NSNull null], nil]]; + [[_notificationCenter expect] getNotificationSettingsWithCompletionHandler:[OCMArg invokeBlockWithArgs:settings, nil]]; + [[(id)[UIApplication sharedApplication] expect] registerForRemoteNotifications]; + + [_uut requestPermissionsWithCategories:json]; + [_notificationCenter verify]; +} + +- (void)testRequestPermissionsWithCategories_userDeniedPermissions { + NSArray* json = @[@{@"identifier": @"identifier"}]; + UNAuthorizationOptions authOptions = (UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert); + UNNotificationSettings* settings = [UNNotificationSettings new]; + [settings setValue:@(UNAuthorizationStatusDenied) forKey:@"authorizationStatus"]; + + [[_notificationCenter expect] setNotificationCategories:[OCMArg any]]; + [[_notificationCenter expect] requestAuthorizationWithOptions:authOptions completionHandler:[OCMArg invokeBlockWithArgs:@(YES), [NSNull null], nil]]; + [[_notificationCenter expect] getNotificationSettingsWithCompletionHandler:[OCMArg invokeBlockWithArgs:settings, nil]]; + [[(id)[UIApplication sharedApplication] reject] registerForRemoteNotifications]; + + [_uut requestPermissionsWithCategories:json]; + [_notificationCenter verify]; +} + +- (void)testGetInitialNotification { + NSDictionary* initialNotification = @{}; + [[RNNotificationsStore sharedInstance] setInitialNotification:initialNotification]; + + [self.uut getInitialNotification:^(id result) { + XCTAssertEqual(result, initialNotification); + } reject:^(NSString *code, NSString *message, NSError *error) { + + }]; +} + + +- (Protocol *)getMockUserNotificationCenterProtocol { + Protocol *aProtocol = objc_getProtocol("MockUserNotificationCenter"); + if (!aProtocol) { + aProtocol = objc_allocateProtocol("MockUserNotificationCenter"); + unsigned int methodCount = 0; + Method *methods = class_copyMethodList([UNUserNotificationCenter class], &methodCount); + + for (unsigned int i = 0; i < methodCount; i++) { + Method method = methods[i]; + protocol_addMethodDescription(aProtocol, method_getName(method), method_getTypeEncoding(method), YES, YES); + } + + free(methods); + objc_registerProtocol(aProtocol); + } + + return aProtocol; +} + +@end diff --git a/RNNotifications/RNNotificationsTests/RNNotificationEventHandlerTests.m b/RNNotifications/RNNotificationsTests/RNNotificationEventHandlerTests.m new file mode 100644 index 0000000000000000000000000000000000000000..8fcc7e774b56de8fbd343405907d148935ffe563 --- /dev/null +++ b/RNNotifications/RNNotificationsTests/RNNotificationEventHandlerTests.m @@ -0,0 +1,52 @@ +#import +#import +#import "RNNotificationEventHandler.h" +#import "RNNotificationUtils.h" + +@interface RNNotificationEventHandlerTests : XCTestCase +@property (nonatomic, retain) RNNotificationEventHandler* uut; +@property (nonatomic, retain) RNNotificationsStore* store; +@property (nonatomic, retain) id mockedNotificationCenter; +@end + +@implementation RNNotificationEventHandlerTests + +- (void)setUp { + _store = [RNNotificationsStore sharedInstance]; + _uut = [[RNNotificationEventHandler alloc] initWithStore:_store]; + + _mockedNotificationCenter = [OCMockObject partialMockForObject:[NSNotificationCenter new]]; + [[[[[OCMockObject niceMockForClass:NSNotificationCenter.class] stub] classMethod] andReturn:_mockedNotificationCenter] defaultCenter]; +} + +- (void)testDidRegisterForRemoteNotifications_ShouldEmitEventWithDeviceTokenDataString { + NSData* deviceToken = [@"740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad" dataUsingEncoding:NSUTF32StringEncoding]; + [[_mockedNotificationCenter expect] postNotificationName:RNRegistered object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id obj) { + return ([[obj objectForKey:@"deviceToken"] isEqualToString:[RNNotificationUtils deviceTokenToString:deviceToken]]); + }]]; + [_uut didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + [_mockedNotificationCenter verify]; +} + +- (void)testDidRegisterForRemoteNotifications_ShouldEmitEventWithDeviceTokenString { + NSString* deviceToken = @"740f4707 bebcf74f 9b7c25d4 8e335894 5f6aa01d a5ddb387 462c7eaf 61bb78ad"; + [[_mockedNotificationCenter expect] postNotificationName:RNRegistered object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id obj) { + return ([[obj objectForKey:@"deviceToken"] isEqualToString:deviceToken]); + }]]; + [_uut didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + [_mockedNotificationCenter verify]; +} + +- (void)testDidFailToRegisterForRemoteNotifications_ShouldEmitEvent { + NSError* error = [NSError errorWithDomain:@"domain" code:1 userInfo:nil]; + [[_mockedNotificationCenter expect] postNotificationName:RNRegistrationFailed object:[OCMArg any] userInfo:[OCMArg checkWithBlock:^BOOL(id obj) { + return ([[obj valueForKey:@"code"] isEqualToNumber:@(1)] && + [[obj valueForKey:@"domain"] isEqualToString:@"domain"]); + }]]; + + [_uut didFailToRegisterForRemoteNotificationsWithError:error]; + [_mockedNotificationCenter verify]; +} + + +@end diff --git a/RNNotifications/RNNotificationsTests/RNNotificationsStoreTests.m b/RNNotifications/RNNotificationsTests/RNNotificationsStoreTests.m new file mode 100644 index 0000000000000000000000000000000000000000..a3ea4bb413e3c77460459491ab258a2578ae0788 --- /dev/null +++ b/RNNotifications/RNNotificationsTests/RNNotificationsStoreTests.m @@ -0,0 +1,69 @@ +#import +#import +#import "RNNotificationsStore.h" + +@interface RNNotificationsStoreTests : XCTestCase +@property (nonatomic, retain) RNNotificationsStore* store; +@end + +@implementation RNNotificationsStoreTests + +- (void)setUp { + _store = [RNNotificationsStore sharedInstance]; +} + +- (void)testSetActionCompletionHandler_ShouldStoreBlock { + void (^testBlock)(void) = ^void() {}; + [_store setActionCompletionHandler:testBlock withCompletionKey:@"actionTestBlock"]; + XCTAssertEqual(testBlock, [_store getActionCompletionHandler:@"actionTestBlock"]); +} + +- (void)testCompleteAction_ShouldInvokeBlock { + __block BOOL blockInvoked = NO; + void (^testBlock)(void) = ^void() { + blockInvoked = YES; + }; + [_store setActionCompletionHandler:testBlock withCompletionKey:@"actionTestBlock"]; + [_store completeAction:@"actionTestBlock"]; + XCTAssertTrue(blockInvoked); +} + +- (void)testCompleteAction_ShouldRemoveBlock { + __block BOOL blockInvoked = NO; + void (^testBlock)(void) = ^void() { + blockInvoked = YES; + }; + [_store setActionCompletionHandler:testBlock withCompletionKey:@"actionTestBlock"]; + [_store completeAction:@"actionTestBlock"]; + XCTAssertNil([_store getActionCompletionHandler:@"actionTestBlock"]); +} + + +- (void)testSetPersentationCompletionHandler_ShouldStoreBlock { + void (^testBlock)(UNNotificationPresentationOptions) = ^void(UNNotificationPresentationOptions options) {}; + [_store setPresentationCompletionHandler:testBlock withCompletionKey:@"presentationTestBlock"]; + XCTAssertEqual(testBlock, [_store getPresentationCompletionHandler:@"presentationTestBlock"]); +} + +- (void)testCompletePresentation_ShouldInvokeBlockWithParams { + __block UNNotificationPresentationOptions presentationOptions; + void (^testBlock)(UNNotificationPresentationOptions) = ^void(UNNotificationPresentationOptions options) { + presentationOptions = options; + }; + [_store setPresentationCompletionHandler:testBlock withCompletionKey:@"presentationTestBlock"]; + [_store completePresentation:@"presentationTestBlock" withPresentationOptions:UNNotificationPresentationOptionAlert]; + XCTAssertEqual(presentationOptions, UNNotificationPresentationOptionAlert); +} + +- (void)testCompletePresentation_ShouldRemoveBlock { + __block UNNotificationPresentationOptions presentationOptions; + void (^testBlock)(UNNotificationPresentationOptions) = ^void(UNNotificationPresentationOptions options) { + presentationOptions = options; + }; + [_store setPresentationCompletionHandler:testBlock withCompletionKey:@"presentationTestBlock"]; + [_store completePresentation:@"presentationTestBlock" withPresentationOptions:UNNotificationPresentationOptionAlert]; + XCTAssertNil([_store getPresentationCompletionHandler:@"presentationTestBlock"]); +} + + +@end diff --git a/RNNotifications/libOCMock.a b/RNNotifications/libOCMock.a new file mode 100644 index 0000000000000000000000000000000000000000..a826ec357f83489ee51654bae23f651968d064dc Binary files /dev/null and b/RNNotifications/libOCMock.a differ diff --git a/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp.xcscheme b/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp.xcscheme index 4a34a70a6a1fa94edb6d36dfe2bb95c2e9dada4d..871fd852f03bd0290822b44411485cc5b87e70d6 100644 --- a/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp.xcscheme +++ b/example/ios/NotificationsExampleApp.xcodeproj/xcshareddata/xcschemes/NotificationsExampleApp.xcscheme @@ -34,20 +34,6 @@ ReferencedContainer = "container:../../node_modules/react-native/React/React.xcodeproj"> - - - - + codeCoverageEnabled = "YES" + onlyGenerateCoverageForSpecifiedTargets = "YES" + shouldUseLaunchSchemeArgsEnv = "NO"> + + + + + + + + + + + + + +