Skip to content

Commit 4cdeaaf

Browse files
Revert "Merge branch 'master' of https://github.com/Instabug/instabug-reactnative"
This reverts commit f761baf, reversing changes made to 2197d30.
1 parent f761baf commit 4cdeaaf

File tree

5 files changed

+50
-117
lines changed

5 files changed

+50
-117
lines changed

InstabugSample/index.ios.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default class InstabugSample extends Component {
2828
constructor(props) {
2929
super(props);
3030
Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', Instabug.invocationEvent.shake);
31-
3231
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
3332
this.state = {
3433
dataSource: ds.cloneWithRows(this._genRows({})),
@@ -62,8 +61,7 @@ export default class InstabugSample extends Component {
6261
"Unread messages count",
6362
"Set locale",
6463
"Set color theme",
65-
"Set primary color",
66-
"Show surveys"
64+
"Set primary color"
6765
];
6866
return dataBlob;
6967
}
@@ -87,8 +85,6 @@ export default class InstabugSample extends Component {
8785
this._showColorThemeActionSheet();
8886
} else if (rowID == 7) {
8987
this._showPrimaryColorActionSheet();
90-
} else if (rowID == 8) {
91-
this._showSurveys();
9288
}
9389
}
9490

@@ -229,11 +225,6 @@ export default class InstabugSample extends Component {
229225
});
230226
}
231227

232-
_showSurveys() {
233-
console.log("show surveys")
234-
Instabug.showSurveysIfAvailable()
235-
}
236-
237228
_renderSeparator(sectionID: number, rowID: number, adjacentRowHighlighted: bool) {
238229
return (
239230
<View

InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
3535
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
3636
2DCD954D1E0B4F2C00145EB5 /* InstabugSampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* InstabugSampleTests.m */; };
37+
3F14AAB3F8DF4F53A90F3677 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E4D43295C2849C9ABADE838 /* libRNInstabug.a */; };
3738
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
3839
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
39-
E55D333604B942E09167708C /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5632439F28464ECB86D23318 /* libRNInstabug.a */; };
4040
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9562565B465A2839B076D83 /* libPods-InstabugSample.a */; };
4141
/* End PBXBuildFile section */
4242

@@ -104,9 +104,9 @@
104104
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
105105
remoteInfo = React;
106106
};
107-
24C9AC781EFA773C00D07EFB /* PBXContainerItemProxy */ = {
107+
2460ED191E530B9B0043EDA4 /* PBXContainerItemProxy */ = {
108108
isa = PBXContainerItemProxy;
109-
containerPortal = 68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */;
109+
containerPortal = 330102236E534C228083A4A1 /* RNInstabug.xcodeproj */;
110110
proxyType = 2;
111111
remoteGlobalIDString = 24DF11ED1DA3A2B90056F77C;
112112
remoteInfo = RNInstabug;
@@ -262,9 +262,9 @@
262262
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>"; };
263263
2D02E47B1E0B4A5D006451C7 /* InstabugSample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "InstabugSample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
264264
2D02E4901E0B4A5D006451C7 /* InstabugSample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "InstabugSample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
265-
5632439F28464ECB86D23318 /* libRNInstabug.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNInstabug.a; sourceTree = "<group>"; };
265+
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>"; };
266+
5E4D43295C2849C9ABADE838 /* libRNInstabug.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNInstabug.a; sourceTree = "<group>"; };
266267
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
267-
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>"; };
268268
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
269269
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
270270
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 @@
295295
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
296296
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
297297
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
298+
3F14AAB3F8DF4F53A90F3677 /* libRNInstabug.a in Frameworks */,
298299
FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */,
299-
E55D333604B942E09167708C /* libRNInstabug.a in Frameworks */,
300300
);
301301
runOnlyForDeploymentPostprocessing = 0;
302302
};
@@ -431,21 +431,14 @@
431431
name = Products;
432432
sourceTree = "<group>";
433433
};
434-
24C9AC5C1EFA773C00D07EFB /* Products */ = {
434+
2460ECFD1E530B9B0043EDA4 /* Products */ = {
435435
isa = PBXGroup;
436436
children = (
437-
24C9AC791EFA773C00D07EFB /* libRNInstabug.a */,
437+
2460ED1A1E530B9B0043EDA4 /* libRNInstabug.a */,
438438
);
439439
name = Products;
440440
sourceTree = "<group>";
441441
};
442-
24ED9F161EFA6BE300D771DA /* Recovered References */ = {
443-
isa = PBXGroup;
444-
children = (
445-
);
446-
name = "Recovered References";
447-
sourceTree = "<group>";
448-
};
449442
443E311BD736B6F07D8B5811 /* Frameworks */ = {
450443
isa = PBXGroup;
451444
children = (
@@ -495,7 +488,7 @@
495488
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
496489
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
497490
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
498-
68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */,
491+
330102236E534C228083A4A1 /* RNInstabug.xcodeproj */,
499492
);
500493
name = Libraries;
501494
sourceTree = "<group>";
@@ -518,7 +511,6 @@
518511
83CBBA001A601CBA00E9B192 /* Products */,
519512
8098B839B3C5F5897B38D9B3 /* Pods */,
520513
443E311BD736B6F07D8B5811 /* Frameworks */,
521-
24ED9F161EFA6BE300D771DA /* Recovered References */,
522514
);
523515
indentWidth = 2;
524516
sourceTree = "<group>";
@@ -626,9 +618,6 @@
626618
CreatedOnToolsVersion = 6.2;
627619
TestTargetID = 13B07F861A680F5B00A75B9A;
628620
};
629-
13B07F861A680F5B00A75B9A = {
630-
DevelopmentTeam = 56S6Q9SA8U;
631-
};
632621
2D02E47A1E0B4A5D006451C7 = {
633622
CreatedOnToolsVersion = 8.2.1;
634623
ProvisioningStyle = Automatic;
@@ -697,8 +686,8 @@
697686
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
698687
},
699688
{
700-
ProductGroup = 24C9AC5C1EFA773C00D07EFB /* Products */;
701-
ProjectRef = 68353C997C7F4ED0910B4CFA /* RNInstabug.xcodeproj */;
689+
ProductGroup = 2460ECFD1E530B9B0043EDA4 /* Products */;
690+
ProjectRef = 330102236E534C228083A4A1 /* RNInstabug.xcodeproj */;
702691
},
703692
);
704693
projectRoot = "";
@@ -768,11 +757,11 @@
768757
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
769758
sourceTree = BUILT_PRODUCTS_DIR;
770759
};
771-
24C9AC791EFA773C00D07EFB /* libRNInstabug.a */ = {
760+
2460ED1A1E530B9B0043EDA4 /* libRNInstabug.a */ = {
772761
isa = PBXReferenceProxy;
773762
fileType = archive.ar;
774763
path = libRNInstabug.a;
775-
remoteRef = 24C9AC781EFA773C00D07EFB /* PBXContainerItemProxy */;
764+
remoteRef = 2460ED191E530B9B0043EDA4 /* PBXContainerItemProxy */;
776765
sourceTree = BUILT_PRODUCTS_DIR;
777766
};
778767
3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
@@ -1121,9 +1110,7 @@
11211110
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11221111
CURRENT_PROJECT_VERSION = 1;
11231112
DEAD_CODE_STRIPPING = NO;
1124-
DEVELOPMENT_TEAM = 56S6Q9SA8U;
11251113
INFOPLIST_FILE = InstabugSample/Info.plist;
1126-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
11271114
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
11281115
OTHER_LDFLAGS = (
11291116
"$(inherited)",
@@ -1141,9 +1128,7 @@
11411128
buildSettings = {
11421129
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
11431130
CURRENT_PROJECT_VERSION = 1;
1144-
DEVELOPMENT_TEAM = 56S6Q9SA8U;
11451131
INFOPLIST_FILE = InstabugSample/Info.plist;
1146-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
11471132
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
11481133
OTHER_LDFLAGS = (
11491134
"$(inherited)",

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ public void clearFileAttachment() {
10621062
/**
10631063
* Sets a block of code that gets executed when a new message is received.
10641064
*
1065-
* @param {onNewMessageHandler} onNewMessageHandler - A callback that gets
1065+
* @param {onNewMessgaeHandler} onNewMessageHandler - A callback that gets
10661066
* executed when a new message is received.
10671067
*/
10681068
@ReactMethod

index.js

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ module.exports = {
4848
Instabug.dismiss();
4949
},
5050

51+
/**
52+
* Attaches a file to each report being sent.
53+
* A new copy of the file at fileLocation will be attached with each bug
54+
* report being sent.
55+
* Each call to this method overrides the file to be attached.
56+
* The file has to be available locally at the provided path.
57+
* @param {string} fileLocation Path to a file that's going to be attached
58+
* to each report.
59+
*/
60+
// Not yet tested
61+
setFileAttachment: function (fileLocation) {
62+
Instabug.setFileAttachment(fileLocation);
63+
},
64+
5165
/**
5266
* Attaches user data to each report being sent.
5367
* Each call to this method overrides the user data to be attached.
@@ -84,7 +98,7 @@ module.exports = {
8498
* Sets a block of code to be executed before sending each report.
8599
* This block is executed in the background before sending each report. Could
86100
* be used for attaching logs and extra data to reports.
87-
* @param {function} preSendingHandler - A callback that gets executed before sending each bug
101+
* @param {preSendingHandler} preSendingHandler - A callback that gets executed before sending each bug
88102
* report.
89103
*/
90104
setPreSendingHandler: function (preSendingHandler) {
@@ -105,7 +119,7 @@ module.exports = {
105119
* Sets a block of code to be executed just before the SDK's UI is presented.
106120
* This block is executed on the UI thread. Could be used for performing any
107121
* UI changes before the SDK's UI is shown.
108-
* @param {function} preInvocationHandler - A callback that gets executed before invoking the SDK
122+
* @param {preInvocationHandler} preInvocationHandler - A callback that gets executed before invoking the SDK
109123
*/
110124
setPreInvocationHandler: function (preInvocationHandler) {
111125
if (Platform.OS === 'ios') {
@@ -124,7 +138,7 @@ module.exports = {
124138
* Sets a block of code to be executed right after the SDK's UI is dismissed.
125139
* This block is executed on the UI thread. Could be used for performing any
126140
* UI changes after the SDK's UI is dismissed.
127-
* @param {function} postInvocationHandler - A callback to get executed after
141+
* @param {postInvocationHandler} postInvocationHandler - A callback to get executed after
128142
* dismissing the SDK.
129143
*/
130144
setPostInvocationHandler: function (postInvocationHandler) {
@@ -376,15 +390,15 @@ module.exports = {
376390

377391
/**
378392
* Sets a block of code that gets executed when a new message is received.
379-
* @param {function} onNewMessageHandler - A callback that gets
393+
* @param {onNewMessgaeHandler} onNewMessageHandler - A callback that gets
380394
* executed when a new message is received.
381395
*/
382396
setOnNewMessageHandler: function (onNewMessageHandler) {
383397
if (Platform.OS === 'ios') {
384398
Instabug.addListener('IBGonNewMessageHandler');
385399
NativeAppEventEmitter.addListener(
386400
'IBGonNewMessageHandler',
387-
onNewMessageHandler
401+
onNewMessgaeHandler
388402
);
389403
}
390404

@@ -399,7 +413,7 @@ module.exports = {
399413
* you should call didReceiveRemoteNotification: to let the Instabug handle
400414
* the notification. Otherwise, handle the notification on your own.
401415
* @param {Object} dict Notification's userInfo
402-
* @param {function} isInstabugNotificationCallback callback with
416+
* @param {isInstabugNotificationCallback} isInstabugNotificationCallback callback with
403417
* argument isInstabugNotification
404418
*/
405419
isInstabugNotification: function (dict, isInstabugNotificationCallback) {
@@ -435,7 +449,7 @@ module.exports = {
435449
* feedback.
436450
* Use this method to give users a list of choices of categories their bug report or feedback might be related
437451
* to. Selected category will be shown as a tag on your dashboard.
438-
* @param {Array} titles titles to be shown in the list.
452+
* @param {array} titles titles to be shown in the list.
439453
*/
440454
setReportCategories: function (...titles) {
441455
if (Platform.OS == 'ios') {
@@ -590,7 +604,7 @@ module.exports = {
590604
* Returns the user attribute associated with a given key.
591605
aKey
592606
* @param {string} key The attribute key as string
593-
* @param {function} userAttributeCallback callback with argument as the desired user attribute value
607+
* @param {userAttributeCallback} userAttributeCallback callback with argument as the desired user attribute value
594608
*/
595609
getUserAttribute: function (key, userAttributeCallback) {
596610
Instabug.getUserAttribute(key, userAttributeCallback);
@@ -610,7 +624,7 @@ module.exports = {
610624

611625
/**
612626
* @summary Returns all user attributes.
613-
* @param {function} userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
627+
* @param {userAttributesCallback} userAttributesCallback callback with argument A new dictionary containing all the currently set user attributes,
614628
* or an empty dictionary if no user attributes have been set.
615629
*/
616630
getAllUserAttributes: function (userAttributesCallback) {
@@ -624,43 +638,18 @@ module.exports = {
624638
Instabug.clearAllUserAttributes();
625639
},
626640

627-
/**
628-
* @summary Enables/disables inspect view hierarchy when reporting a bug/feedback.
629-
* @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
630-
*/
631-
setViewHierarchyEnabled: function (viewHierarchyEnabled) {
632-
if (Platform.OS === 'ios') {
633-
Instabug.setViewHierarchyEnabled(viewHierarchyEnabled);
634-
}
641+
setViewHirearchyEnabled: function (viewHirearchyEnabled) {
642+
Instabug.setViewHirearchyEnabled(viewHirearchyEnabled);
635643
},
636644

637-
/**
638-
* @summary Sets whether surveys are enabled or not.
639-
* If you disable surveys on the SDK but still have active surveys on your Instabug dashboard,
640-
* those surveys are still going to be sent to the device, but are not going to be shown automatically.
641-
* To manually display any available surveys, call `Instabug.showSurveyIfAvailable()`.
642-
* Defaults to `true`.
643-
* @param {boolean} surveysEnabled A boolean to set whether Instabug Surveys is enabled or disabled.
644-
*/
645645
setSurveysEnabled: function (surveysEnabled) {
646646
Instabug.setSurveysEnabled(surveysEnabled)
647647
},
648648

649-
/**
650-
* @summary Shows one of the surveys that were not shown before, that also have conditions that match the current device/user.
651-
* Does nothing if there are no available surveys or if a survey has already been shown in the current session.
652-
*/
653649
showSurveysIfAvailable: function () {
654650
Instabug.showSurveysIfAvailable()
655651
},
656652

657-
/**
658-
* @summary Sets a block of code to be executed just before the survey's UI is presented.
659-
* This block is executed on the UI thread. Could be used for performing any UI changes before
660-
* the survey's UI is shown.
661-
* @param {function} willShowSurveyHandler - A block of code that gets executed before presenting the survey's UI.
662-
* report.
663-
*/
664653
setWillShowSurveyHandler: function (willShowSurveyHandler) {
665654
if (Platform.OS === 'ios') {
666655
Instabug.addListener('IBGWillShowSurvey');
@@ -674,12 +663,6 @@ module.exports = {
674663

675664
},
676665

677-
/**
678-
* @summary Sets a block of code to be executed right after the survey's UI is dismissed.
679-
* This block is executed on the UI thread. Could be used for performing any UI changes after the survey's UI
680-
* is dismissed.
681-
* @param {function} didDismissSurveyHandler - A block of code that gets executed after the survey's UI is dismissed.
682-
*/
683666
setDidDismissSurveyHandler: function (didDismissSurveyHandler) {
684667
if (Platform.OS === 'ios') {
685668
Instabug.addListener('IBGDidDismissSurvey');
@@ -708,6 +691,14 @@ module.exports = {
708691
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
709692
},
710693

694+
/**
695+
* Clears all Uris of the attached files.
696+
* The URIs which added via {@link Instabug#addFileAttachment} API not the physical files.
697+
*/
698+
clearFileAttachment: function () {
699+
Instabug.clearFileAttachment();
700+
},
701+
711702
/**
712703
* The event used to invoke the feedback form
713704
* @readonly

0 commit comments

Comments
 (0)