Skip to content

Commit dec648e

Browse files
committed
Added a dummy promise that returns true for android API initialization
This makes it match the iOS signature and fulfills what typescript says will be there. This does not actually handle any errors so that should probably be added at some point in the future.
1 parent 82a6637 commit dec648e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public String getName() {
6969
}
7070

7171
@ReactMethod
72-
public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version) {
72+
public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) {
7373
IterableLogger.d(TAG, "initializeWithApiKey: " + apiKey);
7474
IterableConfig.Builder configBuilder = Serialization.getConfigFromReadableMap(configReadableMap);
7575

@@ -91,6 +91,9 @@ public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, S
9191

9292
IterableApi.initialize(reactContext, apiKey, configBuilder.build());
9393
IterableApi.getInstance().setDeviceAttribute("reactNativeSDKVersion", version);
94+
// TODO: Figure out what the error cases are and handle them appropriately
95+
// This is just here to match the TS types and let the JS thread know when we are done initializing
96+
promise.resolve(true);
9497
}
9598

9699
@ReactMethod

0 commit comments

Comments
 (0)