Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ of this software and associated documentation files (the "Software"), to deal
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.util.Log;
import com.onesignal.debug.internal.logging.Logging;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.Promise;
Expand Down Expand Up @@ -172,7 +172,7 @@ private void removeObservers() {

private void removeHandlers() {
if(!oneSignalInitDone) {
Log.i("OneSignal", "OneSignal React-Native SDK not initialized yet. Could not remove handlers.");
Logging.debug("OneSignal React-Native SDK not initialized yet. Could not remove handlers.", null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, no need to pass in null as the 2nd parameter to our OneSignal Logging functions, it as optional parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are calling this Kotlin-defined method from Java, we have to pass the 2nd parameter.

return;
}

Expand Down Expand Up @@ -232,7 +232,7 @@ public void initialize(String appId) {
OneSignalWrapper.setSdkVersion("050209");

if (oneSignalInitDone) {
Log.e("OneSignal", "Already initialized the OneSignal React-Native SDK");
Logging.debug("Already initialized the OneSignal React-Native SDK", null);
return;
}

Expand Down Expand Up @@ -384,7 +384,7 @@ public void onWillDisplay(INotificationWillDisplayEvent event) {
}
}
} catch(InterruptedException e){
Log.e("InterruptedException" + e.toString(), null);
Logging.error("InterruptedException: " + e.toString(), null);
}
} catch (JSONException e) {
e.printStackTrace();
Expand All @@ -395,7 +395,7 @@ public void onWillDisplay(INotificationWillDisplayEvent event) {
private void displayNotification(String notificationId){
INotificationWillDisplayEvent event = notificationWillDisplayCache.get(notificationId);
if (event == null) {
Log.e("Could not find onWillDisplayNotification event for notification with id: " + notificationId, null);
Logging.error("Could not find onWillDisplayNotification event for notification with id: " + notificationId, null);
return;
}
event.getNotification().display();
Expand All @@ -405,7 +405,7 @@ private void displayNotification(String notificationId){
private void preventDefault(String notificationId) {
INotificationWillDisplayEvent event = notificationWillDisplayCache.get(notificationId);
if (event == null) {
Log.e("Could not find onWillDisplayNotification event for notification with id: " + notificationId, null);
Logging.error("Could not find onWillDisplayNotification event for notification with id: " + notificationId, null);
return;
}
event.preventDefault();
Expand All @@ -432,7 +432,7 @@ public void removePermissionObserver() {
public void onNotificationPermissionChange(boolean permission) {
try {
sendEvent("OneSignal-permissionChanged", RNUtils.convertHashMapToWritableMap(RNUtils.convertPermissionToMap(permission)));
Log.i("OneSignal", "sending permission change event");
Logging.debug("Sending permission change event", null);
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -546,7 +546,7 @@ public void onPushSubscriptionChange(PushSubscriptionChangedState pushSubscripti
sendEvent("OneSignal-subscriptionChanged",
RNUtils.convertHashMapToWritableMap(
RNUtils.convertPushSubscriptionChangedStateToMap(pushSubscriptionChangedState)));
Log.i("OneSignal", "sending subscription change event");
Logging.debug("Sending subscription change event", null);
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -715,7 +715,7 @@ public void onUserStateChange(UserChangedState state) {
sendEvent("OneSignal-userStateChanged",
RNUtils.convertHashMapToWritableMap(
RNUtils.convertUserChangedStateToMap(state)));
Log.i("OneSignal", "sending user state change event");
Logging.debug("Sending user state change event", null);
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down
Loading