mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2026-08-30 21:51:09 +00:00
@@ -27,7 +27,14 @@ export default class InstabugSample extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake);
|
||||
|
||||
Instabug.isRunningLive(function (isLive) {
|
||||
if (isLive) {
|
||||
Instabug.startWithToken('LIVE_TOKEN', Instabug.invocationEvent.shake);
|
||||
} else {
|
||||
Instabug.startWithToken('BETA_TOKEN', Instabug.invocationEvent.shake);
|
||||
}
|
||||
});
|
||||
|
||||
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
|
||||
this.state = {
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
24ED9F161EFA6BE300D771DA /* Recovered References */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5632439F28464ECB86D23318 /* libRNInstabug.a */,
|
||||
);
|
||||
name = "Recovered References";
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -712,9 +712,9 @@ module.exports = {
|
||||
* none is enabled, Bug
|
||||
* reporting becomes the default invocation option.
|
||||
*
|
||||
* @param {boolean} chat weather Talk to us is enable or not
|
||||
* @param {boolean} bug weather Report a Problem is enable or not
|
||||
* @param {boolean} feedback weather General Feedback is enable or not
|
||||
* @param {boolean} chat whether Talk to us is enable or not
|
||||
* @param {boolean} bug whether Report a Problem is enable or not
|
||||
* @param {boolean} feedback whether General Feedback is enable or not
|
||||
* */
|
||||
setPromptOptionsEnabled: function (chat, bug, feedback) {
|
||||
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
|
||||
@@ -740,6 +740,19 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @summary Checks whether app is development/Beta testing OR live
|
||||
* Note: This API is iOS only
|
||||
* It returns in the callback false if in development or beta testing on Test Flight, and true if app is live on the
|
||||
* app store.
|
||||
* @param {function} runningLiveCallBack callback with argument as return value 'isLive'
|
||||
*/
|
||||
isRunningLive: function(runningLiveCallBack) {
|
||||
if (Platform.OS === 'ios') {
|
||||
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),
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "instabug-reactnative",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "React Native plugin for integrating the Instabug SDK",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user