add isRunningLive

This commit is contained in:
yousefhamza 2017-06-27 13:31:25 +02:00
parent ba85a8bfde
commit 98141221ef
3 changed files with 29 additions and 0 deletions

View File

@ -27,6 +27,15 @@ export default class InstabugSample extends Component {
constructor(props) {
super(props);
Instabug.isRunningLive(function (isLive) {
if (isLive) {
console.log("live");
} else {
console.log("not live");
}
});
Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake);
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});

View File

@ -740,6 +740,10 @@ module.exports = {
}
},
isRunningLive: function(runningLiveCallBack) {
Instabug.isRunningLive(runningLiveCallBack)
},
/**
* The event used to invoke the feedback form
* @readonly

View File

@ -326,6 +326,22 @@ RCT_EXPORT_METHOD(setViewHirearchyEnabled:(BOOL)viewHirearchyEnabled) {
[Instabug setViewHierarchyEnabled:viewHirearchyEnabled];
}
RCT_EXPORT_METHOD(isRunningLive:(RCTResponseSenderBlock)callback) {
BOOL result = NO;
#if TARGET_OS_SIMULATOR
result = NO;
#else
BOOL isRunningTestFlightBeta = [[[[NSBundle mainBundle] appStoreReceiptURL] lastPathComponent] isEqualToString:@"sandboxReceipt"];
BOOL hasEmbeddedMobileProvision = !![[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"];
if (isRunningTestFlightBeta || hasEmbeddedMobileProvision)
{
result = NO;
}
result = YES;
#endif
callback(@[[NSNumber numberWithBool:result]]);
}
- (NSDictionary *)constantsToExport
{
return @{ @"invocationEventNone" : @(IBGInvocationEventNone),