From f0d628cf670adf0fa46dbb014db659d93d4d92c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bj=C3=B8rnskov?= <19725+henrikbjorn@users.noreply.github.com> Date: Fri, 14 Dec 2018 11:30:38 +0100 Subject: [PATCH] Invalidate calls in CXCallProvider. This will make sure that CallKit isn't being confused when the app is reloaded when developing. Otherwise it would get confused and reject any transaction after the reload. --- ios/RNCallKit/RNCallKit.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/RNCallKit/RNCallKit.m b/ios/RNCallKit/RNCallKit.m index fc3439f..b55e6c4 100644 --- a/ios/RNCallKit/RNCallKit.m +++ b/ios/RNCallKit/RNCallKit.m @@ -56,6 +56,10 @@ - (void)dealloc NSLog(@"[RNCallKit][dealloc]"); #endif [[NSNotificationCenter defaultCenter] removeObserver:self]; + + if (self.callKitProvider != nil) { + [self.callKitProvider invalidate]; + } } // Override method of RCTEventEmitter