File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ export default class InstabugSample extends Component {
27
27
28
28
constructor ( props ) {
29
29
super ( props ) ;
30
+
31
+ Instabug . isRunningLive ( function ( isLive ) {
32
+ if ( isLive ) {
33
+ console . log ( "live" ) ;
34
+ } else {
35
+ console . log ( "not live" ) ;
36
+ }
37
+ } ) ;
38
+
30
39
Instabug . startWithToken ( '0f0dc916bd9175e3b5d2fdf0cfa49a69' , Instabug . invocationEvent . shake ) ;
31
40
32
41
const ds = new ListView . DataSource ( { rowHasChanged : ( r1 , r2 ) => r1 !== r2 } ) ;
Original file line number Diff line number Diff line change @@ -740,6 +740,10 @@ module.exports = {
740
740
}
741
741
} ,
742
742
743
+ isRunningLive : function ( runningLiveCallBack ) {
744
+ Instabug . isRunningLive ( runningLiveCallBack )
745
+ } ,
746
+
743
747
/**
744
748
* The event used to invoke the feedback form
745
749
* @readonly
Original file line number Diff line number Diff line change @@ -326,6 +326,22 @@ - (dispatch_queue_t)methodQueue {
326
326
[Instabug setViewHierarchyEnabled: viewHirearchyEnabled];
327
327
}
328
328
329
+ RCT_EXPORT_METHOD (isRunningLive:(RCTResponseSenderBlock)callback) {
330
+ BOOL result = NO ;
331
+ #if TARGET_OS_SIMULATOR
332
+ result = NO ;
333
+ #else
334
+ BOOL isRunningTestFlightBeta = [[[[NSBundle mainBundle ] appStoreReceiptURL ] lastPathComponent ] isEqualToString: @" sandboxReceipt" ];
335
+ BOOL hasEmbeddedMobileProvision = !![[NSBundle mainBundle ] pathForResource: @" embedded" ofType: @" mobileprovision" ];
336
+ if (isRunningTestFlightBeta || hasEmbeddedMobileProvision)
337
+ {
338
+ result = NO ;
339
+ }
340
+ result = YES ;
341
+ #endif
342
+ callback (@[[NSNumber numberWithBool: result]]);
343
+ }
344
+
329
345
- (NSDictionary *)constantsToExport
330
346
{
331
347
return @{ @" invocationEventNone" : @(IBGInvocationEventNone),
You can’t perform that action at this time.
0 commit comments