Skip to content

feat/xcode-16-support #1384

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

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

### Added

- 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
2 changes: 1 addition & 1 deletion RNInstabug.podspec
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
@@ -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
@@ -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"

14 changes: 7 additions & 7 deletions examples/default/ios/InstabugTests/InstabugBugReportingTests.m
Original file line number Diff line number Diff line change
@@ -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
@@ -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) {
@@ -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]);
@@ -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];
}

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"
@@ -19,10 +19,10 @@ - (void)setUp {
}

- (void)testSetEnabled {

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

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

@@ -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];
@@ -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
Original file line number Diff line number Diff line change
@@ -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
@@ -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];
}

12 changes: 6 additions & 6 deletions examples/default/ios/InstabugTests/InstabugRepliesTests.m
Original file line number Diff line number Diff line change
@@ -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
@@ -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];
}

@@ -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]);
@@ -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]);
4 changes: 2 additions & 2 deletions examples/default/ios/InstabugTests/InstabugSampleTests.m
Original file line number Diff line number Diff line change
@@ -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>
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
18 changes: 9 additions & 9 deletions examples/default/ios/InstabugTests/InstabugSurveysTests.m
Original file line number Diff line number Diff line change
@@ -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
@@ -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]);
@@ -54,7 +54,7 @@ - (void)testShowingSurvey {

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

OCMStub([mock showSurveyIfAvailable]);
[self.instabugBridge showSurveysIfAvailable];
OCMVerify([mock showSurveyIfAvailable]);
@@ -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]);
@@ -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);
}
@@ -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]]);
@@ -136,7 +136,7 @@ - (void) testSetDidDismissSurveyHandler {

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

[self.instabugBridge setAppStoreURL:appStoreURL];
XCTAssertEqual(IBGSurveys.appStoreURL, appStoreURL);
}
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"
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)
3 changes: 3 additions & 0 deletions examples/default/ios/Podfile
Original file line number Diff line number Diff line change
@@ -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()

Loading