mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 14:40:54 +00:00
Revert "Revert "Merge branch 'master' of https://github.com/Instabug/instabug-reactnative""
This reverts commit 4cdeaaf2d1730535f43f56330298da215d3f7804.
This commit is contained in:
parent
d8276f93dc
commit
9d8ad92049
@ -28,6 +28,7 @@ export default class InstabugSample extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake);
|
Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake);
|
||||||
|
|
||||||
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
|
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
|
||||||
this.state = {
|
this.state = {
|
||||||
dataSource: ds.cloneWithRows(this._genRows({})),
|
dataSource: ds.cloneWithRows(this._genRows({})),
|
||||||
@ -61,7 +62,8 @@ export default class InstabugSample extends Component {
|
|||||||
"Unread messages count",
|
"Unread messages count",
|
||||||
"Set locale",
|
"Set locale",
|
||||||
"Set color theme",
|
"Set color theme",
|
||||||
"Set primary color"
|
"Set primary color",
|
||||||
|
"Show surveys"
|
||||||
];
|
];
|
||||||
return dataBlob;
|
return dataBlob;
|
||||||
}
|
}
|
||||||
@ -85,6 +87,8 @@ export default class InstabugSample extends Component {
|
|||||||
this._showColorThemeActionSheet();
|
this._showColorThemeActionSheet();
|
||||||
} else if (rowID == 7) {
|
} else if (rowID == 7) {
|
||||||
this._showPrimaryColorActionSheet();
|
this._showPrimaryColorActionSheet();
|
||||||
|
} else if (rowID == 8) {
|
||||||
|
this._showSurveys();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,6 +229,11 @@ export default class InstabugSample extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_showSurveys() {
|
||||||
|
console.log("show surveys")
|
||||||
|
Instabug.showSurveysIfAvailable()
|
||||||
|
}
|
||||||
|
|
||||||
_renderSeparator(sectionID: number, rowID: number, adjacentRowHighlighted: bool) {
|
_renderSeparator(sectionID: number, rowID: number, adjacentRowHighlighted: bool) {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
|
@ -34,9 +34,9 @@
|
|||||||
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
|
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
|
||||||
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
|
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
|
||||||
2DCD954D1E0B4F2C00145EB5 /* InstabugSampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* InstabugSampleTests.m */; };
|
2DCD954D1E0B4F2C00145EB5 /* InstabugSampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* InstabugSampleTests.m */; };
|
||||||
3F14AAB3F8DF4F53A90F3677 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E4D43295C2849C9ABADE838 /* libRNInstabug.a */; };
|
|
||||||
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
||||||
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
|
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
|
||||||
|
E55D333604B942E09167708C /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5632439F28464ECB86D23318 /* libRNInstabug.a */; };
|
||||||
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9562565B465A2839B076D83 /* libPods-InstabugSample.a */; };
|
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9562565B465A2839B076D83 /* libPods-InstabugSample.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
@ -104,9 +104,9 @@
|
|||||||
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
|
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
|
||||||
remoteInfo = React;
|
remoteInfo = React;
|
||||||
};
|
};
|
||||||
2460ED191E530B9B0043EDA4 /* PBXContainerItemProxy */ = {
|
24C9AC781EFA773C00D07EFB /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 330102236E534C228083A4A1 /* RNInstabug.xcodeproj */;
|
containerPortal = 68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */;
|
||||||
proxyType = 2;
|
proxyType = 2;
|
||||||
remoteGlobalIDString = 24DF11ED1DA3A2B90056F77C;
|
remoteGlobalIDString = 24DF11ED1DA3A2B90056F77C;
|
||||||
remoteInfo = RNInstabug;
|
remoteInfo = RNInstabug;
|
||||||
@ -262,9 +262,9 @@
|
|||||||
21DED4D3594E0D93E837631F /* Pods-InstabugSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSample/Pods-InstabugSample.release.xcconfig"; sourceTree = "<group>"; };
|
21DED4D3594E0D93E837631F /* Pods-InstabugSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSample/Pods-InstabugSample.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
2D02E47B1E0B4A5D006451C7 /* InstabugSample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "InstabugSample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
2D02E47B1E0B4A5D006451C7 /* InstabugSample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "InstabugSample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
2D02E4901E0B4A5D006451C7 /* InstabugSample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "InstabugSample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
2D02E4901E0B4A5D006451C7 /* InstabugSample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "InstabugSample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
330102236E534C228083A4A1 /* RNInstabug.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNInstabug.xcodeproj; path = "../node_modules/instabug-reactnative/ios/RNInstabug.xcodeproj"; sourceTree = "<group>"; };
|
5632439F28464ECB86D23318 /* libRNInstabug.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNInstabug.a; sourceTree = "<group>"; };
|
||||||
5E4D43295C2849C9ABADE838 /* libRNInstabug.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNInstabug.a; sourceTree = "<group>"; };
|
|
||||||
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
||||||
|
68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNInstabug.xcodeproj; path = "../node_modules/instabug-reactnative/ios/RNInstabug.xcodeproj"; sourceTree = "<group>"; };
|
||||||
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
|
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
|
||||||
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
|
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
|
||||||
8601D784DB38337F6E545397 /* Pods-InstabugSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSample/Pods-InstabugSample.debug.xcconfig"; sourceTree = "<group>"; };
|
8601D784DB38337F6E545397 /* Pods-InstabugSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSample/Pods-InstabugSample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
@ -295,8 +295,8 @@
|
|||||||
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
|
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
|
||||||
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
|
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
|
||||||
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
|
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
|
||||||
3F14AAB3F8DF4F53A90F3677 /* libRNInstabug.a in Frameworks */,
|
|
||||||
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */,
|
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */,
|
||||||
|
E55D333604B942E09167708C /* libRNInstabug.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -431,14 +431,21 @@
|
|||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
2460ECFD1E530B9B0043EDA4 /* Products */ = {
|
24C9AC5C1EFA773C00D07EFB /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
2460ED1A1E530B9B0043EDA4 /* libRNInstabug.a */,
|
24C9AC791EFA773C00D07EFB /* libRNInstabug.a */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
24ED9F161EFA6BE300D771DA /* Recovered References */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
name = "Recovered References";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
443E311BD736B6F07D8B5811 /* Frameworks */ = {
|
443E311BD736B6F07D8B5811 /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -488,7 +495,7 @@
|
|||||||
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
|
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
|
||||||
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
|
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
|
||||||
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
|
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
|
||||||
330102236E534C228083A4A1 /* RNInstabug.xcodeproj */,
|
68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */,
|
||||||
);
|
);
|
||||||
name = Libraries;
|
name = Libraries;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -511,6 +518,7 @@
|
|||||||
83CBBA001A601CBA00E9B192 /* Products */,
|
83CBBA001A601CBA00E9B192 /* Products */,
|
||||||
8098B839B3C5F5897B38D9B3 /* Pods */,
|
8098B839B3C5F5897B38D9B3 /* Pods */,
|
||||||
443E311BD736B6F07D8B5811 /* Frameworks */,
|
443E311BD736B6F07D8B5811 /* Frameworks */,
|
||||||
|
24ED9F161EFA6BE300D771DA /* Recovered References */,
|
||||||
);
|
);
|
||||||
indentWidth = 2;
|
indentWidth = 2;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -618,6 +626,9 @@
|
|||||||
CreatedOnToolsVersion = 6.2;
|
CreatedOnToolsVersion = 6.2;
|
||||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
TestTargetID = 13B07F861A680F5B00A75B9A;
|
||||||
};
|
};
|
||||||
|
13B07F861A680F5B00A75B9A = {
|
||||||
|
DevelopmentTeam = 56S6Q9SA8U;
|
||||||
|
};
|
||||||
2D02E47A1E0B4A5D006451C7 = {
|
2D02E47A1E0B4A5D006451C7 = {
|
||||||
CreatedOnToolsVersion = 8.2.1;
|
CreatedOnToolsVersion = 8.2.1;
|
||||||
ProvisioningStyle = Automatic;
|
ProvisioningStyle = Automatic;
|
||||||
@ -686,8 +697,8 @@
|
|||||||
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ProductGroup = 2460ECFD1E530B9B0043EDA4 /* Products */;
|
ProductGroup = 24C9AC5C1EFA773C00D07EFB /* Products */;
|
||||||
ProjectRef = 330102236E534C228083A4A1 /* RNInstabug.xcodeproj */;
|
ProjectRef = 68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
@ -757,11 +768,11 @@
|
|||||||
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
|
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
2460ED1A1E530B9B0043EDA4 /* libRNInstabug.a */ = {
|
24C9AC791EFA773C00D07EFB /* libRNInstabug.a */ = {
|
||||||
isa = PBXReferenceProxy;
|
isa = PBXReferenceProxy;
|
||||||
fileType = archive.ar;
|
fileType = archive.ar;
|
||||||
path = libRNInstabug.a;
|
path = libRNInstabug.a;
|
||||||
remoteRef = 2460ED191E530B9B0043EDA4 /* PBXContainerItemProxy */;
|
remoteRef = 24C9AC781EFA773C00D07EFB /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
|
3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
|
||||||
@ -1110,7 +1121,9 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEAD_CODE_STRIPPING = NO;
|
DEAD_CODE_STRIPPING = NO;
|
||||||
|
DEVELOPMENT_TEAM = 56S6Q9SA8U;
|
||||||
INFOPLIST_FILE = InstabugSample/Info.plist;
|
INFOPLIST_FILE = InstabugSample/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -1128,7 +1141,9 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEVELOPMENT_TEAM = 56S6Q9SA8U;
|
||||||
INFOPLIST_FILE = InstabugSample/Info.plist;
|
INFOPLIST_FILE = InstabugSample/Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
@ -1062,7 +1062,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
|||||||
/**
|
/**
|
||||||
* Sets a block of code that gets executed when a new message is received.
|
* Sets a block of code that gets executed when a new message is received.
|
||||||
*
|
*
|
||||||
* @param {onNewMessgaeHandler} onNewMessageHandler - A callback that gets
|
* @param {onNewMessageHandler} onNewMessageHandler - A callback that gets
|
||||||
* executed when a new message is received.
|
* executed when a new message is received.
|
||||||
*/
|
*/
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
|
75
index.js
75
index.js
@ -48,20 +48,6 @@ module.exports = {
|
|||||||
Instabug.dismiss();
|
Instabug.dismiss();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a file to each report being sent.
|
|
||||||
* A new copy of the file at fileLocation will be attached with each bug
|
|
||||||
* report being sent.
|
|
||||||
* Each call to this method overrides the file to be attached.
|
|
||||||
* The file has to be available locally at the provided path.
|
|
||||||
* @param {string} fileLocation Path to a file that's going to be attached
|
|
||||||
* to each report.
|
|
||||||
*/
|
|
||||||
// Not yet tested
|
|
||||||
setFileAttachment: function (fileLocation) {
|
|
||||||
Instabug.setFileAttachment(fileLocation);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attaches user data to each report being sent.
|
* Attaches user data to each report being sent.
|
||||||
* Each call to this method overrides the user data to be attached.
|
* Each call to this method overrides the user data to be attached.
|
||||||
@ -98,7 +84,7 @@ module.exports = {
|
|||||||
* Sets a block of code to be executed before sending each report.
|
* Sets a block of code to be executed before sending each report.
|
||||||
* This block is executed in the background before sending each report. Could
|
* This block is executed in the background before sending each report. Could
|
||||||
* be used for attaching logs and extra data to reports.
|
* be used for attaching logs and extra data to reports.
|
||||||
* @param {preSendingHandler} preSendingHandler - A callback that gets executed before sending each bug
|
* @param {function} preSendingHandler - A callback that gets executed before sending each bug
|
||||||
* report.
|
* report.
|
||||||
*/
|
*/
|
||||||
setPreSendingHandler: function (preSendingHandler) {
|
setPreSendingHandler: function (preSendingHandler) {
|
||||||
@ -119,7 +105,7 @@ module.exports = {
|
|||||||
* Sets a block of code to be executed just before the SDK's UI is presented.
|
* Sets a block of code to be executed just before the SDK's UI is presented.
|
||||||
* This block is executed on the UI thread. Could be used for performing any
|
* This block is executed on the UI thread. Could be used for performing any
|
||||||
* UI changes before the SDK's UI is shown.
|
* UI changes before the SDK's UI is shown.
|
||||||
* @param {preInvocationHandler} preInvocationHandler - A callback that gets executed before invoking the SDK
|
* @param {function} preInvocationHandler - A callback that gets executed before invoking the SDK
|
||||||
*/
|
*/
|
||||||
setPreInvocationHandler: function (preInvocationHandler) {
|
setPreInvocationHandler: function (preInvocationHandler) {
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
@ -138,7 +124,7 @@ module.exports = {
|
|||||||
* Sets a block of code to be executed right after the SDK's UI is dismissed.
|
* Sets a block of code to be executed right after the SDK's UI is dismissed.
|
||||||
* This block is executed on the UI thread. Could be used for performing any
|
* This block is executed on the UI thread. Could be used for performing any
|
||||||
* UI changes after the SDK's UI is dismissed.
|
* UI changes after the SDK's UI is dismissed.
|
||||||
* @param {postInvocationHandler} postInvocationHandler - A callback to get executed after
|
* @param {function} postInvocationHandler - A callback to get executed after
|
||||||
* dismissing the SDK.
|
* dismissing the SDK.
|
||||||
*/
|
*/
|
||||||
setPostInvocationHandler: function (postInvocationHandler) {
|
setPostInvocationHandler: function (postInvocationHandler) {
|
||||||
@ -390,7 +376,7 @@ module.exports = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a block of code that gets executed when a new message is received.
|
* Sets a block of code that gets executed when a new message is received.
|
||||||
* @param {onNewMessgaeHandler} onNewMessageHandler - A callback that gets
|
* @param {function} onNewMessageHandler - A callback that gets
|
||||||
* executed when a new message is received.
|
* executed when a new message is received.
|
||||||
*/
|
*/
|
||||||
setOnNewMessageHandler: function (onNewMessageHandler) {
|
setOnNewMessageHandler: function (onNewMessageHandler) {
|
||||||
@ -398,7 +384,7 @@ module.exports = {
|
|||||||
Instabug.addListener('IBGonNewMessageHandler');
|
Instabug.addListener('IBGonNewMessageHandler');
|
||||||
NativeAppEventEmitter.addListener(
|
NativeAppEventEmitter.addListener(
|
||||||
'IBGonNewMessageHandler',
|
'IBGonNewMessageHandler',
|
||||||
onNewMessgaeHandler
|
onNewMessageHandler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +399,7 @@ module.exports = {
|
|||||||
* you should call didReceiveRemoteNotification: to let the Instabug handle
|
* you should call didReceiveRemoteNotification: to let the Instabug handle
|
||||||
* the notification. Otherwise, handle the notification on your own.
|
* the notification. Otherwise, handle the notification on your own.
|
||||||
* @param {Object} dict Notification's userInfo
|
* @param {Object} dict Notification's userInfo
|
||||||
* @param {isInstabugNotificationCallback} isInstabugNotificationCallback callback with
|
* @param {function} isInstabugNotificationCallback callback with
|
||||||
* argument isInstabugNotification
|
* argument isInstabugNotification
|
||||||
*/
|
*/
|
||||||
isInstabugNotification: function (dict, isInstabugNotificationCallback) {
|
isInstabugNotification: function (dict, isInstabugNotificationCallback) {
|
||||||
@ -449,7 +435,7 @@ module.exports = {
|
|||||||
* feedback.
|
* feedback.
|
||||||
* Use this method to give users a list of choices of categories their bug report or feedback might be related
|
* Use this method to give users a list of choices of categories their bug report or feedback might be related
|
||||||
* to. Selected category will be shown as a tag on your dashboard.
|
* to. Selected category will be shown as a tag on your dashboard.
|
||||||
* @param {array} titles titles to be shown in the list.
|
* @param {Array} titles titles to be shown in the list.
|
||||||
*/
|
*/
|
||||||
setReportCategories: function (...titles) {
|
setReportCategories: function (...titles) {
|
||||||
if (Platform.OS == 'ios') {
|
if (Platform.OS == 'ios') {
|
||||||
@ -604,7 +590,7 @@ module.exports = {
|
|||||||
* Returns the user attribute associated with a given key.
|
* Returns the user attribute associated with a given key.
|
||||||
aKey
|
aKey
|
||||||
* @param {string} key The attribute key as string
|
* @param {string} key The attribute key as string
|
||||||
* @param {userAttributeCallback} userAttributeCallback callback with argument as the desired user attribute value
|
* @param {function} userAttributeCallback callback with argument as the desired user attribute value
|
||||||
*/
|
*/
|
||||||
getUserAttribute: function (key, userAttributeCallback) {
|
getUserAttribute: function (key, userAttributeCallback) {
|
||||||
Instabug.getUserAttribute(key, userAttributeCallback);
|
Instabug.getUserAttribute(key, userAttributeCallback);
|
||||||
@ -624,7 +610,7 @@ module.exports = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Returns all user attributes.
|
* @summary Returns all user attributes.
|
||||||
* @param {userAttributesCallback} userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
|
* @param {function} userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
|
||||||
* or an empty dictionary if no user attributes have been set.
|
* or an empty dictionary if no user attributes have been set.
|
||||||
*/
|
*/
|
||||||
getAllUserAttributes: function (userAttributesCallback) {
|
getAllUserAttributes: function (userAttributesCallback) {
|
||||||
@ -638,18 +624,43 @@ module.exports = {
|
|||||||
Instabug.clearAllUserAttributes();
|
Instabug.clearAllUserAttributes();
|
||||||
},
|
},
|
||||||
|
|
||||||
setViewHirearchyEnabled: function (viewHirearchyEnabled) {
|
/**
|
||||||
Instabug.setViewHirearchyEnabled(viewHirearchyEnabled);
|
* @summary Enables/disables inspect view hierarchy when reporting a bug/feedback.
|
||||||
|
* @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
|
||||||
|
*/
|
||||||
|
setViewHierarchyEnabled: function (viewHierarchyEnabled) {
|
||||||
|
if (Platform.OS === 'ios') {
|
||||||
|
Instabug.setViewHierarchyEnabled(viewHierarchyEnabled);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Sets whether surveys are enabled or not.
|
||||||
|
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
|
||||||
|
* those surveys are still going to be sent to the device, but are not going to be shown automatically.
|
||||||
|
* To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
|
||||||
|
* Defaults to `true`.
|
||||||
|
* @param {boolean} surveysEnabled A boolean to set whether Instabug Surveys is enabled or disabled.
|
||||||
|
*/
|
||||||
setSurveysEnabled: function (surveysEnabled) {
|
setSurveysEnabled: function (surveysEnabled) {
|
||||||
Instabug.setSurveysEnabled(surveysEnabled)
|
Instabug.setSurveysEnabled(surveysEnabled)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Shows one of the surveys that were not shown before, that also have conditions that match the current device/user.
|
||||||
|
* Does nothing if there are no available surveys or if a survey has already been shown in the current session.
|
||||||
|
*/
|
||||||
showSurveysIfAvailable: function () {
|
showSurveysIfAvailable: function () {
|
||||||
Instabug.showSurveysIfAvailable()
|
Instabug.showSurveysIfAvailable()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Sets a block of code to be executed just before the survey's UI is presented.
|
||||||
|
* This block is executed on the UI thread. Could be used for performing any UI changes before
|
||||||
|
* the survey's UI is shown.
|
||||||
|
* @param {function} willShowSurveyHandler - A block of code that gets executed before presenting the survey's UI.
|
||||||
|
* report.
|
||||||
|
*/
|
||||||
setWillShowSurveyHandler: function (willShowSurveyHandler) {
|
setWillShowSurveyHandler: function (willShowSurveyHandler) {
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
Instabug.addListener('IBGWillShowSurvey');
|
Instabug.addListener('IBGWillShowSurvey');
|
||||||
@ -663,6 +674,12 @@ module.exports = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @summary Sets a block of code to be executed right after the survey's UI is dismissed.
|
||||||
|
* This block is executed on the UI thread. Could be used for performing any UI changes after the survey's UI
|
||||||
|
* is dismissed.
|
||||||
|
* @param {function} didDismissSurveyHandler - A block of code that gets executed after the survey's UI is dismissed.
|
||||||
|
*/
|
||||||
setDidDismissSurveyHandler: function (didDismissSurveyHandler) {
|
setDidDismissSurveyHandler: function (didDismissSurveyHandler) {
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
Instabug.addListener('IBGDidDismissSurvey');
|
Instabug.addListener('IBGDidDismissSurvey');
|
||||||
@ -691,14 +708,6 @@ module.exports = {
|
|||||||
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
|
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears all Uris of the attached files.
|
|
||||||
* The URIs which added via {@link Instabug#addFileAttachment} API not the physical files.
|
|
||||||
*/
|
|
||||||
clearFileAttachment: function () {
|
|
||||||
Instabug.clearFileAttachment();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event used to invoke the feedback form
|
* The event used to invoke the feedback form
|
||||||
* @readonly
|
* @readonly
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
@"IBGpreSendingHandler",
|
@"IBGpreSendingHandler",
|
||||||
@"IBGpreInvocationHandler",
|
@"IBGpreInvocationHandler",
|
||||||
@"IBGpostInvocationHandler",
|
@"IBGpostInvocationHandler",
|
||||||
@"IBGonNewMessageHandler"
|
@"IBGonNewMessageHandler",
|
||||||
|
@"IBGWillShowSurvey",
|
||||||
|
@"IBGDidDismissSurvey"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +196,7 @@ RCT_EXPORT_METHOD(setOnNewMessageHandler:(RCTResponseSenderBlock)callBack) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(setPromptOptions:(BOOL)bugReportEnabled
|
RCT_EXPORT_METHOD(setPromptOptionsEnabled:(BOOL)bugReportEnabled
|
||||||
feedback:(BOOL)feedbackEnabled
|
feedback:(BOOL)feedbackEnabled
|
||||||
chat:(BOOL)chatEnabled) {
|
chat:(BOOL)chatEnabled) {
|
||||||
[Instabug setPromptOptionsEnabledWithBug:bugReportEnabled
|
[Instabug setPromptOptionsEnabledWithBug:bugReportEnabled
|
||||||
@ -292,6 +294,38 @@ RCT_EXPORT_METHOD(logError:(NSString *)log) {
|
|||||||
[Instabug logError:log];
|
[Instabug logError:log];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(setSurveysEnabled:(BOOL)surveysEnabled) {
|
||||||
|
[Instabug setSurveysEnabled:surveysEnabled];
|
||||||
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(showSurveysIfAvailable) {
|
||||||
|
[Instabug showSurveyIfAvailable];
|
||||||
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(setWillShowSurveyHandler:(RCTResponseSenderBlock)callBack) {
|
||||||
|
if (callBack != nil) {
|
||||||
|
[Instabug setWillShowSurveyHandler:^{
|
||||||
|
[self sendEventWithName:@"IBGWillShowSurvey" body:nil];
|
||||||
|
}];
|
||||||
|
} else {
|
||||||
|
[Instabug setWillShowSurveyHandler:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(setDidDismissSurveyHandler:(RCTResponseSenderBlock)callBack) {
|
||||||
|
if (callBack != nil) {
|
||||||
|
[Instabug setDidDismissSurveyHandler:^{
|
||||||
|
[self sendEventWithName:@"IBGDidDismissSurvey" body:nil];
|
||||||
|
}];
|
||||||
|
} else {
|
||||||
|
[Instabug setDidDismissSurveyHandler:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RCT_EXPORT_METHOD(setViewHirearchyEnabled:(BOOL)viewHirearchyEnabled) {
|
||||||
|
[Instabug setViewHierarchyEnabled:viewHirearchyEnabled];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSDictionary *)constantsToExport
|
- (NSDictionary *)constantsToExport
|
||||||
{
|
{
|
||||||
return @{ @"invocationEventNone" : @(IBGInvocationEventNone),
|
return @{ @"invocationEventNone" : @(IBGInvocationEventNone),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user