mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-02 14:10:40 +00:00
add isRunningLive
This commit is contained in:
parent
ba85a8bfde
commit
98141221ef
@ -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});
|
||||
|
4
index.js
4
index.js
@ -740,6 +740,10 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
isRunningLive: function(runningLiveCallBack) {
|
||||
Instabug.isRunningLive(runningLiveCallBack)
|
||||
},
|
||||
|
||||
/**
|
||||
* The event used to invoke the feedback form
|
||||
* @readonly
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user