Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #77 from bmourat/master
Browse files Browse the repository at this point in the history
Minor code style changes
  • Loading branch information
Benjamin Scholtysik (Reimold) committed May 4, 2017
2 parents 1cdaa7b + 99614d7 commit c8a0d1d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Immediately crashes the app. This is used strictly for testing the HockeyApp cra
### hockeyapp.start

```javascript
hockeyapp.start(successCallback: function, errorCallback: function, appId: string, autoSend?: boolean, ignoreDefaultHandler?: boolean, loginMode?: hockeyapp.loginMode, appSecret?: string): void
hockeyapp.start(successCallback: function, errorCallback: function, appId: string, autoSend?: boolean, ignoreDefaultHandler?: boolean, createNewFeedbackThread?: boolean, loginMode?: hockeyapp.loginMode, appSecret?: string): void
```

Initializes the HockeyApp plugin, and configures it with the appropriate app ID and user settings (e.g. should crash reports be automatically submitted).
Expand All @@ -216,7 +216,9 @@ Initializes the HockeyApp plugin, and configures it with the appropriate app ID

5. **ignoreDefaultHandler** - Specifies whether you would like to display the standard dialog when the app is about to crash. This parameter is only relevant on Android, and therefore, you can set it to anything on iOS. Defaults to `false`.

6. **loginMode** - The mechanism to use in order to authenticate users. Defaults to `hockeyapp.loginMode.ANONYMOUS`. The `hockeyapp.loginMode` enum provides the following available options:
6. **createNewFeedbackThread** - Indicates if a new thread should be created for each new feedback message. Setting it to `true` will force a new thread whenever a new message is sent as opposed to the default resume thread behaviour.

7. **loginMode** - The mechanism to use in order to authenticate users. Defaults to `hockeyapp.loginMode.ANONYMOUS`. The `hockeyapp.loginMode` enum provides the following available options:

- `ANONYMOUS` - The end user isn't authenticated at all.

Expand All @@ -228,9 +230,7 @@ Initializes the HockeyApp plugin, and configures it with the appropriate app ID

*NOTE: Only the `ANONYMOUS` login mode is supported on iOS, and therefore, you can only use the other modes within Android apps.*

7. **appSecret** - The app secret as provided by the HockeyApp portal. This parameter only needs to be set if you're setting the `loginMode` parameter to `EMAIL_ONLY`.

8. **shouldCreateNewFeedbackThread** - Indicates if a new thread should be created for each new feedback message. Setting it to `true` will force a new thread whenever a new message is sent as opposed to the default resume thread behaviour.
8. **appSecret** - The app secret as provided by the HockeyApp portal. This parameter only needs to be set if you're setting the `loginMode` parameter to `EMAIL_ONLY`.

### hockeyapp.trackEvent

Expand Down
1 change: 0 additions & 1 deletion src/ios/HockeyApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ - (void)setUserName:(CDVInvokedUrlCommand*)command {
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK] callbackId:command.callbackId];
}


- (void) feedback:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* pluginResult = nil;
Expand Down
11 changes: 5 additions & 6 deletions www/hockeyapp.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
var exec = require('cordova/exec');

var hockeyapp = {
start: function(success, failure, appId, autoSend, ignoreDefaultHandler, loginMode, appSecret, shouldCreateNewFeedbackThread) {
start: function(success, failure, appId, autoSend, ignoreDefaultHandler, createNewFeedbackThread, loginMode, appSecret) {
autoSend = (autoSend === true || autoSend === "true");
ignoreDefaultHandler = (ignoreDefaultHandler === true || ignoreDefaultHandler === "true");
loginMode = loginMode || hockeyapp.loginMode.ANONYMOUS;
appSecret = appSecret || '';
shouldCreateNewFeedbackThread= (shouldCreateNewFeedbackThread === true || shouldCreateNewFeedbackThread === "true");

createNewFeedbackThread = (createNewFeedbackThread === true || createNewFeedbackThread === "true");

// Requesting loginMode.EMAIL_ONLY without an appSecret is not permitted
if (loginMode === hockeyapp.loginMode.EMAIL_ONLY && appSecret.trim() === '') {
Expand All @@ -17,13 +16,13 @@ var hockeyapp = {
return;
}

exec(success, failure, "HockeyApp", "start", [appId, loginMode, appSecret, autoSend, ignoreDefaultHandler, shouldCreateNewFeedbackThread]);
exec(success, failure, "HockeyApp", "start", [appId, loginMode, appSecret, autoSend, ignoreDefaultHandler, createNewFeedbackThread]);
},
setUserEmail: function (success, failure, userEmail) {
exec(success, failure, "HockeyApp", "setUserEmail", [ userEmail ]);
exec(success, failure, "HockeyApp", "setUserEmail", [userEmail]);
},
setUserName: function (success, failure, userName) {
exec(success, failure, "HockeyApp", "setUserName", [ userName ]);
exec(success, failure, "HockeyApp", "setUserName", [userName]);
},
feedback: function (success, failure) {
exec(success, failure, "HockeyApp", "feedback", []);
Expand Down

0 comments on commit c8a0d1d

Please sign in to comment.