Skip to content

Commit d1d58bd

Browse files
Add startWithToken API by token only
1 parent 80fbd4b commit d1d58bd

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

index.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,17 @@ import { NativeModules, NativeAppEventEmitter, Platform } from 'react-native';
99
let {Instabug} = NativeModules;
1010

1111
module.exports = {
12-
/**
12+
/**
1313
* Starts the SDK.
1414
* This is the main SDK method that does all the magic. This is the only
1515
* method that SHOULD be called.
1616
* Should be called in constructor of the app registery component
17-
* @param {string} androidToken The token that identifies the app, you can find
17+
* @param {string} Token The token that identifies the app, you can find
1818
* it on your dashboard.
19-
* @param {string} iosToken The token that identifies the app, you can find
20-
* it on your dashboard.
21-
* @param {constants.invocationEvent} invocationEvent The event that invokes
22-
* the SDK's UI.
2319
*/
24-
startWithToken: function(androidToken,iosToken, invocationEvent) {
20+
startWithToken: function(token) {
2521
if( Platform.OS === 'ios') {
26-
Instabug.startWithToken(iosToken, invocationEvent);
22+
Instabug.startWithToken(iosToken, Instabug.constants.invocationEvent.floatingButton);
2723

2824
} else {
2925

@@ -33,7 +29,7 @@ module.exports = {
3329

3430

3531
},
36-
/**
32+
/**
3733
* Starts the SDK.
3834
* This is the main SDK method that does all the magic. This is the only
3935
* method that SHOULD be called.
@@ -53,6 +49,30 @@ module.exports = {
5349
}
5450

5551

52+
},
53+
/**
54+
* Starts the SDK.
55+
* This is the main SDK method that does all the magic. This is the only
56+
* method that SHOULD be called.
57+
* Should be called in constructor of the app registery component
58+
* @param {string} androidToken The token that identifies the app, you can find
59+
* it on your dashboard.
60+
* @param {string} iosToken The token that identifies the app, you can find
61+
* it on your dashboard.
62+
* @param {constants.invocationEvent} invocationEvent The event that invokes
63+
* the SDK's UI.
64+
*/
65+
startWithToken: function(androidToken,iosToken, invocationEvent) {
66+
if( Platform.OS === 'ios') {
67+
Instabug.startWithToken(iosToken, invocationEvent);
68+
69+
} else {
70+
71+
Instabug.startInstabugWithTokenForAndroid(androidToken);
72+
73+
}
74+
75+
5676
},
5777

5878
/**

0 commit comments

Comments
 (0)