-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathRNBugfenderModule.java
More file actions
79 lines (64 loc) · 1.76 KB
/
RNBugfenderModule.java
File metadata and controls
79 lines (64 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.galmis.rnbugfender;
import com.bugfender.sdk.Bugfender;
import com.facebook.react.*;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
/**
* Created by shailesh on 2017-04-06.
*/
public class RNBugfenderModule extends ReactContextBaseJavaModule{
public String TAG = "RNBugfenderModule";
public RNBugfenderModule(ReactApplicationContext reactContext) {
super(reactContext);
}
@Override
public boolean canOverrideExistingModule() {
return true;
}
@Override
public String getName() {
return "RNBugfender";
}
@ReactMethod
public void activateLogger(String apiKey, boolean debug){
Bugfender.init(getReactApplicationContext(), apiKey, debug);
}
@ReactMethod
public void info(String text){
Bugfender.d(TAG, text);
}
@ReactMethod
public void warning(String text){
Bugfender.w(TAG, text);
}
@ReactMethod
public void error(String text){
Bugfender.e(TAG, text);
}
@ReactMethod
public void sendIssueWithTitle(String title, String text){
Bugfender.sendIssue(title, text);
}
@ReactMethod
public void enableUIEventLogging(){
Bugfender.enableUIEventLogging(getCurrentActivity().getApplication());
}
@ReactMethod
public void setMaximumLocalStorageSize(Integer sizeInMB){
Bugfender.setMaximumLocalStorageSize(sizeInMB);
}
@ReactMethod
public void forceSendOnce(){
Bugfender.forceSendOnce();
}
@ReactMethod
public void setForceEnabled(boolean value){
Bugfender.setForceEnabled(value);
}
@ReactMethod
public void deviceIdentifier(Promise promise) {
promise.resolve(Bugfender.getDeviceIdentifier());
}
}