Skip to content

Commit e4e3780

Browse files
Amend logging
1 parent 4fd69e9 commit e4e3780

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ In order to ensure the browser implementation works, it will be necessary to con
286286
```
287287

288288
# History
289+
## 0.0.6
290+
- Improve logging
291+
289292
## 0.0.5
290293
- Change logo to be drawable rather than mipmap for Android
291294
- Remove leaked (and now deleted) client id

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-firebaseui-auth",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "Adds support for Firebase UI authentication.",
55
"repository": {
66
"type": "git",

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-firebaseui-auth" version="0.0.5">
2+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-firebaseui-auth" version="0.0.6">
33
<name>Firebase UI Authentication</name>
44
<description>Adds support for Firebase Authentication to your Cordova/PhoneGap apps.</description>
55
<license>Apache 2.0</license>

src/android/uk/co/reallysmall/cordova/plugin/firebase/ui/auth/FirebaseUIAuthPlugin.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
5757
} else if ("getToken".equals(action)) {
5858
return getToken(callbackContext);
5959
} else {
60+
Log.w(TAG, "Unknown action : " + action);
6061
return false;
6162
}
6263
}
@@ -76,7 +77,7 @@ private boolean initialise(JSONArray args, final CallbackContext callbackContext
7677
anonymous = true;
7778
}
7879
} catch (JSONException ex) {
79-
Log.d(TAG, "initialise: error getting options: " + ex.getMessage());
80+
Log.e(TAG, "initialise: error getting options: " + ex.getMessage());
8081
}
8182

8283
this.callbackContext = callbackContext;
@@ -138,7 +139,6 @@ private void createProviderList() throws JSONException {
138139
providers.add(new AuthUI.IdpConfig.Builder(AuthUI.TWITTER_PROVIDER).build());
139140
}
140141
}
141-
142142
}
143143
}
144144

@@ -200,6 +200,7 @@ private AuthUI.SignInIntentBuilder buildCustomInstance() {
200200
}
201201
instance = instance.setIsSmartLockEnabled(smartLockEnabled, smartLockHints);
202202
} catch (JSONException ex) {
203+
Log.e(TAG, "Error in buildCustomInstance ", ex);
203204
}
204205

205206
return instance;
@@ -248,7 +249,7 @@ public void onComplete(@NonNull Task<Void> task) {
248249
}).addOnFailureListener(new OnFailureListener() {
249250
@Override
250251
public void onFailure(@NonNull Exception e) {
251-
Log.d(TAG, "deleteUser: failure", e);
252+
Log.w(TAG, "deleteUser: failure", e);
252253
raiseErrorEvent("deleteuserfailure", 1, "This operation requires you to have recently authenticated. Please log out and back in and try again.");
253254
}
254255
});
@@ -285,6 +286,7 @@ private void raiseErrorEvent(String event, int code, String message) {
285286
data.put("code", code);
286287
data.put("message", message);
287288
} catch (JSONException e) {
289+
Log.e(TAG, "Error in raiseErrorEvent ", e);
288290
}
289291
raiseEvent(callbackContext, event, data);
290292
}
@@ -303,7 +305,7 @@ private void raiseEventForUser(FirebaseUser user) {
303305
resultData.put("photoUrl", user.getPhotoUrl().toString());
304306
}
305307
} catch (JSONException e) {
306-
Log.d(TAG, e.getMessage());
308+
Log.e(TAG, "Error in raiseEventForUser ", e);
307309
}
308310

309311
raiseEvent(callbackContext, "signinsuccess", resultData);
@@ -342,7 +344,7 @@ private void raiseEvent(CallbackContext callbackContext, String type, Object dat
342344
event.put("data", data);
343345
}
344346
} catch (JSONException e) {
345-
e.printStackTrace();
347+
Log.e(TAG, "Error in raiseEvent ", e);
346348
}
347349

348350
PluginResult result = new PluginResult(PluginResult.Status.OK, event);
@@ -361,6 +363,7 @@ public void onComplete(@NonNull Task<AuthResult> task) {
361363
data.put("code", err.getClass().getSimpleName());
362364
data.put("message", err.getMessage());
363365
} catch (JSONException e) {
366+
Log.e(TAG, "Error in onComplete ", e);
364367
}
365368
raiseEvent(callbackContext, "signinfailure", data);
366369
}

0 commit comments

Comments
 (0)