Skip to content

Commit 65fbe16

Browse files
committed
(iOS) New method allows to override device name to hide the phone owner name
1 parent 525705e commit 65fbe16

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

bugfender.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,24 @@ export default {
2424

2525
/**
2626
* Sets the URL of the API
27-
*
27+
*
2828
* Usage of this function is not necessary in the general use case. Please use exclusively when
2929
* directed from technical support. This method must be called before Bugfender.init().
3030
* @param {string} url - base URL of the Bugfender's dashboard
3131
*/
3232
setApiUrl: apiUrl => Bugfender.setApiUrl(apiUrl),
3333

34+
/**
35+
* Sets the name for the device. If the Device Name is not set, then the platform standard device name will be automatically sent
36+
*
37+
* @note This method has to be called prior to activate logger. Otherwise, an exception will be thrown
38+
* @param {string} deviceName - Device name that will be send to Bugfender.
39+
*/
40+
overrideDeviceName: value => Bugfender.overrideDeviceName(value),
41+
3442
/**
3543
* Synchronizes all logs and issues with the server all the time, regardless if this device is enabled or not.
36-
*
44+
*
3745
* Logs and issues are synchronized continuously while forceEnabled is active.
3846
*
3947
* @param {boolean} enabled - Whether logs and issues should be sent regardless of the Bugfender Console settings.
@@ -42,7 +50,7 @@ export default {
4250

4351
/**
4452
* Set the maximum size to store local log files.
45-
*
53+
*
4654
* By default, the limit is 5 MB.
4755
*
4856
* @param {number} sizeInBytes Maximum size in bytes. Range accepted is from 1 byte to 50 MB. If the value provided is outside this range, it will be set to 50 MB.
@@ -65,7 +73,7 @@ export default {
6573
* Enable crash reporting tool functionality
6674
*/
6775
enableCrashReporting: () => Bugfender.enableCrashReporting(),
68-
76+
6977
/**
7078
* Logs all actions performed and screen changes in the application, such as button touches, etc...
7179
*/
@@ -150,7 +158,7 @@ export default {
150158

151159
/**
152160
* Send a crash. Useful for controlled Exceptions
153-
*
161+
*
154162
* @param {string} title - Title for the crash.
155163
* @param {string} text - Additional info for the crash, p.e. the Stack trace. Markdown format is accepted
156164
* @return A Promise with the URL pointing to the crash information on the Bugfender dashboard or null if SDK is not initialized.
@@ -159,7 +167,7 @@ export default {
159167

160168
/**
161169
* Sends user feedback
162-
*
170+
*
163171
* @param {string} title - Title for the feedback.
164172
* @param {string} message - Feedback message. Markdown format is accepted
165173
* @return {Promise<string>} A Promise with the URL pointing to the feedback information on the Bugfender dashboard or null if SDK is not initialized.
@@ -168,7 +176,7 @@ export default {
168176

169177
/**
170178
* Synchronizes all logs and issues with the server once, regardless if this device is enabled or not.
171-
*
179+
*
172180
* Logs and issues are synchronized only once. After that, the logs are again sent according to the enabled flag
173181
* in the Bugfender Console.
174182
*/

ios/RNBugfender.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ @implementation RNBugfender
2222
[Bugfender setForceEnabled:enabled];
2323
}
2424

25+
RCT_EXPORT_METHOD(overrideDeviceName:(NSString *)deviceName)
26+
{
27+
[Bugfender overrideDeviceName:deviceName];
28+
}
29+
2530
RCT_EXPORT_METHOD(setMaximumLocalStorageSize:(int)size)
2631
{
2732
[Bugfender setMaximumLocalStorageSize:size];

0 commit comments

Comments
 (0)