@Test public void logSdkState() throws JSONException { ShadowMarketingCloudSdk.isReady(true); JSONObject state = new JSONObject("{\"state\":1}"); when(sdk.getSdkState()).thenReturn(state); reactModule.logSdkState(); List<LogItem> logs = ShadowLog.getLogsForTag("MCSDK STATE"); assertEquals(1, logs.size()); }
@ReactMethod public void logSdkState() { handleAction(new Action() { @Override void execute(MarketingCloudSdk sdk) { log("MCSDK STATE", sdk.getSdkState().toString()); } }); }
RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod public void logSdkState() { handleAction(new Action() { @Override void execute(MarketingCloudSdk sdk) { log("MCSDK STATE", sdk.getSdkState().toString()); } }); } }
RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod public void logSdkState() { handleAction(new Action() { @Override void execute(MarketingCloudSdk sdk) { log("MCSDK STATE", sdk.getSdkState().toString()); } }); } RNMarketingCloudSdkModule(ReactApplicationContext reactContext); }
RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod public void logSdkState() { handleAction(new Action() { @Override void execute(MarketingCloudSdk sdk) { log("MCSDK STATE", sdk.getSdkState().toString()); } }); } RNMarketingCloudSdkModule(ReactApplicationContext reactContext); @Override String getName(); @ReactMethod void isPushEnabled(Promise promise); @ReactMethod void enablePush(); @ReactMethod void disablePush(); @ReactMethod void getSystemToken(Promise promise); @ReactMethod void getAttributes(Promise promise); @ReactMethod void setAttribute(final String key, final String value); @ReactMethod void clearAttribute(final String key); @ReactMethod void addTag(final String tag); @ReactMethod void removeTag(final String tag); @ReactMethod void getTags(Promise promise); @ReactMethod void setContactKey(final String contactKey); @ReactMethod void getContactKey(final Promise promise); @ReactMethod void enableVerboseLogging(); @ReactMethod void disableVerboseLogging(); @ReactMethod void logSdkState(); }
RNMarketingCloudSdkModule extends ReactContextBaseJavaModule { @ReactMethod public void logSdkState() { handleAction(new Action() { @Override void execute(MarketingCloudSdk sdk) { log("MCSDK STATE", sdk.getSdkState().toString()); } }); } RNMarketingCloudSdkModule(ReactApplicationContext reactContext); @Override String getName(); @ReactMethod void isPushEnabled(Promise promise); @ReactMethod void enablePush(); @ReactMethod void disablePush(); @ReactMethod void getSystemToken(Promise promise); @ReactMethod void getAttributes(Promise promise); @ReactMethod void setAttribute(final String key, final String value); @ReactMethod void clearAttribute(final String key); @ReactMethod void addTag(final String tag); @ReactMethod void removeTag(final String tag); @ReactMethod void getTags(Promise promise); @ReactMethod void setContactKey(final String contactKey); @ReactMethod void getContactKey(final Promise promise); @ReactMethod void enableVerboseLogging(); @ReactMethod void disableVerboseLogging(); @ReactMethod void logSdkState();  }