Skip to content

feat/xcode-16-support #1384

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 16 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Changelog

## [Unreleased]
## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...dev)

### Added

- Add support for BugReporting user consents. ([#1383](https://github.com/Instabug/Instabug-React-Native/pull/1383))

- Add support for xCode 16. ([#1370](https://github.com/Instabug/Instabug-React-Native/pull/1370))

## [14.3.0](https://github.com/Instabug/Instabug-React-Native/compare/v14.1.0...14.3.0)

### Added
Expand Down
2 changes: 1 addition & 1 deletion RNInstabug.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.homepage = package["homepage"]
s.source = { :git => "https://github.com/Instabug/Instabug-React-Native.git", :tag => 'v' + package["version"] }

s.platform = :ios, "9.0"
s.platform = :ios, "13.0"
s.source_files = "ios/**/*.{h,m,mm}"

s.dependency 'React-Core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,18 +663,18 @@ public void testW3CCaughtHeaderFlag(){
verify(promise).resolve(expected);
}


@Test
public void testSetNetworkLogBodyEnabled() {
rnModule.setNetworkLogBodyEnabled(true);

mockInstabug.verify(() -> Instabug.setNetworkLogBodyEnabled(true));
}

@Test
public void testSetNetworkLogBodyDisabled() {
rnModule.setNetworkLogBodyEnabled(false);

mockInstabug.verify(() -> Instabug.setNetworkLogBodyEnabled(false));
}
}
6 changes: 3 additions & 3 deletions examples/default/ios/InstabugTests/InstabugAPMTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugAPMBridge.h"
#import <Instabug/IBGTypes.h>
#import <Instabug/IBGAPM.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import <InstabugSDK/IBGAPM.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"
#import "RNInstabug/IBGAPM+PrivateAPIs.h"

Expand Down
14 changes: 7 additions & 7 deletions examples/default/ios/InstabugTests/InstabugBugReportingTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugBugReportingBridge.h"
#import <Instabug/IBGTypes.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"

@interface InstabugBugReportingTests : XCTestCase
Expand Down Expand Up @@ -39,7 +39,7 @@ - (void) testgivenBoolean$setBugReportingEnabled_whenQuery_thenShouldCallNativeA
- (void) testgivenInvocationEvent$setInvocationEvents_whenQuery_thenShouldCallNativeApiWithArgs {
NSArray *invocationEventsArr;
invocationEventsArr = [NSArray arrayWithObjects: @(IBGInvocationEventScreenshot), nil];

[self.instabugBridge setInvocationEvents:invocationEventsArr];
IBGInvocationEvent invocationEvents = 0;
for (NSNumber *boxedValue in invocationEventsArr) {
Expand Down Expand Up @@ -76,7 +76,7 @@ - (void) testgivenHandlerSUBMIT$setOnSDKDismissedHandler_whenQuery_thenShouldCal
RCTResponseSenderBlock callback = ^(NSArray *response) {};
[partialMock setOnSDKDismissedHandler:callback];
XCTAssertNotNil(IBGBugReporting.didDismissHandler);

NSDictionary *result = @{ @"dismissType": @"SUBMIT",
@"reportType": @"feedback"};
OCMStub([partialMock sendEventWithName:@"IBGpostInvocationHandler" body:result]);
Expand Down Expand Up @@ -137,14 +137,14 @@ - (void) testgivenArgs$showBugReportingWithReportTypeAndOptions_whenQuery_thenSh
}
OCMStub([mock showWithReportType:reportType options:parsedOptions]);
[self.instabugBridge show:reportType options:options];

XCTestExpectation *expectation = [self expectationWithDescription:@"Test ME PLX"];

[[NSRunLoop mainRunLoop] performBlock:^{
OCMVerify([mock showWithReportType:reportType options:parsedOptions]);
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:EXPECTATION_TIMEOUT handler:nil];
}

Expand Down
12 changes: 6 additions & 6 deletions examples/default/ios/InstabugTests/InstabugCrashReportingTests.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import <XCTest/XCTest.h>
#import "Instabug/Instabug.h"
#import "InstabugSDK/InstabugSDK.h"
#import "InstabugCrashReportingBridge.h"
#import "OCMock/OCMock.h"
#import "Util/IBGCrashReporting+CP.h"
Expand All @@ -19,10 +19,10 @@ - (void)setUp {
}

- (void)testSetEnabled {

[self.bridge setEnabled:NO];
XCTAssertFalse(IBGCrashReporting.enabled);

[self.bridge setEnabled:YES];
XCTAssertTrue(IBGCrashReporting.enabled);

Expand All @@ -37,7 +37,7 @@ - (void)testSendJSCrash {
[expectation fulfill];
};
RCTPromiseRejectBlock reject = ^(NSString *code, NSString *message, NSError *error) {};

[self.bridge sendJSCrash:stackTrace resolver:resolve rejecter:reject];

[self waitForExpectations:@[expectation] timeout:1];
Expand All @@ -52,9 +52,9 @@ - (void)testSendNonFatalErrorJsonCrash {
NSDictionary *userAttributes = @{ @"key" : @"value", };
IBGNonFatalLevel ibgNonFatalLevel = IBGNonFatalLevelInfo;


[self.bridge sendHandledJSCrash:jsonCrash userAttributes:userAttributes fingerprint:fingerPrint nonFatalExceptionLevel:ibgNonFatalLevel resolver:resolve rejecter:reject];

OCMVerify([self.mCrashReporting cp_reportNonFatalCrashWithStackTrace:jsonCrash
level:IBGNonFatalLevelInfo
groupingString:fingerPrint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugFeatureRequestsBridge.h"
#import <Instabug/IBGTypes.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"

@interface InstabugFeatureRequestsTests : XCTestCase
Expand Down Expand Up @@ -48,12 +48,12 @@ - (void) testgive$show_whenQuery_thenShouldCallNativeApi {
OCMStub([mock show]);
[self.instabugBridge show];
XCTestExpectation *expectation = [self expectationWithDescription:@"Test ME PLX"];

[[NSRunLoop mainRunLoop] performBlock:^{
OCMVerify([mock show]);
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:EXPECTATION_TIMEOUT handler:nil];
}

Expand Down
12 changes: 6 additions & 6 deletions examples/default/ios/InstabugTests/InstabugRepliesTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugRepliesBridge.h"
#import <Instabug/IBGTypes.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"

@interface InstabugRepliesTests : XCTestCase
Expand Down Expand Up @@ -53,12 +53,12 @@ - (void) testgiven$show_whenQuery_thenShouldCallNativeApi {
OCMStub([mock show]);
[self.instabugBridge show];
XCTestExpectation *expectation = [self expectationWithDescription:@"Test ME PLX"];

[[NSRunLoop mainRunLoop] performBlock:^{
OCMVerify([mock show]);
[expectation fulfill];
}];

[self waitForExpectationsWithTimeout:EXPECTATION_TIMEOUT handler:nil];
}

Expand All @@ -67,7 +67,7 @@ - (void) testgivenOnNewReplyReceivedHandler$setOnNewReplyReceivedCallback_whenQu
RCTResponseSenderBlock callback = ^(NSArray *response) {};
[partialMock setOnNewReplyReceivedHandler:callback];
XCTAssertNotNil(IBGReplies.didReceiveReplyHandler);

OCMStub([partialMock sendEventWithName:@"IBGOnNewReplyReceivedCallback" body:nil]);
IBGReplies.didReceiveReplyHandler();
OCMVerify([partialMock sendEventWithName:@"IBGOnNewReplyReceivedCallback" body:nil]);
Expand All @@ -90,7 +90,7 @@ - (void) testgivenBoolean$setInAppNotificationEnabled_whenQuery_thenShouldCallNa
- (void)testSetPushNotificationsEnabled {
id mock = OCMClassMock([IBGReplies class]);
BOOL isPushNotificationEnabled = true;

OCMStub([mock setPushNotificationsEnabled:isPushNotificationEnabled]);
[self.instabugBridge setPushNotificationsEnabled:isPushNotificationEnabled];
OCMVerify([mock setPushNotificationsEnabled:isPushNotificationEnabled]);
Expand Down
4 changes: 2 additions & 2 deletions examples/default/ios/InstabugTests/InstabugSampleTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "Instabug/Instabug.h"
#import "InstabugSDK/InstabugSDK.h"
#import "InstabugReactBridge.h"
#import <Instabug/IBGTypes.h>
#import <InstabugSDK/IBGTypes.h>
#import "IBGConstants.h"
#import "RNInstabug.h"
#import <RNInstabug/IBGNetworkLogger+CP.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugSessionReplayBridge.h"
#import <Instabug/IBGTypes.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"

@interface InstabugSessionReplayTests : XCTestCase
Expand Down
18 changes: 9 additions & 9 deletions examples/default/ios/InstabugTests/InstabugSurveysTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "InstabugSurveysBridge.h"
#import <Instabug/IBGTypes.h>
#import "Instabug/Instabug.h"
#import <InstabugSDK/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import "IBGConstants.h"

@interface InstabugSurveysTests : XCTestCase
Expand Down Expand Up @@ -45,7 +45,7 @@ - (void)setUp {
- (void)testShowingSurvey {
id mock = OCMClassMock([IBGSurveys class]);
NSString *token = @"token";

OCMStub([mock showSurveyWithToken:token]);
[self.instabugBridge showSurvey:token];
OCMVerify([mock showSurveyWithToken:token]);
Expand All @@ -54,7 +54,7 @@ - (void)testShowingSurvey {

- (void) testShowSurveyIfAvailable {
id mock = OCMClassMock([IBGSurveys class]);

OCMStub([mock showSurveyIfAvailable]);
[self.instabugBridge showSurveysIfAvailable];
OCMVerify([mock showSurveyIfAvailable]);
Expand All @@ -63,7 +63,7 @@ - (void) testShowSurveyIfAvailable {
- (void) testAutoShowingSurveysEnabled {
id mock = OCMClassMock([IBGSurveys class]);
BOOL isEnabled = YES;

OCMStub([mock setAutoShowingEnabled:isEnabled]);
[self.instabugBridge setAutoShowingEnabled:isEnabled];
OCMVerify([mock setAutoShowingEnabled:isEnabled]);
Expand All @@ -72,15 +72,15 @@ - (void) testAutoShowingSurveysEnabled {
- (void) testSetShouldShowSurveysWelcomeScreen {
id mock = OCMClassMock([IBGSurveys class]);
BOOL isEnabled = YES;

OCMStub([mock setShouldShowWelcomeScreen:isEnabled]);
[self.instabugBridge setShouldShowWelcomeScreen:isEnabled];
OCMVerify([mock setShouldShowWelcomeScreen:isEnabled]);
}

- (void) testSetSurveysEnabled {
BOOL isEnabled = YES;

[self.instabugBridge setEnabled:isEnabled];
XCTAssertTrue(IBGSurveys.enabled);
}
Expand All @@ -95,7 +95,7 @@ - (void) testHasRespondedToSurveyWithToken {
[expectation fulfill];
};
RCTPromiseRejectBlock reject = ^(NSString *code, NSString *message, NSError *error) {};

OCMStub([mock hasRespondedToSurveyWithToken:surveyToken completionHandler:[OCMArg invokeBlock]]);
[self.instabugBridge hasRespondedToSurvey:surveyToken :resolve :reject];
OCMVerify([mock hasRespondedToSurveyWithToken:surveyToken completionHandler:[OCMArg isNotNil]]);
Expand Down Expand Up @@ -136,7 +136,7 @@ - (void) testSetDidDismissSurveyHandler {

- (void) testSetAppStoreURL {
NSString *appStoreURL = @"http://test";

[self.instabugBridge setAppStoreURL:appStoreURL];
XCTAssertEqual(IBGSurveys.appStoreURL, appStoreURL);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/default/ios/InstabugTests/RNInstabugTests.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <XCTest/XCTest.h>
#import "OCMock/OCMock.h"
#import "Instabug/Instabug.h"
#import <Instabug/IBGTypes.h>
#import "InstabugSDK/InstabugSDK.h"
#import <InstabugSDK/IBGTypes.h>
#import "RNInstabug.h"
#import "RNInstabug/Instabug+CP.h"
#import "RNInstabug/IBGNetworkLogger+CP.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import <Instabug/Instabug.h>
#import <InstabugSDK/InstabugSDK.h>


@interface IBGCrashReporting (CP)
Expand Down
3 changes: 3 additions & 0 deletions examples/default/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ target 'InstabugExample' do
config = use_native_modules!
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
# add this line
pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/fix-main-thread-warning/15.0.0/Instabug.podspec'

# Flags change depending on the env values.
flags = get_default_flags()

Expand Down
Loading