Skip to content

Commit

Permalink
feat: revert feedback related things
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray committed Sep 27, 2023
1 parent 9af3320 commit 2116e1b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 41 deletions.
11 changes: 0 additions & 11 deletions sdk-java/src/main/java/ly/count/sdk/java/Countly.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import ly.count.sdk.java.internal.InternalConfig;
import ly.count.sdk.java.internal.Log;
import ly.count.sdk.java.internal.ModuleBackendMode;
import ly.count.sdk.java.internal.ModuleFeedback;
import ly.count.sdk.java.internal.SDKCore;

/**
Expand Down Expand Up @@ -316,16 +315,6 @@ public static void onConsentRemoval(Config.Feature... features) {
}
}

/**
* <code>Feedback</code> interface to use feedback widgets nps,rating and forms.
* And do manual reporting of feedbacks.
*
* @return {@link ModuleFeedback.Feedback} instance.
*/
public ModuleFeedback.Feedback feedback() {
return sdk.feedback();
}

@Override
public Event event(String key) {
L.d("[Countly] event: key = " + key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import ly.count.sdk.java.Countly;
import org.json.JSONObject;

public class ModuleFeedback extends ModuleBase {
Expand Down Expand Up @@ -67,48 +66,48 @@ public void stop(CtxCore ctx, boolean clear) {
feedbackInterface = null;
}

private void getAvailableFeedbackWidgetsInternal(RetrieveFeedbackWidgets callback) {
callback.onFinished(null, "");
private List<CountlyFeedbackWidget> getAvailableFeedbackWidgetsInternal() {
return null;
}

private void reportFeedbackWidgetManuallyInternal(CountlyFeedbackWidget widgetInfo, JSONObject widgetData, Map<String, Object> widgetResult) {

}

private void getFeedbackWidgetDataInternal(CountlyFeedbackWidget widgetInfo, RetrieveFeedbackWidgetData callback) {
callback.onFinished(null, "");
private JSONObject getFeedbackWidgetDataInternal(CountlyFeedbackWidget widgetInfo) {
return null;
}

private void constructFeedbackWidgetUrlInternal(CountlyFeedbackWidget widgetInfo, FeedbackCallback callback) {
callback.onFinished("", "");
private String constructFeedbackWidgetUrlInternal(CountlyFeedbackWidget widgetInfo) {
return null;
}

public class Feedback {

/**
* Get a list of available feedback widgets for this device ID
*
* @param callback
* @return list of available feedback widgets
*/
public void getAvailableFeedbackWidgets(@Nullable RetrieveFeedbackWidgets callback) {
synchronized (Countly.instance()) {
public List<CountlyFeedbackWidget> getAvailableFeedbackWidgets() {
synchronized (internalConfig) {
L.i("[Feedback] Trying to retrieve feedback widget list");

getAvailableFeedbackWidgetsInternal(callback);
return getAvailableFeedbackWidgetsInternal();
}
}

/**
* Construct a URL that can be used to present a feedback widget in a web viewer
*
* @param widgetInfo
* @param callback
* @return feedback widget URL
*/
public void constructFeedbackWidgetUrl(@Nullable CountlyFeedbackWidget widgetInfo, @Nullable FeedbackCallback callback) {
synchronized (Countly.instance()) {
public String constructFeedbackWidgetUrl(@Nullable CountlyFeedbackWidget widgetInfo) {
synchronized (internalConfig) {
L.i("[Feedback] Trying to present feedback widget in an alert dialog");

constructFeedbackWidgetUrlInternal(widgetInfo, callback);
return constructFeedbackWidgetUrlInternal(widgetInfo);
}
}

Expand All @@ -117,13 +116,13 @@ public void constructFeedbackWidgetUrl(@Nullable CountlyFeedbackWidget widgetInf
* When requesting this data, it will count as a shown widget (will increment that "shown" count in the dashboard)
*
* @param widgetInfo
* @param callback
* @return feedback widget data
*/
public void getFeedbackWidgetData(@Nullable CountlyFeedbackWidget widgetInfo, @Nullable RetrieveFeedbackWidgetData callback) {
synchronized (Countly.instance()) {
public JSONObject getFeedbackWidgetData(@Nullable CountlyFeedbackWidget widgetInfo) {
synchronized (internalConfig) {
L.i("[Feedback] Trying to retrieve feedback widget data");

getFeedbackWidgetDataInternal(widgetInfo, callback);
return getFeedbackWidgetDataInternal(widgetInfo);
}
}

Expand All @@ -136,7 +135,7 @@ public void getFeedbackWidgetData(@Nullable CountlyFeedbackWidget widgetInfo, @N
* @param widgetResult
*/
public void reportFeedbackWidgetManually(@Nullable CountlyFeedbackWidget widgetInfo, @Nullable JSONObject widgetData, @Nullable Map<String, Object> widgetResult) {
synchronized (Countly.instance()) {
synchronized (internalConfig) {
L.i("[Feedback] Trying to report feedback widget manually");

reportFeedbackWidgetManuallyInternal(widgetInfo, widgetData, widgetResult);
Expand Down
10 changes: 0 additions & 10 deletions sdk-java/src/main/java/ly/count/sdk/java/internal/SDKCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ public class SDKCore {

protected final Object lockBRQStorage = new Object();

public ModuleFeedback.Feedback feedback() {

if (!hasConsentForFeature(CoreFeature.Feedback)) {
L.v("[SDKCore] feedback: Feedback feature has no consent, returning null");
return null;
}

return module(ModuleFeedback.class).feedbackInterface;
}

public enum Signal {
DID(1),
Crash(2),
Expand Down

0 comments on commit 2116e1b

Please sign in to comment.