Skip to content

Commit 2692c3e

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/typescript-validation
2 parents 5f0226e + b4eb79f commit 2692c3e

File tree

106 files changed

+1765
-2110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1765
-2110
lines changed

.circleci/config.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,8 @@ jobs:
1414
- checkout:
1515
path: ~/project
1616

17-
- restore_cache:
18-
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
19-
20-
- restore_cache:
21-
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
22-
2317
- run: yarn
2418

25-
- save_cache:
26-
key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }}
27-
paths:
28-
- ~/.cache/yarn
29-
30-
- save_cache:
31-
key: node-v1-{{ checksum "package.json" }}-{{ arch }}
32-
paths:
33-
- node_modules
34-
3519
- run:
3620
name: Typescript Definitions Validation
3721
command: node typescript_validator.js

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## v10.0.0 (2021-02-16)
2+
3+
* Introduces Instabug’s new App Performance Monitoring (APM)
4+
* Adds support for Push Notifications
5+
* Bumps the minimum supported iOS version to iOS 10
6+
* Various bug fixes and improvements
7+
8+
## v9.1.10 (2020-12-02)
9+
10+
* Fixes a crash caused by the network logger when the object passed is too large
11+
* Adds source map upload script support for environment variables use inside Info.plist
12+
* Fixes a crash when using `getUserAttribute` on an attribute that does not exist
13+
* Fixes a crash when calling `setSdkDebugLogsLevel` on Android
114

215
## v9.1.9 (2020-10-01)
316

InstabugSample/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class App extends Component<{}> {
3838
colorTheme: 'Light',
3939
};
4040

41-
Instabug.startWithToken('068ba9a8c3615035e163dc5f829c73be', [
41+
Instabug.start('068ba9a8c3615035e163dc5f829c73be', [
4242
Instabug.invocationEvent.floatingButton,
4343
]);
4444
}

InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
BAD36E3122F19973007F5E74 /* InstabugRepliesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD36E3022F19973007F5E74 /* InstabugRepliesTests.m */; };
2222
BAD36E3322F19B1B007F5E74 /* InstabugSurveysTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD36E3222F19B1B007F5E74 /* InstabugSurveysTests.m */; };
2323
C006102922E9EBCA00EDC852 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C006102822E9EBCA00EDC852 /* libOCMock.a */; };
24+
C0AB369625854A6100F1E21E /* InstabugAPMTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C0AB369525854A6100F1E21E /* InstabugAPMTests.m */; };
2425
/* End PBXBuildFile section */
2526

2627
/* Begin PBXContainerItemProxy section */
@@ -63,9 +64,9 @@
6364
BAD36E3022F19973007F5E74 /* InstabugRepliesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InstabugRepliesTests.m; sourceTree = "<group>"; };
6465
BAD36E3222F19B1B007F5E74 /* InstabugSurveysTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InstabugSurveysTests.m; sourceTree = "<group>"; };
6566
C006102822E9EBCA00EDC852 /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOCMock.a; path = usr/lib/libOCMock.a; sourceTree = "<group>"; };
67+
C0AB369525854A6100F1E21E /* InstabugAPMTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InstabugAPMTests.m; sourceTree = "<group>"; };
6668
C74E4010ABE7AFC7DB5E79DC /* Pods-InstabugSampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSampleTests/Pods-InstabugSampleTests.debug.xcconfig"; sourceTree = "<group>"; };
6769
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
68-
FA49CB8462F384E9EDD7DDFD /* Instabug.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Instabug.framework; path = "../node_modules/instabug-reactnative/ios/Instabug.framework"; sourceTree = "<group>"; };
6970
/* End PBXFileReference section */
7071

7172
/* Begin PBXFrameworksBuildPhase section */
@@ -101,6 +102,7 @@
101102
BAD36E2E22F19788007F5E74 /* InstabugFeatureRequestsTests.m */,
102103
BAD36E3022F19973007F5E74 /* InstabugRepliesTests.m */,
103104
BAD36E3222F19B1B007F5E74 /* InstabugSurveysTests.m */,
105+
C0AB369525854A6100F1E21E /* InstabugAPMTests.m */,
104106
);
105107
path = InstabugSampleTests;
106108
sourceTree = "<group>";
@@ -410,6 +412,7 @@
410412
BAD36E1E22F0906A007F5E74 /* IBGConstants.m in Sources */,
411413
BAD36E3322F19B1B007F5E74 /* InstabugSurveysTests.m in Sources */,
412414
BAD36E2F22F19788007F5E74 /* InstabugFeatureRequestsTests.m in Sources */,
415+
C0AB369625854A6100F1E21E /* InstabugAPMTests.m in Sources */,
413416
BAD36E1C22F08B27007F5E74 /* InstabugBugReportingTests.m in Sources */,
414417
BAD36E2D22F1955C007F5E74 /* InstabugChatsTests.m in Sources */,
415418
00E356F31AD99517003FC87E /* InstabugSampleTests.m in Sources */,
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
//
2+
// InstabugAPMTests.m
3+
// InstabugSampleTests
4+
//
5+
// Created by Ali Abdelfattah on 12/12/20.
6+
// Copyright © 2020 Facebook. All rights reserved.
7+
//
8+
9+
#import <XCTest/XCTest.h>
10+
#import "OCMock/OCMock.h"
11+
#import "InstabugAPMBridge.h"
12+
#import <Instabug/IBGTypes.h>
13+
#import <Instabug/IBGAPM.h>
14+
#import "Instabug/Instabug.h"
15+
#import "IBGConstants.h"
16+
17+
@interface InstabugAPMTests : XCTestCase
18+
@property (nonatomic, retain) InstabugAPMBridge *instabugBridge;
19+
@end
20+
21+
@protocol APMCPTestProtocol <NSObject>
22+
/**
23+
* This protocol helps in correctly mapping APM mocked methods
24+
* when their method name matches another method in a different
25+
* module that differs in method signature.
26+
*/
27+
- (void)setEnabled:(BOOL)isEnabled;
28+
29+
@end
30+
31+
@protocol ExecutionTraceCPTestProtocol <NSObject>
32+
/**
33+
* This protocol helps in correctly mapping IBGExecutionTrace mocked methods
34+
* when their method name matches another method in a different
35+
* module that differs in method signature.
36+
*/
37+
- (void)end;
38+
@end
39+
40+
@implementation InstabugAPMTests
41+
42+
- (void)setUp {
43+
// Put setup code here. This method is called before the invocation of each test method in the class.
44+
self.instabugBridge = [[InstabugAPMBridge alloc] init];
45+
}
46+
47+
/*
48+
+------------------------------------------------------------------------+
49+
| APM Module |
50+
+------------------------------------------------------------------------+
51+
*/
52+
53+
- (void) testSetAPMEnabled {
54+
id mock = OCMClassMock([IBGAPM class]);
55+
BOOL isEnabled = YES;
56+
57+
OCMStub([mock setEnabled:isEnabled]);
58+
[self.instabugBridge setEnabled:isEnabled];
59+
OCMVerify([mock setEnabled:isEnabled]);
60+
}
61+
62+
- (void) testSetLogLevel {
63+
id mock = OCMClassMock([IBGAPM class]);
64+
BOOL logLevel = IBGLogLevelVerbose;
65+
66+
OCMStub([mock setLogLevel:logLevel]);
67+
[self.instabugBridge setLogLevel:logLevel];
68+
OCMVerify([mock setLogLevel:logLevel]);
69+
}
70+
71+
- (void) testSetAppLaunchEnabled {
72+
id mock = OCMClassMock([IBGAPM class]);
73+
BOOL isEnabled = YES;
74+
75+
OCMStub([mock setAppLaunchEnabled:isEnabled]);
76+
[self.instabugBridge setAppLaunchEnabled:isEnabled];
77+
OCMVerify([mock setAppLaunchEnabled:isEnabled]);
78+
}
79+
80+
- (void) testSetAutoUITraceEnabled {
81+
id mock = OCMClassMock([IBGAPM class]);
82+
BOOL isEnabled = YES;
83+
84+
OCMStub([mock setAutoUITraceEnabled:isEnabled]);
85+
[self.instabugBridge setAutoUITraceEnabled:isEnabled];
86+
OCMVerify([mock setAutoUITraceEnabled:isEnabled]);
87+
}
88+
89+
- (void) testStartExecutionTrace {
90+
id mock = OCMClassMock([IBGAPM class]);
91+
NSString* traceName = @"Trace_1";
92+
NSString* traceKey = @"1";
93+
RCTResponseSenderBlock callback = ^(NSArray *response) {};
94+
95+
OCMStub([mock startExecutionTraceWithName:traceName]);
96+
[self.instabugBridge startExecutionTrace:traceName :traceKey :callback];
97+
OCMVerify([mock startExecutionTraceWithName:traceName]);
98+
}
99+
100+
- (void) testSetExecutionTraceAttribute {
101+
NSString* traceName = @"Trace_1";
102+
NSString* traceId = @"Id_1";
103+
NSString* traceKey = @"Key_1";
104+
NSString* traceValue = @"1";
105+
RCTResponseSenderBlock callback = ^(NSArray *response) {};
106+
IBGExecutionTrace * trace = [IBGExecutionTrace alloc];
107+
id mock = OCMClassMock([IBGAPM class]);
108+
id traceMock = OCMPartialMock(trace);
109+
110+
OCMStub([mock startExecutionTraceWithName:traceName]).andReturn(trace);
111+
[self.instabugBridge startExecutionTrace:traceName :traceId :callback];
112+
113+
OCMStub([traceMock setAttributeWithKey:traceKey value:traceValue]);
114+
[self.instabugBridge setExecutionTraceAttribute:traceId :traceKey :traceValue];
115+
OCMVerify([traceMock setAttributeWithKey:traceKey value:traceValue]);
116+
}
117+
118+
- (void) testEndExecutionTrace {
119+
NSString* traceName = @"Trace_1";
120+
NSString* traceId = @"Id_1";
121+
RCTResponseSenderBlock callback = ^(NSArray *response) {};
122+
IBGExecutionTrace * trace = [IBGExecutionTrace alloc];
123+
id apmMock = OCMClassMock([IBGAPM class]);
124+
id<ExecutionTraceCPTestProtocol> traceMock = OCMPartialMock(trace);
125+
126+
OCMStub([apmMock startExecutionTraceWithName:traceName]).andReturn(trace);
127+
[self.instabugBridge startExecutionTrace:traceName :traceId :callback];
128+
129+
OCMStub([traceMock end]);
130+
[self.instabugBridge endExecutionTrace:traceId];
131+
OCMVerify([traceMock end]);
132+
}
133+
134+
- (void) testStartUITrace {
135+
id mock = OCMClassMock([IBGAPM class]);
136+
NSString* traceName = @"UITrace_1";
137+
138+
OCMStub([mock startUITraceWithName:traceName]);
139+
[self.instabugBridge startUITrace:traceName];
140+
OCMVerify([mock startUITraceWithName:traceName]);
141+
}
142+
143+
- (void) testEndUITrace {
144+
id mock = OCMClassMock([IBGAPM class]);
145+
146+
OCMStub([mock endUITrace]);
147+
[self.instabugBridge endUITrace];
148+
OCMVerify([mock endUITrace]);
149+
}
150+
151+
@end

README.md

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import Instabug from 'instabug-reactnative';
5959
Initialize it in the `constructor` or `componentWillMount`. This line will let the Instabug SDK work with the default behavior. The SDK will be invoked when the device is shaken. You can customize this behavior through the APIs.
6060

6161
```javascript
62-
Instabug.startWithToken('IOS_APP_TOKEN', [Instabug.invocationEvent.shake]);
62+
Instabug.start('IOS_APP_TOKEN', [Instabug.invocationEvent.shake]);
6363
```
6464
* ### Android
6565
1. Open `android/app/src/main/java/[...]/MainApplication.java`
@@ -113,46 +113,6 @@ import Instabug from 'instabug-reactnative';
113113
}
114114
}
115115
```
116-
## Update Guide
117-
### Updating to versions 8.0-8.4.x
118-
119-
When updating to version 8.0 through 8.4.x, you'll need to perform the steps below.
120-
121-
1. Unlink Instabug
122-
```bash
123-
react-native unlink instabug-reactnative
124-
```
125-
126-
2. Install the new version of Instabug
127-
```bash
128-
npm install instabug-reactnative
129-
```
130-
131-
3. Link Instabug
132-
```bash
133-
react-native link instabug-reactnative
134-
```
135-
136-
### Updating to version 8.5
137-
138-
_Only for apps using React Native >= 0.60. If you're using a lower version, you don't need to perform any extra steps when updating._
139-
140-
Version 8.5 adds support for React Native 0.60. To use Instabug 8.5 with React Native 0.60, you'll need to perform the following steps.
141-
142-
1. Unlink Instabug
143-
```bash
144-
react-native unlink instabug-reactnative
145-
```
146-
147-
2. Install the new version of Instabug
148-
```bash
149-
npm install instabug-reactnative
150-
```
151-
152-
3. Add Instabug to your project
153-
```bash
154-
react-native add-instabug
155-
```
156116
157117
## Microphone and Photo Library Usage Description (iOS Only)
158118
@@ -201,9 +161,9 @@ NetworkLogger.setEnabled(false);
201161
202162
Instabug Repro Steps are enabled by default. It captures a screenshot of each screen the user navigates to. These screens are attached to the BugReport when sent.
203163
204-
We support the 2 most popular React Native navigation libraries:
164+
We support the two most popular React Native navigation libraries:
205165
206-
* **react-navigation**
166+
* **[react-navigation](https://github.com/react-navigation/react-navigation)**
207167
208168
* **v5**
209169
set the `onStateChange` to `Instabug.onStateChange` in your NavigationContainer as follows:
@@ -222,9 +182,10 @@ We support the 2 most popular React Native navigation libraries:
222182
onNavigationStateChange={ Instabug.onNavigationStateChange } />
223183
);
224184
```
225-
* **react-native-navigation**
226185
227-
Register `Instabug.componentDidAppearListener` listener using:
186+
* **[react-native-navigation](https://github.com/wix/react-native-navigation)**
187+
188+
Register `Instabug.componentDidAppearListener` listener using:
228189
```javascript
229190
Navigation.events().registerComponentDidAppearListener( Instabug.componentDidAppearListener );
230191
```
@@ -241,9 +202,51 @@ You can disable Repro Steps using the following API:
241202
Instabug.setReproStepsMode(Instabug.reproStepsMode.disabled);
242203
```
243204
205+
## Update Guide
206+
### Updating to versions 8.0-8.4.x
207+
208+
When updating to version 8.0 through 8.4.x, you'll need to perform the steps below.
209+
210+
1. Unlink Instabug
211+
```bash
212+
react-native unlink instabug-reactnative
213+
```
214+
215+
2. Install the new version of Instabug
216+
```bash
217+
npm install instabug-reactnative
218+
```
219+
220+
3. Link Instabug
221+
```bash
222+
react-native link instabug-reactnative
223+
```
224+
225+
### Updating to version 8.5
226+
227+
_Only for apps using React Native >= 0.60. If you're using a lower version, you don't need to perform any extra steps when updating._
228+
229+
Version 8.5 adds support for React Native 0.60. To use Instabug 8.5 with React Native 0.60, you'll need to perform the following steps.
230+
231+
1. Unlink Instabug
232+
```bash
233+
react-native unlink instabug-reactnative
234+
```
235+
236+
2. Install the new version of Instabug
237+
```bash
238+
npm install instabug-reactnative
239+
```
240+
241+
3. Add Instabug to your project
242+
```bash
243+
react-native add-instabug
244+
```
245+
244246
## Features that are not supported yet
245247
246248
- Push Notification Support for In-App Messaging
249+
- [User Steps](https://help.instabug.com/en/articles/2515300-instabug-report-logs-user-steps).
247250
248251
## Documentation
249252

0 commit comments

Comments
 (0)