Skip to content

Commit cdaaa35

Browse files
authored
Merge pull request #22 from bugfender/feature/update-ios-native-version
Update iOS dependency and react-native library version
2 parents 8bee9b4 + 4ed04b2 commit cdaaa35

3 files changed

Lines changed: 118 additions & 76 deletions

File tree

RNBugfender.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Pod::Spec.new do |s|
1111
s.author = package['author']
1212
s.homepage = package['homepage']
1313

14-
s.platform = :ios, "9.0"
14+
s.platform = :ios, "10.0"
1515
s.requires_arc = true
1616
s.static_framework = true
1717

1818
s.source = { :git => "https://github.com/bugfender/BugfenderSDK-iOS", :tag => "master" }
1919
s.source_files = 'ios/*.{h,m}'
2020

2121
s.dependency 'React'
22-
s.dependency 'BugfenderSDK', '~> 1.9'
22+
s.dependency 'BugfenderSDK', '~> 1.10.3'
2323

2424
end

example/App.js

Lines changed: 115 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,140 @@
1-
import React, { Component } from 'react';
1+
import React, {Component} from 'react';
22
import {
33
AppRegistry,
44
StyleSheet,
55
Text,
66
View,
7-
Button
7+
Button,
88
} from 'react-native';
99
import Bugfender from '@bugfender/rn-bugfender';
1010

1111
export default class AppComponent extends Component {
1212
constructor(props) {
1313
super(props);
14-
Bugfender.init ("YOUR_BUGFENDER_APP_KEY_HERE");
14+
15+
// Add a "bugfenderKey.json" containing { "bugfenderKey : "YOUR_APP_KEY" }
16+
// Or delete this line and hardcode your key in Bugfender.init("YOUR_APP_KEY")
17+
var key = require('./bugfenderKey.json').bugfenderKey;
18+
19+
// Optional method. Use it to override the device name and avoid sending personal data like "iPhone of John Doe"
20+
Bugfender.overrideDeviceName('Anonymous Phone');
21+
22+
// Optional method. Use it only if you have a custom instance of Bugfender
23+
// Bugfender.setBaseUrl("https://bugfender.custom-company.com")
24+
25+
Bugfender.init(key);
26+
1527
Bugfender.enableCrashReporting();
1628
}
1729

1830
render() {
1931
return (
20-
<View style={styles.container}>
21-
<Text style={styles.welcome}>
22-
Welcome to RN Bugfender Example!
23-
</Text>
24-
<Text style={styles.instructions}>
25-
This application sends directly logs to the server if you push "Send Logs" button
26-
</Text>
27-
<Text style={styles.instructions}>
28-
Pressing "Generate JS Crash" the application will crash due to a JavaScript error and the crash information will be sent to the server.
29-
</Text>
30-
<Text style={styles.instructions}>
31-
Double tap R on your keyboard to reload,{'\n'}
32-
Shake or press menu button for dev menu
33-
</Text>
34-
<View style={styles.button}>
35-
<Button
36-
onPress={this._onPressButton}
37-
title="Send logs"
38-
/>
39-
</View>
40-
<View style={styles.button}>
41-
<Button
42-
onPress={this._generateError}
43-
title="Generate JS crash"
44-
/>
45-
</View>
46-
</View>
32+
<View style={styles.container}>
33+
<Text style={styles.welcome}>
34+
Welcome to RN Bugfender Example!
35+
</Text>
36+
<Text style={styles.instructions}>
37+
This application sends directly logs to the server if you push "Send Logs" button.
38+
</Text>
39+
<Text style={styles.instructions}>
40+
Pressing "Generate JS Crash" the application will crash due to a JavaScript error and the crash information
41+
will be sent to the server. This won't work on debug builds as LogBox will capture the error.
42+
</Text>
43+
<Text style={styles.instructions}>
44+
Pressing "Show Native User Feedback" a native screen for sending feedback will be shown.
45+
</Text>
46+
<Text style={styles.instructions}>
47+
Double tap R on your keyboard to reload,{'\n'}
48+
Shake or press menu button for dev menu
49+
</Text>
50+
<View style={styles.button}>
51+
<Button
52+
onPress={this._onPressButton}
53+
title="Send logs"
54+
/>
55+
</View>
56+
<View style={styles.button}>
57+
<Button
58+
onPress={this._generateError}
59+
title="Generate JS crash"
60+
/>
61+
</View>
62+
<View style={styles.button}>
63+
<Button
64+
onPress={this._onPressShowUserFeedback}
65+
title="Show Native User Feedback"
66+
/>
67+
</View>
68+
</View>
4769
);
4870
}
4971

5072
_generateError = () => {
51-
var test;
52-
test.color; //This will generate a TypeError: undefined that will be sent to Bugfender
53-
}
73+
// Force crash
74+
var date = new Date(); //Current Date
75+
var hours = date.getHours(); //Current Hours
76+
var min = date.getMinutes(); //Current Minutes
77+
var sec = date.getSeconds(); //Current Seconds
78+
throw new Error('Force crash' + 'Time: ' + hours + ':' + min + ':' + sec);
79+
};
5480

5581
_onPressButton() {
56-
Bugfender.d("REACT", "Im being called from React!");
57-
58-
Bugfender.d ("Bugfender", "Log without break lines in the middle of the message");
59-
Bugfender.d ("Bugfender", "Log with break lines \n\n in the middle of the message");
60-
Bugfender.d (null, "Log with tag as null");
61-
Bugfender.d ("Bugfender", "Normal log");
62-
Bugfender.d ("Bugfender", null);
63-
Bugfender.d (null, null);
64-
65-
Bugfender.e ("Bugfender", "Log with break lines \n\n in the middle of the message");
66-
Bugfender.e (null, "Log with tag as null");
67-
Bugfender.e ("Bugfender", "Normal log");
68-
Bugfender.e ("Bugfender", null);
69-
Bugfender.e (null, null);
70-
71-
Bugfender.w ("Bugfender", "Log with break lines \n\n in the middle of the message");
72-
Bugfender.w (null, "Log with tag as null");
73-
Bugfender.w ("Bugfender", "Normal log");
74-
Bugfender.w ("Bugfender", null);
75-
Bugfender.w (null, null);
76-
77-
Bugfender.log (1001, "method", "file", Bugfender.LogLevel.DEBUG, "tag", "Sending low level log.");
78-
Bugfender.log (1001, "method", "file", Bugfender.LogLevel.ERROR, "tag", "Sending low level log.");
79-
Bugfender.log (1001, "method", "file", Bugfender.LogLevel.WARNING, "tag", "Sending low level log.");
80-
81-
Bugfender.setDeviceString ("device.key.string", "fake.string.value");
82-
Bugfender.setDeviceBoolean ("device.key.boolean", true);
83-
Bugfender.setDeviceFloat ("device.key.float", 101);
84-
Bugfender.setDeviceInteger ("device.key.integer", 102);
85-
86-
Bugfender.sendIssue ("Issue One", "Issue Message One").then(url => console.log(url));
87-
Bugfender.sendIssue ("Issue Two", "Issue Message Two").then(url => console.log(url));
88-
Bugfender.sendIssue ("Issue Three", "Issue Message Three").then(url => console.log(url));
89-
90-
Bugfender.sendUserFeedback ("User feedback", "User feedback message");
91-
92-
Bugfender.getDeviceUrl ().then(url => console.log(url));
93-
94-
Bugfender.getSessionUrl ().then(url => console.log(url));
82+
Bugfender.d('REACT', 'Im being called from React!');
83+
84+
Bugfender.d('Bugfender', 'Log without break lines in the middle of the message');
85+
Bugfender.d('Bugfender', 'Log with break lines \n\n in the middle of the message');
86+
Bugfender.d(null, 'Log with tag as null');
87+
Bugfender.d('Bugfender', 'Normal log');
88+
Bugfender.d('Bugfender', null);
89+
Bugfender.d(null, null);
90+
91+
Bugfender.e('Bugfender', 'Log with break lines \n\n in the middle of the message');
92+
Bugfender.e(null, 'Log with tag as null');
93+
Bugfender.e('Bugfender', 'Normal log');
94+
Bugfender.e('Bugfender', null);
95+
Bugfender.e(null, null);
96+
97+
Bugfender.w('Bugfender', 'Log with break lines \n\n in the middle of the message');
98+
Bugfender.w(null, 'Log with tag as null');
99+
Bugfender.w('Bugfender', 'Normal log');
100+
Bugfender.w('Bugfender', null);
101+
Bugfender.w(null, null);
102+
103+
Bugfender.log(1001, 'method', 'file', Bugfender.LogLevel.DEBUG, 'tag', 'Sending low level log.');
104+
Bugfender.log(1001, 'method', 'file', Bugfender.LogLevel.ERROR, 'tag', 'Sending low level log.');
105+
Bugfender.log(1001, 'method', 'file', Bugfender.LogLevel.WARNING, 'tag', 'Sending low level log.');
95106

107+
Bugfender.setDeviceString('device.key.string', 'fake.string.value');
108+
Bugfender.setDeviceBoolean('device.key.boolean', true);
109+
Bugfender.setDeviceFloat('device.key.float', 101);
110+
Bugfender.setDeviceInteger('device.key.integer', 102);
111+
112+
Bugfender.sendIssue('Issue One', 'Issue Message One').then(url => console.log(url));
113+
Bugfender.sendIssue('Issue Two', 'Issue Message Two').then(url => console.log(url));
114+
Bugfender.sendIssue('Issue Three', 'Issue Message Three').then(url => console.log(url));
115+
116+
Bugfender.sendCrash('Crash title', 'Crash text').then(url => console.log(url));
117+
118+
Bugfender.sendUserFeedback('User feedback', 'User feedback message').then(url => console.log(url));
119+
120+
Bugfender.getDeviceUrl().then(url => console.log(url));
121+
122+
Bugfender.getSessionUrl().then(url => console.log(url));
123+
}
124+
125+
_onPressShowUserFeedback() {
126+
Bugfender.showUserFeedback(
127+
'Feedback',
128+
'Please send us your feedback',
129+
'This is the reason',
130+
'This is the full message',
131+
'Send',
132+
'Cancel',
133+
).then(url => {
134+
console.log('RN: feedback sent with url:', url);
135+
}).catch(error => {
136+
console.log('RN: feedback not sent');
137+
});
96138
}
97139
}
98140

@@ -115,7 +157,7 @@ const styles = StyleSheet.create({
115157
},
116158
button: {
117159
marginBottom: 5,
118-
}
160+
},
119161
});
120162

121163
AppRegistry.registerComponent('App', () => AppComponent);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bugfender/rn-bugfender",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "React Native bindings for Bugfender SDK",
55
"main": "bugfender.js",
66
"directories": {

0 commit comments

Comments
 (0)