diff --git a/android/src/main/java/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterModule.java b/android/src/main/java/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterModule.java index 16ec700..4c4246d 100644 --- a/android/src/main/java/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterModule.java +++ b/android/src/main/java/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterModule.java @@ -139,10 +139,8 @@ public void stop() { } @ReactMethod - public void restore(Promise promise) { + public void restore() { airshipAdapter().restore(); - - promise.resolve(airshipAdapter().isStarted()); } @ReactMethod diff --git a/android/src/oldarch/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterSpec.java b/android/src/oldarch/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterSpec.java index 43e80e6..efd163c 100644 --- a/android/src/oldarch/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterSpec.java +++ b/android/src/oldarch/com/rtngimbalairshipadapter/RtnGimbalAirshipAdapterSpec.java @@ -26,7 +26,7 @@ abstract class RtnGimbalAirshipAdapterSpec extends ReactContextBaseJavaModule { public abstract void stop(); - public abstract void restore(Promise promise); + public abstract void restore(); public abstract void getGdprConsentRequirement(Promise promise); diff --git a/ios/GimbalService.h b/ios/GimbalService.h index eb1b7c0..d317311 100644 --- a/ios/GimbalService.h +++ b/ios/GimbalService.h @@ -72,7 +72,7 @@ * * @return Boolean indicating whether or not the Adapter was started. */ -- (BOOL)restore; +- (void)restore; /** * Stops the service. diff --git a/ios/GimbalService.m b/ios/GimbalService.m index 3e18464..35e2a11 100644 --- a/ios/GimbalService.m +++ b/ios/GimbalService.m @@ -105,7 +105,6 @@ - (void)stop { - (BOOL)restore { [AirshipAdapter.shared restore]; - return [AirshipAdapter.shared isStarted]; } -(void)setAnalyticsId:(NSString *)id { diff --git a/ios/RtnGimbalAirshipAdapter.mm b/ios/RtnGimbalAirshipAdapter.mm index b2e409b..e159761 100644 --- a/ios/RtnGimbalAirshipAdapter.mm +++ b/ios/RtnGimbalAirshipAdapter.mm @@ -65,8 +65,7 @@ + (BOOL)requiresMainQueueSetup { } RCT_EXPORT_METHOD(restore) { - [[GimbalService shared] restore]; - resolve(@([[GimbalService shared] isStarted])); + [[GimbalService shared] stop]; } RCT_REMAP_METHOD(isStarted, diff --git a/src/GimbalAirshipAdapter.ts b/src/GimbalAirshipAdapter.ts index cd03f9b..b04b765 100644 --- a/src/GimbalAirshipAdapter.ts +++ b/src/GimbalAirshipAdapter.ts @@ -31,9 +31,8 @@ export interface Spec { /** * Stops the Gimbal Adapter. - * @return A promise with a boolean result indicating whether the adapter successfully started. */ - restore(): Promise; + restore(): void; /** * Checks if the adapter is started. diff --git a/src/NativeGimbalAirshipAdapterModule.ts b/src/NativeGimbalAirshipAdapterModule.ts index 410843a..c09de97 100644 --- a/src/NativeGimbalAirshipAdapterModule.ts +++ b/src/NativeGimbalAirshipAdapterModule.ts @@ -8,7 +8,7 @@ export interface Spec extends TurboModule { setGimbalApiKey(gimbalApiKey: string): void; start(gimbalApiKey: string): Promise; stop(): void; - restore(): Promise; + restore(): void; isStarted(): Promise; getGdprConsentRequirement(): Promise; setUserConsent(consentType: Int32, state: Int32): void; diff --git a/src/index.tsx b/src/index.tsx index f6ece74..ffcb7c1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -166,8 +166,8 @@ export const GimbalAirshipAdapter: GimbalAirshipAdapterSpec = { GimbalAirshipAdapterModule.stop(); }, - restore(): Promise { - return GimbalAirshipAdapterModule.restore(); + restore() { + GimbalAirshipAdapterModule.restore(); }, /**