@@ -25,7 +25,8 @@ module.exports = {
25
25
* the SDK's UI.
26
26
*/
27
27
startWithToken : function ( token , invocationEvent ) {
28
- Instabug . startWithToken ( token , invocationEvent ) ;
28
+ if ( Platform . OS === 'ios' )
29
+ Instabug . startWithToken ( token , invocationEvent ) ;
29
30
} ,
30
31
31
32
/**
@@ -97,7 +98,8 @@ module.exports = {
97
98
* to being enabled or disabled.
98
99
*/
99
100
setUserStepsEnabled : function ( isUserStepsEnabled ) {
100
- Instabug . setUserStepsEnabled ( isUserStepsEnabled ) ;
101
+ if ( Platform . OS === 'ios' )
102
+ Instabug . setUserStepsEnabled ( isUserStepsEnabled ) ;
101
103
} ,
102
104
103
105
/**
@@ -113,13 +115,15 @@ module.exports = {
113
115
* report.
114
116
*/
115
117
setPreSendingHandler : function ( preSendingHandler ) {
116
- Instabug . addListener ( 'IBGpreSendingHandler' ) ;
117
- NativeAppEventEmitter . addListener (
118
- 'IBGpreSendingHandler' ,
119
- preSendingHandler
120
- ) ;
118
+ if ( Platform . OS === 'ios' ) {
119
+ Instabug . addListener ( 'IBGpreSendingHandler' ) ;
120
+ NativeAppEventEmitter . addListener (
121
+ 'IBGpreSendingHandler' ,
122
+ preSendingHandler
123
+ ) ;
121
124
122
- Instabug . setPreSendingHandler ( preSendingHandler ) ;
125
+ Instabug . setPreSendingHandler ( preSendingHandler ) ;
126
+ }
123
127
} ,
124
128
125
129
/**
@@ -136,13 +140,15 @@ module.exports = {
136
140
* @param {preInvocationHandler } preInvocationHandler - A callback that gets executed before invoking the SDK
137
141
*/
138
142
setPreInvocationHandler : function ( preInvocationHandler ) {
139
- Instabug . addListener ( 'IBGpreInvocationHandler' ) ;
140
- NativeAppEventEmitter . addListener (
141
- 'IBGpreInvocationHandler' ,
142
- preInvocationHandler
143
- ) ;
143
+ if ( Platform . OS === 'ios' ) {
144
+ Instabug . addListener ( 'IBGpreInvocationHandler' ) ;
145
+ NativeAppEventEmitter . addListener (
146
+ 'IBGpreInvocationHandler' ,
147
+ preInvocationHandler
148
+ ) ;
144
149
145
- Instabug . setPreInvocationHandler ( preInvocationHandler ) ;
150
+ Instabug . setPreInvocationHandler ( preInvocationHandler ) ;
151
+ }
146
152
} ,
147
153
148
154
/**
@@ -162,15 +168,17 @@ module.exports = {
162
168
* dismissing the SDK.
163
169
*/
164
170
setPostInvocationHandler : function ( postInvocationHandler ) {
165
- Instabug . addListener ( 'IBGpostInvocationHandler' ) ;
166
- NativeAppEventEmitter . addListener (
167
- 'IBGpostInvocationHandler' ,
168
- function ( payload ) {
169
- postInvocationHandler ( payload [ 'dismissType' ] , payload [ 'reportType' ] ) ;
170
- }
171
- ) ;
172
-
173
- Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
171
+ if ( Platform . OS === 'ios' ) {
172
+ Instabug . addListener ( 'IBGpostInvocationHandler' ) ;
173
+ NativeAppEventEmitter . addListener (
174
+ 'IBGpostInvocationHandler' ,
175
+ function ( payload ) {
176
+ postInvocationHandler ( payload [ 'dismissType' ] , payload [ 'reportType' ] ) ;
177
+ }
178
+ ) ;
179
+
180
+ Instabug . setPostInvocationHandler ( postInvocationHandler ) ;
181
+ }
174
182
} ,
175
183
176
184
/**
@@ -209,7 +217,9 @@ module.exports = {
209
217
* bug reporting, while passing NO will disable it for both.
210
218
*/
211
219
setWillSkipScreenshotAnnotation : function ( willSkipScreenshotAnnotation ) {
212
- Instabug . setWillSkipScreenshotAnnotation ( willSkipScreenshotAnnotation ) ;
220
+ if ( Platform . OS === 'ios' ) {
221
+ Instabug . setWillSkipScreenshotAnnotation ( willSkipScreenshotAnnotation ) ;
222
+ }
213
223
} ,
214
224
215
225
/**
@@ -247,7 +257,8 @@ module.exports = {
247
257
* notifications are enabled or disabled.
248
258
*/
249
259
setPushNotificationsEnabled : function ( isPushNotificationEnabled ) {
250
- Instabug . setPushNotificationsEnabled ( isPushNotificationEnabled ) ;
260
+ if ( Platform . OS === 'ios' )
261
+ Instabug . setPushNotificationsEnabled ( isPushNotificationEnabled ) ;
251
262
} ,
252
263
253
264
/**
@@ -258,7 +269,8 @@ module.exports = {
258
269
* field is required or not.
259
270
*/
260
271
setEmailFieldRequired : function ( isEmailFieldRequired ) {
261
- Instabug . setEmailFieldRequired ( isEmailFieldRequired ) ;
272
+ if ( Platform . OS === 'ios' )
273
+ Instabug . setEmailFieldRequired ( isEmailFieldRequired ) ;
262
274
} ,
263
275
264
276
/**
@@ -268,7 +280,8 @@ module.exports = {
268
280
* field is required or not.
269
281
*/
270
282
setCommentFieldRequired : function ( isCommentFieldRequired ) {
271
- Instabug . setCommentFieldRequired ( isCommentFieldRequired ) ;
283
+ if ( Platform . OS === 'ios' )
284
+ Instabug . setCommentFieldRequired ( isCommentFieldRequired ) ;
272
285
} ,
273
286
274
287
/**
@@ -279,7 +292,8 @@ module.exports = {
279
292
* @param {number } iPadShakingThreshold Threshold for iPad.
280
293
*/
281
294
setShakingThresholdForIPhone : function ( iPhoneShakingThreshold , iPadShakingThreshold ) {
282
- Instabug . setShakingThresholdForIPhone ( iPhoneShakingThreshold , iPadShakingThreshold ) ;
295
+ if ( Platform . OS === 'ios' )
296
+ Instabug . setShakingThresholdForIPhone ( iPhoneShakingThreshold , iPadShakingThreshold ) ;
283
297
} ,
284
298
285
299
/**
@@ -293,7 +307,8 @@ module.exports = {
293
307
* floating button.
294
308
*/
295
309
setFloatingButtonEdge : function ( floatingButtonEdge , offsetFromTop ) {
296
- Instabug . setFloatingButtonEdge ( floatingButtonEdge , offsetFromTop ) ;
310
+ if ( Platform . OS === 'ios' )
311
+ Instabug . setFloatingButtonEdge ( floatingButtonEdge , offsetFromTop ) ;
297
312
} ,
298
313
299
314
/**
@@ -318,7 +333,8 @@ module.exports = {
318
333
* intro message is enabled or not.
319
334
*/
320
335
setIntroMessageEnabled : function ( isIntroMessageEnabled ) {
321
- Instabug . setIntroMessageEnabled ( isIntroMessageEnabled ) ;
336
+ if ( Platform . OS === 'ios' )
337
+ Instabug . setIntroMessageEnabled ( isIntroMessageEnabled ) ;
322
338
} ,
323
339
324
340
/**
@@ -327,7 +343,8 @@ module.exports = {
327
343
* @param colorTheme
328
344
*/
329
345
setColorTheme : function ( colorTheme ) {
330
- Instabug . setColorTheme ( colorTheme ) ;
346
+ if ( Platform . OS === 'ios' )
347
+ Instabug . setColorTheme ( colorTheme ) ;
331
348
} ,
332
349
333
350
/**
@@ -347,7 +364,9 @@ module.exports = {
347
364
* @param {string[] } tags An array of tags to append to current tags.
348
365
*/
349
366
appendTags : function ( tags ) {
350
- Instabug . appendTags ( tags ) ;
367
+ if ( Platform . OS === 'ios' )
368
+ Instabug . appendTags ( tags ) ;
369
+
351
370
} ,
352
371
353
372
/**
@@ -378,7 +397,8 @@ module.exports = {
378
397
* @param {strings } key Key of string to override.
379
398
*/
380
399
setStringToKey : function ( string , key ) {
381
- Instabug . setString ( string , key ) ;
400
+ if ( Platform . OS === 'ios' )
401
+ Instabug . setString ( string , key ) ;
382
402
} ,
383
403
384
404
/**
@@ -419,13 +439,15 @@ module.exports = {
419
439
* executed when a new message is received.
420
440
*/
421
441
setOnNewMessageHandler : function ( onNewMessageHandler ) {
422
- Instabug . addListener ( 'IBGonNewMessageHandler' ) ;
423
- NativeAppEventEmitter . addListener (
424
- 'IBGonNewMessageHandler' ,
425
- onNewMessgaeHandler
426
- ) ;
442
+ if ( Platform . OS === 'ios' ) {
443
+ Instabug . addListener ( 'IBGonNewMessageHandler' ) ;
444
+ NativeAppEventEmitter . addListener (
445
+ 'IBGonNewMessageHandler' ,
446
+ onNewMessgaeHandler
447
+ ) ;
427
448
428
- Instabug . setOnNewMessageHandler ( onNewMessgaeHandler ) ;
449
+ Instabug . setOnNewMessageHandler ( onNewMessgaeHandler ) ;
450
+ }
429
451
} ,
430
452
431
453
/**
@@ -441,7 +463,8 @@ module.exports = {
441
463
* or disabled.
442
464
*/
443
465
setPromptOptions : function ( isBugReportingEnabled , isFeedbackReportingEnabled , isChatEnabled ) {
444
- Instabug . setPromptOptions ( isBugReportingEnabled , isFeedbackReportingEnabled , isChatEnabled ) ;
466
+ if ( Platform . OS === 'ios' )
467
+ Instabug . setPromptOptions ( isBugReportingEnabled , isFeedbackReportingEnabled , isChatEnabled ) ;
445
468
} ,
446
469
447
470
/**
@@ -461,7 +484,8 @@ module.exports = {
461
484
* argument isInstabugNotification
462
485
*/
463
486
isInstabugNotification : function ( dict , isInstabugNotificationCallback ) {
464
- Instabug . isInstabugNotification ( dict , isInstabugNotificationCallback ) ;
487
+ if ( Platform . OS === 'ios' )
488
+ Instabug . isInstabugNotification ( dict , isInstabugNotificationCallback ) ;
465
489
} ,
466
490
467
491
/**
@@ -595,4 +619,4 @@ module.exports = {
595
619
messageNotification : Instabug . messageNotification ,
596
620
messagesNotificationAndOthers : Instabug . messagesNotificationAndOthers
597
621
}
598
- }
622
+ } ;
0 commit comments