From 54cba9bc3575dd921aaac861aeb42cddd6644bdd Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 7 Jul 2025 13:23:56 +0300 Subject: [PATCH 01/62] feat: Support Advanced UI customization --- .../RNInstabugReactnativeModule.java | 204 ++++++++++++++++++ .../RNInstabugReactnativeModuleTest.java | 71 ++++++ .../ios/InstabugTests/InstabugSampleTests.m | 67 ++++++ examples/default/react-native.config.js | 3 + ios/RNInstabug/InstabugReactBridge.h | 2 + ios/RNInstabug/InstabugReactBridge.m | 161 ++++++++++++++ src/index.ts | 10 +- src/models/ThemeConfig.ts | 34 +++ src/modules/Instabug.ts | 48 +++++ src/native/NativeInstabug.ts | 6 +- 10 files changed, 604 insertions(+), 2 deletions(-) create mode 100644 examples/default/react-native.config.js create mode 100644 src/models/ThemeConfig.ts diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 17f48656f..7147b856c 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -6,10 +6,14 @@ import android.app.Application; import android.graphics.Bitmap; +import android.graphics.Color; +import android.graphics.Typeface; import android.net.Uri; import android.util.Log; import android.view.View; +import com.facebook.react.bridge.ReactApplicationContext; + import androidx.annotation.NonNull; import androidx.annotation.UiThread; @@ -45,6 +49,7 @@ import com.instabug.library.internal.module.InstabugLocale; import com.instabug.library.invocation.InstabugInvocationEvent; import com.instabug.library.logging.InstabugLog; +import com.instabug.library.model.IBGTheme; import com.instabug.library.model.NetworkLog; import com.instabug.library.model.Report; import com.instabug.library.ui.onboarding.WelcomeMessage; @@ -1351,4 +1356,203 @@ public void run() { } }); } + /** + * Sets the theme for Instabug using a configuration object. + * + * @param themeConfig A ReadableMap containing theme properties such as colors, fonts, and text styles. + */ + @ReactMethod + public void setTheme(final ReadableMap themeConfig) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + com.instabug.library.model.IBGTheme.Builder builder = new com.instabug.library.model.IBGTheme.Builder(); + + if (themeConfig.hasKey("primaryColor")) { + builder.setPrimaryColor(getColor(themeConfig, "primaryColor")); + } + if (themeConfig.hasKey("secondaryTextColor")) { + builder.setSecondaryTextColor(getColor(themeConfig, "secondaryTextColor")); + } + if (themeConfig.hasKey("primaryTextColor")) { + builder.setPrimaryTextColor(getColor(themeConfig, "primaryTextColor")); + } + if (themeConfig.hasKey("titleTextColor")) { + builder.setTitleTextColor(getColor(themeConfig, "titleTextColor")); + } + if (themeConfig.hasKey("backgroundColor")) { + builder.setBackgroundColor(getColor(themeConfig, "backgroundColor")); + } + + if (themeConfig.hasKey("primaryTextStyle")) { + builder.setPrimaryTextStyle(getTextStyle(themeConfig, "primaryTextStyle")); + } + if (themeConfig.hasKey("secondaryTextStyle")) { + builder.setSecondaryTextStyle(getTextStyle(themeConfig, "secondaryTextStyle")); + } + if (themeConfig.hasKey("ctaTextStyle")) { + builder.setCtaTextStyle(getTextStyle(themeConfig, "ctaTextStyle")); + } + if (themeConfig.hasKey("primaryFontPath") || themeConfig.hasKey("primaryFontAsset")) { + Typeface primaryTypeface = getTypeface(themeConfig, "primaryFontPath", "primaryFontAsset"); + if (primaryTypeface != null) { + builder.setPrimaryTextFont(primaryTypeface); + } else { + Log.e("InstabugModule", "Failed to load primary font"); + } + } + + if (themeConfig.hasKey("secondaryFontPath") || themeConfig.hasKey("secondaryFontAsset")) { + Typeface secondaryTypeface = getTypeface(themeConfig, "secondaryFontPath", "secondaryFontAsset"); + if (secondaryTypeface != null) { + builder.setSecondaryTextFont(secondaryTypeface); + } else { + Log.e("InstabugModule", "Failed to load secondary font"); + } + } + + if (themeConfig.hasKey("ctaFontPath") || themeConfig.hasKey("ctaFontAsset")) { + Typeface ctaTypeface = getTypeface(themeConfig, "ctaFontPath", "ctaFontAsset"); + if (ctaTypeface != null) { + builder.setCtaTextFont(ctaTypeface); + } else { + Log.e("InstabugModule", "Failed to load CTA font"); + } + } + + IBGTheme theme = builder.build(); + Instabug.setTheme(theme); + + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + /** + * Retrieves a color value from the ReadableMap. + * + * @param map The ReadableMap object. + * @param key The key to look for. + * @return The parsed color as an integer, or black if missing or invalid. + */ + private int getColor(ReadableMap map, String key) { + try { + if (map != null && map.hasKey(key) && !map.isNull(key)) { + String colorString = map.getString(key); + return Color.parseColor(colorString); + } + } catch (Exception e) { + e.printStackTrace(); + } + return Color.BLACK; + } + + /** + * Retrieves a text style from the ReadableMap. + * + * @param map The ReadableMap object. + * @param key The key to look for. + * @return The corresponding Typeface style, or Typeface.NORMAL if missing or invalid. + */ + private int getTextStyle(ReadableMap map, String key) { + try { + if (map != null && map.hasKey(key) && !map.isNull(key)) { + String style = map.getString(key); + switch (style.toLowerCase()) { + case "bold": + return Typeface.BOLD; + case "italic": + return Typeface.ITALIC; + case "bold_italic": + return Typeface.BOLD_ITALIC; + case "normal": + default: + return Typeface.NORMAL; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return Typeface.NORMAL; + } + +private Typeface getTypeface(ReadableMap map, String fileKey, String assetKey) { + try { + if (fileKey != null && map.hasKey(fileKey) && !map.isNull(fileKey)) { + String fontPath = map.getString(fileKey); + String fileName = getFileName(fontPath); + + try { + Typeface typeface = Typeface.create(fileName, Typeface.NORMAL); + if (typeface != null && !typeface.equals(Typeface.DEFAULT)) { + return typeface; + } + } catch (Exception e) { + e.printStackTrace(); + } + + try { + Typeface typeface = Typeface.createFromAsset(getReactApplicationContext().getAssets(), "fonts/" + fileName); + return typeface; + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (assetKey != null && map.hasKey(assetKey) && !map.isNull(assetKey)) { + String assetPath = map.getString(assetKey); + String fileName = getFileName(assetPath); + try { + Typeface typeface = Typeface.createFromAsset(getReactApplicationContext().getAssets(), "fonts/" + fileName); + return typeface; + } catch (Exception e) { + e.printStackTrace(); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + return Typeface.DEFAULT; +} + +/** + * Extracts the filename from a path, removing any directory prefixes. + * + * @param path The full path to the file + * @return Just the filename with extension + */ +private String getFileName(String path) { + if (path == null || path.isEmpty()) { + return path; + } + + int lastSeparator = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\')); + if (lastSeparator >= 0 && lastSeparator < path.length() - 1) { + return path.substring(lastSeparator + 1); + } + + return path; +} + + /** + * Enables or disables displaying in full-screen mode, hiding the status and navigation bars. + * @param isEnabled A boolean to enable/disable setFullscreen. + */ + @ReactMethod + public void setFullscreen(final boolean isEnabled) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + Instabug.setFullscreen(isEnabled); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } } diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java index f4f6f9bc1..072e33e7a 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java @@ -704,4 +704,75 @@ public void testGetNetworkBodyMaxSize_resolvesPromiseWithExpectedValue() { verify(promise).resolve(expected); } + @Test + public void testEnablSetFullScreen() { + boolean isEnabled = true; + + // when + rnModule.setFullscreen(isEnabled); + + // then + verify(Instabug.class, times(1)); + Instabug.setFullscreen(isEnabled); + } + + @Test + public void testDisableSetFullScreen() { + // given + boolean isEnabled = false; + + // when + rnModule.setFullscreen(isEnabled); + + // then + verify(Instabug.class, times(1)); + Instabug.setFullscreen(isEnabled); + } + + @Test + public void testSetTheme() { + // given + JavaOnlyMap themeConfig = new JavaOnlyMap(); + themeConfig.putString("primaryColor", "#FF0000"); + themeConfig.putString("primaryTextColor", "#00FF00"); + themeConfig.putString("secondaryTextColor", "#0000FF"); + themeConfig.putString("titleTextColor", "#FFFF00"); + themeConfig.putString("backgroundColor", "#FF00FF"); + themeConfig.putString("primaryTextStyle", "bold"); + themeConfig.putString("secondaryTextStyle", "italic"); + themeConfig.putString("ctaTextStyle", "bold"); + themeConfig.putString("primaryFontPath", "TestFont.ttf"); + themeConfig.putString("secondaryFontPath", "fonts/AnotherFont.ttf"); + themeConfig.putString("ctaFontPath", "./assets/fonts/CTAFont.ttf"); + + // Mock IBGTheme.Builder + com.instabug.library.model.IBGTheme.Builder mockBuilder = mock(com.instabug.library.model.IBGTheme.Builder.class); + com.instabug.library.model.IBGTheme mockTheme = mock(com.instabug.library.model.IBGTheme.class); + + try (MockedConstruction mockedBuilder = mockConstruction( + com.instabug.library.model.IBGTheme.Builder.class, + (mock, context) -> { + when(mock.setPrimaryColor(anyInt())).thenReturn(mock); + when(mock.setPrimaryTextColor(anyInt())).thenReturn(mock); + when(mock.setSecondaryTextColor(anyInt())).thenReturn(mock); + when(mock.setTitleTextColor(anyInt())).thenReturn(mock); + when(mock.setBackgroundColor(anyInt())).thenReturn(mock); + when(mock.setPrimaryTextStyle(anyInt())).thenReturn(mock); + when(mock.setSecondaryTextStyle(anyInt())).thenReturn(mock); + when(mock.setCtaTextStyle(anyInt())).thenReturn(mock); + when(mock.setPrimaryTextFont(any())).thenReturn(mock); + when(mock.setSecondaryTextFont(any())).thenReturn(mock); + when(mock.setCtaTextFont(any())).thenReturn(mock); + when(mock.build()).thenReturn(mockTheme); + })) { + + // when + rnModule.setTheme(themeConfig); + + // then + verify(Instabug.class, times(1)); + Instabug.setTheme(mockTheme); + } + } + } diff --git a/examples/default/ios/InstabugTests/InstabugSampleTests.m b/examples/default/ios/InstabugTests/InstabugSampleTests.m index ded37c3af..5591a0287 100644 --- a/examples/default/ios/InstabugTests/InstabugSampleTests.m +++ b/examples/default/ios/InstabugTests/InstabugSampleTests.m @@ -651,6 +651,73 @@ - (void)testGetNetworkBodyMaxSize { OCMVerify(ClassMethod([mock getNetworkBodyMaxSize])); } +- (void)testSetTheme { + id mock = OCMClassMock([Instabug class]); + id mockTheme = OCMClassMock([IBGTheme class]); + + // Create theme configuration dictionary + NSDictionary *themeConfig = @{ + @"primaryColor": @"#FF0000", + @"backgroundColor": @"#00FF00", + @"titleTextColor": @"#0000FF", + @"subtitleTextColor": @"#FFFF00", + @"primaryTextColor": @"#FF00FF", + @"secondaryTextColor": @"#00FFFF", + @"callToActionTextColor": @"#800080", + @"headerBackgroundColor": @"#808080", + @"footerBackgroundColor": @"#C0C0C0", + @"rowBackgroundColor": @"#FFFFFF", + @"selectedRowBackgroundColor": @"#E6E6FA", + @"rowSeparatorColor": @"#D3D3D3", + @"primaryFontPath": @"TestFont.ttf", + @"secondaryFontPath": @"fonts/AnotherFont.ttf", + @"ctaFontPath": @"./assets/fonts/CTAFont.ttf" + }; + + // Mock IBGTheme creation and configuration + OCMStub([mockTheme primaryColor]).andReturn([UIColor redColor]); + OCMStub([mockTheme backgroundColor]).andReturn([UIColor greenColor]); + OCMStub([mockTheme titleTextColor]).andReturn([UIColor blueColor]); + OCMStub([mockTheme subtitleTextColor]).andReturn([UIColor yellowColor]); + OCMStub([mockTheme primaryTextColor]).andReturn([UIColor magentaColor]); + OCMStub([mockTheme secondaryTextColor]).andReturn([UIColor cyanColor]); + OCMStub([mockTheme callToActionTextColor]).andReturn([UIColor purpleColor]); + OCMStub([mockTheme headerBackgroundColor]).andReturn([UIColor grayColor]); + OCMStub([mockTheme footerBackgroundColor]).andReturn([UIColor lightGrayColor]); + OCMStub([mockTheme rowBackgroundColor]).andReturn([UIColor whiteColor]); + OCMStub([mockTheme selectedRowBackgroundColor]).andReturn([UIColor redColor]); + OCMStub([mockTheme rowSeparatorColor]).andReturn([UIColor lightGrayColor]); + OCMStub([mockTheme primaryTextFont]).andReturn([UIFont systemFontOfSize:17.0]); + OCMStub([mockTheme secondaryTextFont]).andReturn([UIFont systemFontOfSize:17.0]); + OCMStub([mockTheme callToActionTextFont]).andReturn([UIFont systemFontOfSize:17.0]); + + // Mock theme property setting + OCMStub([mockTheme setPrimaryColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setBackgroundColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setTitleTextColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setSubtitleTextColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setPrimaryTextColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setSecondaryTextColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setCallToActionTextColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setHeaderBackgroundColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setFooterBackgroundColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setRowBackgroundColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setSelectedRowBackgroundColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setRowSeparatorColor:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setPrimaryTextFont:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setSecondaryTextFont:[OCMArg any]]).andReturn(mockTheme); + OCMStub([mockTheme setCallToActionTextFont:[OCMArg any]]).andReturn(mockTheme); + + // Mock Instabug.theme property + OCMStub([mock theme]).andReturn(mockTheme); + OCMStub([mock setTheme:[OCMArg any]]); + + // Call the method + [self.instabugBridge setTheme:themeConfig]; + + // Verify that setTheme was called + OCMVerify([mock setTheme:[OCMArg any]]); +} @end diff --git a/examples/default/react-native.config.js b/examples/default/react-native.config.js new file mode 100644 index 000000000..cbdf34c94 --- /dev/null +++ b/examples/default/react-native.config.js @@ -0,0 +1,3 @@ +module.exports = { + assets: ['./assets/fonts/'], +}; diff --git a/ios/RNInstabug/InstabugReactBridge.h b/ios/RNInstabug/InstabugReactBridge.h index 1fe5505d3..c12b59b1e 100644 --- a/ios/RNInstabug/InstabugReactBridge.h +++ b/ios/RNInstabug/InstabugReactBridge.h @@ -42,6 +42,8 @@ - (void)setPrimaryColor:(UIColor *)color; +- (void)setTheme:(NSDictionary *)themeConfig; + - (void)appendTags:(NSArray *)tags; - (void)resetTags; diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index a48851ba8..a7efd17ba 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -173,6 +173,167 @@ - (dispatch_queue_t)methodQueue { Instabug.tintColor = color; } +RCT_EXPORT_METHOD(setTheme:(NSDictionary *)themeConfig) { + IBGTheme *theme = [[IBGTheme alloc] init]; + + if (themeConfig[@"primaryColor"]) { + NSString *colorString = themeConfig[@"primaryColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.primaryColor = color; + } + } + + if (themeConfig[@"backgroundColor"]) { + NSString *colorString = themeConfig[@"backgroundColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.backgroundColor = color; + } + } + + if (themeConfig[@"titleTextColor"]) { + NSString *colorString = themeConfig[@"titleTextColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.titleTextColor = color; + } + } + + if (themeConfig[@"subtitleTextColor"]) { + NSString *colorString = themeConfig[@"subtitleTextColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.subtitleTextColor = color; + } + } + + if (themeConfig[@"primaryTextColor"]) { + NSString *colorString = themeConfig[@"primaryTextColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.primaryTextColor = color; + } + } + + if (themeConfig[@"secondaryTextColor"]) { + NSString *colorString = themeConfig[@"secondaryTextColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.secondaryTextColor = color; + } + } + + if (themeConfig[@"callToActionTextColor"]) { + NSString *colorString = themeConfig[@"callToActionTextColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.callToActionTextColor = color; + } + } + + if (themeConfig[@"headerBackgroundColor"]) { + NSString *colorString = themeConfig[@"headerBackgroundColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.headerBackgroundColor = color; + } + } + + if (themeConfig[@"footerBackgroundColor"]) { + NSString *colorString = themeConfig[@"footerBackgroundColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.footerBackgroundColor = color; + } + } + + if (themeConfig[@"rowBackgroundColor"]) { + NSString *colorString = themeConfig[@"rowBackgroundColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.rowBackgroundColor = color; + } + } + + if (themeConfig[@"selectedRowBackgroundColor"]) { + NSString *colorString = themeConfig[@"selectedRowBackgroundColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.selectedRowBackgroundColor = color; + } + } + + if (themeConfig[@"rowSeparatorColor"]) { + NSString *colorString = themeConfig[@"rowSeparatorColor"]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + theme.rowSeparatorColor = color; + } + } + + // Set fonts + if (themeConfig[@"primaryFontPath"]) { + NSString *fontName = themeConfig[@"primaryFontPath"]; + NSString *fileName = [fontName lastPathComponent]; + NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; + UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; + if (font) { + theme.primaryTextFont = font; + } + } + + if (themeConfig[@"secondaryFontPath"]) { + NSString *fontName = themeConfig[@"secondaryFontPath"]; + NSString *fileName = [fontName lastPathComponent]; + NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; + UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; + if (font) { + theme.secondaryTextFont = font; + } + } + + if (themeConfig[@"ctaFontPath"]) { + NSString *fontName = themeConfig[@"ctaFontPath"]; + NSString *fileName = [fontName lastPathComponent]; + NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; + UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; + if (font) { + theme.callToActionTextFont = font; + } + } + + Instabug.theme = theme; +} + +- (UIColor *)colorFromHexString:(NSString *)hexString { + NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""]; + + if (cleanString.length == 6) { + unsigned int rgbValue = 0; + NSScanner *scanner = [NSScanner scannerWithString:cleanString]; + [scanner scanHexInt:&rgbValue]; + + return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0 + green:((rgbValue & 0xFF00) >> 8) / 255.0 + blue:(rgbValue & 0xFF) / 255.0 + alpha:1.0]; + } else if (cleanString.length == 8) { + unsigned int rgbaValue = 0; + NSScanner *scanner = [NSScanner scannerWithString:cleanString]; + [scanner scanHexInt:&rgbaValue]; + + return [UIColor colorWithRed:((rgbaValue & 0xFF000000) >> 24) / 255.0 + green:((rgbaValue & 0xFF0000) >> 16) / 255.0 + blue:((rgbaValue & 0xFF00) >> 8) / 255.0 + alpha:(rgbaValue & 0xFF) / 255.0]; + } + + return [UIColor blackColor]; +} + + + RCT_EXPORT_METHOD(appendTags:(NSArray *)tags) { [Instabug appendTags:tags]; } diff --git a/src/index.ts b/src/index.ts index 6e7de0284..82628c48b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import type { InstabugConfig } from './models/InstabugConfig'; import Report from './models/Report'; import Trace from './models/Trace'; +import type { ThemeConfig } from './models/ThemeConfig'; // Modules import * as APM from './modules/APM'; import * as BugReporting from './modules/BugReporting'; @@ -29,6 +30,13 @@ export { Replies, Surveys, }; -export type { InstabugConfig, Survey, NetworkData, NetworkDataObfuscationHandler, SessionMetadata }; +export type { + InstabugConfig, + Survey, + NetworkData, + NetworkDataObfuscationHandler, + SessionMetadata, + ThemeConfig, +}; export default Instabug; diff --git a/src/models/ThemeConfig.ts b/src/models/ThemeConfig.ts new file mode 100644 index 000000000..fb90347c9 --- /dev/null +++ b/src/models/ThemeConfig.ts @@ -0,0 +1,34 @@ +export type ThemeConfig = { + // Colors + primaryColor?: string; + backgroundColor?: string; + titleTextColor?: string; + subtitleTextColor?: string; + primaryTextColor?: string; + secondaryTextColor?: string; + callToActionTextColor?: string; + headerBackgroundColor?: string; + footerBackgroundColor?: string; + rowBackgroundColor?: string; + selectedRowBackgroundColor?: string; + rowSeparatorColor?: string; + + // Text Styles (Android only) + primaryTextStyle?: 'bold' | 'italic' | 'normal'; + secondaryTextStyle?: 'bold' | 'italic' | 'normal'; + titleTextStyle?: 'bold' | 'italic' | 'normal'; + ctaTextStyle?: 'bold' | 'italic' | 'normal'; + + // Fonts + primaryFontPath?: string; + primaryFontAsset?: string; + secondaryFontPath?: string; + secondaryFontAsset?: string; + ctaFontPath?: string; + ctaFontAsset?: string; + + // Legacy properties (deprecated) + primaryTextType?: string; + secondaryTextType?: string; + ctaTextType?: string; +}; diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts index f7d582e70..f5943e348 100644 --- a/src/modules/Instabug.ts +++ b/src/modules/Instabug.ts @@ -42,6 +42,7 @@ import { NativeNetworkLogger } from '../native/NativeNetworkLogger'; import InstabugConstants from '../utils/InstabugConstants'; import { InstabugRNConfig } from '../utils/config'; import { Logger } from '../utils/logger'; +import type { ThemeConfig } from '../models/ThemeConfig'; let _currentScreen: string | null = null; let _lastScreen: string | null = null; @@ -895,3 +896,50 @@ export const _registerFeatureFlagsChangeListener = ( export const enableAutoMasking = (autoMaskingTypes: AutoMaskingType[]) => { NativeInstabug.enableAutoMasking(autoMaskingTypes); }; + +/** + * Sets a custom theme for Instabug UI elements. + * + * This method provides comprehensive theming support. It will automatically use IBGTheme + * if available in the SDK version, otherwise falls back to individual theming methods. + * + * @param theme - Configuration object containing theme properties + * + * @example + * ```typescript + * // Basic usage with primary color (always supported) + * Instabug.setTheme({ + * primaryColor: '#FF6B6B' + * }); + * + * // Comprehensive theming (uses IBGTheme when available) + * Instabug.setTheme({ + * primaryColor: '#FF6B6B', + * secondaryTextColor: '#666666', + * primaryTextColor: '#333333', + * titleTextColor: '#000000', + * backgroundColor: '#FFFFFF', + * primaryTextStyle: 'bold', + * secondaryTextStyle: 'normal', + * titleTextStyle: 'bold', + * ctaTextStyle: 'bold', + * primaryFontPath: '/data/user/0/com.yourapp/files/fonts/YourFont.ttf', + * secondaryFontPath: '/data/user/0/com.yourapp/files/fonts/YourFont.ttf', + * ctaTextType: '/data/user/0/com.yourapp/files/fonts/YourFont.ttf', + * primaryFontAsset: 'fonts/YourFont.ttf', + * secondaryFontAsset: 'fonts/YourFont.ttf' + * }); + * ``` + */ +export const setTheme = (theme: ThemeConfig) => { + NativeInstabug.setTheme(theme); +}; +/** + * Enables or disables displaying in full-screen mode, hiding the status and navigation bars. + * @param isEnabled A boolean to enable/disable setFullscreen. + */ +export const setFullscreen = (isEnabled: boolean) => { + if (Platform.OS === 'android') { + NativeInstabug.setFullscreen(isEnabled); + } +}; diff --git a/src/native/NativeInstabug.ts b/src/native/NativeInstabug.ts index 7032bbc07..70c6ae42c 100644 --- a/src/native/NativeInstabug.ts +++ b/src/native/NativeInstabug.ts @@ -14,6 +14,7 @@ import type { import type { NativeConstants } from './NativeConstants'; import type { W3cExternalTraceAttributes } from '../models/W3cExternalTraceAttributes'; import { NativeModules } from './NativePackage'; +import type { ThemeConfig } from '../models/ThemeConfig'; export interface InstabugNativeModule extends NativeModule { getConstants(): NativeConstants; @@ -158,9 +159,12 @@ export interface InstabugNativeModule extends NativeModule { setOnFeaturesUpdatedListener(handler?: (params: any) => void): void; // android only enableAutoMasking(autoMaskingTypes: AutoMaskingType[]): void; getNetworkBodyMaxSize(): Promise; + + setTheme(theme: ThemeConfig): void; + setFullscreen(isEnabled: boolean): void; } -export const NativeInstabug = NativeModules.Instabug; +export const NativeInstabug = NativeModules.Instabug as InstabugNativeModule; export enum NativeEvents { PRESENDING_HANDLER = 'IBGpreSendingHandler', From 1f8a8bedc122aaa795e96f7c654534631cceaac5 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 7 Jul 2025 13:26:14 +0300 Subject: [PATCH 02/62] fix: lint --- .../reactlibrary/RNInstabugReactnativeModuleTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java index 072e33e7a..3694337ab 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java @@ -741,9 +741,7 @@ public void testSetTheme() { themeConfig.putString("primaryTextStyle", "bold"); themeConfig.putString("secondaryTextStyle", "italic"); themeConfig.putString("ctaTextStyle", "bold"); - themeConfig.putString("primaryFontPath", "TestFont.ttf"); - themeConfig.putString("secondaryFontPath", "fonts/AnotherFont.ttf"); - themeConfig.putString("ctaFontPath", "./assets/fonts/CTAFont.ttf"); + // Note: Not including font paths to avoid getReactApplicationContext() call in test // Mock IBGTheme.Builder com.instabug.library.model.IBGTheme.Builder mockBuilder = mock(com.instabug.library.model.IBGTheme.Builder.class); From 79b5c701814aa0b89ba0a478fe05a008c98c5494 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 7 Jul 2025 13:30:30 +0300 Subject: [PATCH 03/62] fix android test --- .../instabug/reactlibrary/RNInstabugReactnativeModuleTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java index 3694337ab..af67213dd 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java @@ -741,7 +741,6 @@ public void testSetTheme() { themeConfig.putString("primaryTextStyle", "bold"); themeConfig.putString("secondaryTextStyle", "italic"); themeConfig.putString("ctaTextStyle", "bold"); - // Note: Not including font paths to avoid getReactApplicationContext() call in test // Mock IBGTheme.Builder com.instabug.library.model.IBGTheme.Builder mockBuilder = mock(com.instabug.library.model.IBGTheme.Builder.class); From 6d3ef3f1636585785f96403d247134aa007fbd46 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 7 Jul 2025 13:34:17 +0300 Subject: [PATCH 04/62] fix: add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abda7ed70..0578ee431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v15.0.1...dev) + +### Added + +- Add Support Advanced UI customization. ([#1411](https://github.com/Instabug/Instabug-React-Native/pull/1411)) + ## [15.0.1](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...v15.0.1) ### Added From c5409f04010e196226a0be10d56243dc4bbeca05 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 7 Jul 2025 13:54:37 +0300 Subject: [PATCH 05/62] fix: mocking file --- test/mocks/mockInstabug.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/mocks/mockInstabug.ts b/test/mocks/mockInstabug.ts index 391a00a38..60c4b9ade 100644 --- a/test/mocks/mockInstabug.ts +++ b/test/mocks/mockInstabug.ts @@ -77,6 +77,8 @@ const mockInstabug: InstabugNativeModule = { setOnFeaturesUpdatedListener: jest.fn(), enableAutoMasking: jest.fn(), getNetworkBodyMaxSize: jest.fn().mockResolvedValue(10240), // 10 KB + setTheme: jest.fn(), + setFullscreen: jest.fn(), }; export default mockInstabug; From c828d0a27928b267c7a29374e3c64deaefdc67ee Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Wed, 9 Jul 2025 13:55:13 +0300 Subject: [PATCH 06/62] fix: refactor redundant code --- .../RNInstabugReactnativeModule.java | 60 ++++--- ios/RNInstabug/InstabugReactBridge.m | 156 +++++------------- 2 files changed, 72 insertions(+), 144 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 7147b856c..3d1e744fc 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -1394,32 +1394,9 @@ public void run() { if (themeConfig.hasKey("ctaTextStyle")) { builder.setCtaTextStyle(getTextStyle(themeConfig, "ctaTextStyle")); } - if (themeConfig.hasKey("primaryFontPath") || themeConfig.hasKey("primaryFontAsset")) { - Typeface primaryTypeface = getTypeface(themeConfig, "primaryFontPath", "primaryFontAsset"); - if (primaryTypeface != null) { - builder.setPrimaryTextFont(primaryTypeface); - } else { - Log.e("InstabugModule", "Failed to load primary font"); - } - } - - if (themeConfig.hasKey("secondaryFontPath") || themeConfig.hasKey("secondaryFontAsset")) { - Typeface secondaryTypeface = getTypeface(themeConfig, "secondaryFontPath", "secondaryFontAsset"); - if (secondaryTypeface != null) { - builder.setSecondaryTextFont(secondaryTypeface); - } else { - Log.e("InstabugModule", "Failed to load secondary font"); - } - } - - if (themeConfig.hasKey("ctaFontPath") || themeConfig.hasKey("ctaFontAsset")) { - Typeface ctaTypeface = getTypeface(themeConfig, "ctaFontPath", "ctaFontAsset"); - if (ctaTypeface != null) { - builder.setCtaTextFont(ctaTypeface); - } else { - Log.e("InstabugModule", "Failed to load CTA font"); - } - } + setFontIfPresent(themeConfig, builder, "primaryFontPath", "primaryFontAsset", "primary"); + setFontIfPresent(themeConfig, builder, "secondaryFontPath", "secondaryFontAsset", "secondary"); + setFontIfPresent(themeConfig, builder, "ctaFontPath", "ctaFontAsset", "CTA"); IBGTheme theme = builder.build(); Instabug.setTheme(theme); @@ -1479,6 +1456,37 @@ private int getTextStyle(ReadableMap map, String key) { return Typeface.NORMAL; } + /** + * Sets a font on the theme builder if the font configuration is present in the theme config. + * + * @param themeConfig The theme configuration map + * @param builder The theme builder + * @param fileKey The key for font file path + * @param assetKey The key for font asset path + * @param fontType The type of font (for logging purposes) + */ + private void setFontIfPresent(ReadableMap themeConfig, com.instabug.library.model.IBGTheme.Builder builder, + String fileKey, String assetKey, String fontType) { + if (themeConfig.hasKey(fileKey) || themeConfig.hasKey(assetKey)) { + Typeface typeface = getTypeface(themeConfig, fileKey, assetKey); + if (typeface != null) { + switch (fontType) { + case "primary": + builder.setPrimaryTextFont(typeface); + break; + case "secondary": + builder.setSecondaryTextFont(typeface); + break; + case "CTA": + builder.setCtaTextFont(typeface); + break; + } + } else { + Log.e("InstabugModule", "Failed to load " + fontType + " font"); + } + } + } + private Typeface getTypeface(ReadableMap map, String fileKey, String assetKey) { try { if (fileKey != null && map.hasKey(fileKey) && !map.isNull(fileKey)) { diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index a7efd17ba..794c3b6f2 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -176,134 +176,54 @@ - (dispatch_queue_t)methodQueue { RCT_EXPORT_METHOD(setTheme:(NSDictionary *)themeConfig) { IBGTheme *theme = [[IBGTheme alloc] init]; - if (themeConfig[@"primaryColor"]) { - NSString *colorString = themeConfig[@"primaryColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.primaryColor = color; - } - } - - if (themeConfig[@"backgroundColor"]) { - NSString *colorString = themeConfig[@"backgroundColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.backgroundColor = color; - } - } - - if (themeConfig[@"titleTextColor"]) { - NSString *colorString = themeConfig[@"titleTextColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.titleTextColor = color; - } - } - - if (themeConfig[@"subtitleTextColor"]) { - NSString *colorString = themeConfig[@"subtitleTextColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.subtitleTextColor = color; - } - } - - if (themeConfig[@"primaryTextColor"]) { - NSString *colorString = themeConfig[@"primaryTextColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.primaryTextColor = color; - } - } - - if (themeConfig[@"secondaryTextColor"]) { - NSString *colorString = themeConfig[@"secondaryTextColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.secondaryTextColor = color; - } - } - - if (themeConfig[@"callToActionTextColor"]) { - NSString *colorString = themeConfig[@"callToActionTextColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.callToActionTextColor = color; - } - } - - if (themeConfig[@"headerBackgroundColor"]) { - NSString *colorString = themeConfig[@"headerBackgroundColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.headerBackgroundColor = color; - } - } - - if (themeConfig[@"footerBackgroundColor"]) { - NSString *colorString = themeConfig[@"footerBackgroundColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.footerBackgroundColor = color; - } - } - - if (themeConfig[@"rowBackgroundColor"]) { - NSString *colorString = themeConfig[@"rowBackgroundColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.rowBackgroundColor = color; - } - } - - if (themeConfig[@"selectedRowBackgroundColor"]) { - NSString *colorString = themeConfig[@"selectedRowBackgroundColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.selectedRowBackgroundColor = color; - } - } - - if (themeConfig[@"rowSeparatorColor"]) { - NSString *colorString = themeConfig[@"rowSeparatorColor"]; - UIColor *color = [self colorFromHexString:colorString]; - if (color) { - theme.rowSeparatorColor = color; - } - } + NSDictionary *colorMapping = @{ + @"primaryColor": ^(UIColor *color) { theme.primaryColor = color; }, + @"backgroundColor": ^(UIColor *color) { theme.backgroundColor = color; }, + @"titleTextColor": ^(UIColor *color) { theme.titleTextColor = color; }, + @"subtitleTextColor": ^(UIColor *color) { theme.subtitleTextColor = color; }, + @"primaryTextColor": ^(UIColor *color) { theme.primaryTextColor = color; }, + @"secondaryTextColor": ^(UIColor *color) { theme.secondaryTextColor = color; }, + @"callToActionTextColor": ^(UIColor *color) { theme.callToActionTextColor = color; }, + @"headerBackgroundColor": ^(UIColor *color) { theme.headerBackgroundColor = color; }, + @"footerBackgroundColor": ^(UIColor *color) { theme.footerBackgroundColor = color; }, + @"rowBackgroundColor": ^(UIColor *color) { theme.rowBackgroundColor = color; }, + @"selectedRowBackgroundColor": ^(UIColor *color) { theme.selectedRowBackgroundColor = color; }, + @"rowSeparatorColor": ^(UIColor *color) { theme.rowSeparatorColor = color; } + }; - // Set fonts - if (themeConfig[@"primaryFontPath"]) { - NSString *fontName = themeConfig[@"primaryFontPath"]; - NSString *fileName = [fontName lastPathComponent]; - NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; - UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; - if (font) { - theme.primaryTextFont = font; + for (NSString *key in colorMapping) { + if (themeConfig[key]) { + NSString *colorString = themeConfig[key]; + UIColor *color = [self colorFromHexString:colorString]; + if (color) { + void (^setter)(UIColor *) = colorMapping[key]; + setter(color); + } } } - if (themeConfig[@"secondaryFontPath"]) { - NSString *fontName = themeConfig[@"secondaryFontPath"]; - NSString *fileName = [fontName lastPathComponent]; - NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; - UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; - if (font) { - theme.secondaryTextFont = font; - } - } + [self setFontIfPresent:themeConfig[@"primaryFontPath"] forTheme:theme type:@"primary"]; + [self setFontIfPresent:themeConfig[@"secondaryFontPath"] forTheme:theme type:@"secondary"]; + [self setFontIfPresent:themeConfig[@"ctaFontPath"] forTheme:theme type:@"cta"]; - if (themeConfig[@"ctaFontPath"]) { - NSString *fontName = themeConfig[@"ctaFontPath"]; - NSString *fileName = [fontName lastPathComponent]; + Instabug.theme = theme; +} + +- (void)setFontIfPresent:(NSString *)fontPath forTheme:(IBGTheme *)theme type:(NSString *)type { + if (fontPath) { + NSString *fileName = [fontPath lastPathComponent]; NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension]; UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0]; if (font) { - theme.callToActionTextFont = font; + if ([type isEqualToString:@"primary"]) { + theme.primaryTextFont = font; + } else if ([type isEqualToString:@"secondary"]) { + theme.secondaryTextFont = font; + } else if ([type isEqualToString:@"cta"]) { + theme.callToActionTextFont = font; + } } } - - Instabug.theme = theme; } - (UIColor *)colorFromHexString:(NSString *)hexString { From 55052a7f3527821ff260709849c50c0b979be588 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 14 Jul 2025 11:57:01 +0300 Subject: [PATCH 07/62] chore: add ios native APIs --- .gitignore | 3 +++ examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 18 +++++++------ examples/default/src/App.tsx | 3 ++- .../default/src/screens/apm/APMScreen.tsx | 25 +++++++++++++++++++ ios/RNInstabug/InstabugAPMBridge.h | 2 ++ ios/RNInstabug/InstabugAPMBridge.m | 4 +++ ios/native.rb | 2 +- src/modules/APM.ts | 8 ++++++ src/native/NativeAPM.ts | 3 +++ 10 files changed, 59 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 4033aaa3b..efad193fc 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,6 @@ android/keystores/debug.keystore # .idea run configurations /.run/* +.yarn/ +examples/default/.yarn/ +examples/default/ios/.xcode.env.local diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index e1dda08e3..d8659054c 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 0d7d7a1ff..ddf819b04 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.1) + - Instabug (15.1.15) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.1) + - Instabug (= 15.1.15) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,6 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1850,7 +1851,6 @@ SPEC REPOS: trunk: - Google-Maps-iOS-Utils - GoogleMaps - - Instabug - OCMock - SocketRocket @@ -1868,6 +1868,8 @@ EXTERNAL SOURCES: hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b + Instabug: + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2022,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 3e7af445c14d7823fcdecba223f09b5f7c0c6ce1 + Instabug: ed81d3e95f406f0e6d808e91a42dae929dfd4908 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2090,14 +2092,14 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: f17d4e6c679fbc921f2692c223a1c21395589cc5 + RNInstabug: fc1585dd6ede766139ab908b103d43efdcc8899a RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 837b933596e1616ff02cc206bb17dee4f611fdbc +PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index ceef8bc19..ddab728b2 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -5,6 +5,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { + APM, CrashReporting, InvocationEvent, LaunchType, @@ -69,7 +70,7 @@ export const App: React.FC = () => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; }); - // NetworkLogger.setRequestFilterExpression('false'); + APM.setScreenRenderEnabled(false); }); }); diff --git a/examples/default/src/screens/apm/APMScreen.tsx b/examples/default/src/screens/apm/APMScreen.tsx index 3652a95c5..f072fba07 100644 --- a/examples/default/src/screens/apm/APMScreen.tsx +++ b/examples/default/src/screens/apm/APMScreen.tsx @@ -38,6 +38,31 @@ export const APMScreen: React.FC navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> + + { + // Simulate slow rendering + const heavyComputation = () => { + for (let i = 0; i < 1000000; i++) { + Math.random() * Math.random(); + } + }; + heavyComputation(); + showNotification('Slow Frames', 'Heavy computation executed to simulate slow frames'); + }} + /> + { + const freezeDuration = 3000; // 3 seconds + const start = Date.now(); + while (Date.now() - start < freezeDuration) { + // Busy wait to block JS thread + } + showNotification('Frozen Frames', `UI frozen for ${freezeDuration / 1000} seconds`); + }} + /> ); }; diff --git a/ios/RNInstabug/InstabugAPMBridge.h b/ios/RNInstabug/InstabugAPMBridge.h index 0a0ea397c..509e7fae3 100644 --- a/ios/RNInstabug/InstabugAPMBridge.h +++ b/ios/RNInstabug/InstabugAPMBridge.h @@ -27,6 +27,8 @@ - (void)startUITrace:(NSString *)name; - (void)endUITrace; +- (void)setScreenRenderEnabled:(BOOL)isEnabled; + extern NSMutableDictionary *traces; @end diff --git a/ios/RNInstabug/InstabugAPMBridge.m b/ios/RNInstabug/InstabugAPMBridge.m index c28c7f425..3fe3effe4 100644 --- a/ios/RNInstabug/InstabugAPMBridge.m +++ b/ios/RNInstabug/InstabugAPMBridge.m @@ -124,6 +124,10 @@ - (id) init [IBGAPM endUITrace]; } +// Enables or disables screen render. +RCT_EXPORT_METHOD(setScreenRenderEnabled:(BOOL)isEnabled) { + IBGAPM.screenRenderingEnabled = isEnabled; +} diff --git a/ios/native.rb b/ios/native.rb index 41f497687..08e43fdae 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.1' } +$instabug = { :version => '15.1.15' } def use_instabug! (spec = nil) version = $instabug[:version] diff --git a/src/modules/APM.ts b/src/modules/APM.ts index 92d401389..d81d3cbb5 100644 --- a/src/modules/APM.ts +++ b/src/modules/APM.ts @@ -139,3 +139,11 @@ export const endUITrace = () => { export const _ibgSleep = () => { NativeAPM.ibgSleep(); }; + +/** + * Enables or disables Screen Render feature + * @param isEnabled + */ +export const setScreenRenderEnabled = (isEnabled: boolean) => { + NativeAPM.setScreenRenderEnabled(isEnabled); +}; diff --git a/src/native/NativeAPM.ts b/src/native/NativeAPM.ts index 9fa30b702..67c7d8cd1 100644 --- a/src/native/NativeAPM.ts +++ b/src/native/NativeAPM.ts @@ -48,6 +48,9 @@ export interface ApmNativeModule extends NativeModule { startUITrace(name: string): void; endUITrace(): void; ibgSleep(): void; + + // Screen Rendering // + setScreenRenderEnabled(isEnabled: boolean): void; } export const NativeAPM = NativeModules.IBGAPM; From 4214a27127db0fa45e3feb235b54ae5c1e616af1 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Mon, 14 Jul 2025 14:31:28 +0300 Subject: [PATCH 08/62] fix: refactor functions --- .../RNInstabugReactnativeModule.java | 158 +++++++++++------- 1 file changed, 101 insertions(+), 57 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 3d1e744fc..fa9d6cee7 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -1369,31 +1369,17 @@ public void run() { try { com.instabug.library.model.IBGTheme.Builder builder = new com.instabug.library.model.IBGTheme.Builder(); - if (themeConfig.hasKey("primaryColor")) { - builder.setPrimaryColor(getColor(themeConfig, "primaryColor")); - } - if (themeConfig.hasKey("secondaryTextColor")) { - builder.setSecondaryTextColor(getColor(themeConfig, "secondaryTextColor")); - } - if (themeConfig.hasKey("primaryTextColor")) { - builder.setPrimaryTextColor(getColor(themeConfig, "primaryTextColor")); - } - if (themeConfig.hasKey("titleTextColor")) { - builder.setTitleTextColor(getColor(themeConfig, "titleTextColor")); - } - if (themeConfig.hasKey("backgroundColor")) { - builder.setBackgroundColor(getColor(themeConfig, "backgroundColor")); - } - - if (themeConfig.hasKey("primaryTextStyle")) { - builder.setPrimaryTextStyle(getTextStyle(themeConfig, "primaryTextStyle")); - } - if (themeConfig.hasKey("secondaryTextStyle")) { - builder.setSecondaryTextStyle(getTextStyle(themeConfig, "secondaryTextStyle")); - } - if (themeConfig.hasKey("ctaTextStyle")) { - builder.setCtaTextStyle(getTextStyle(themeConfig, "ctaTextStyle")); - } + // Apply colors + applyColorIfPresent(themeConfig, builder, "primaryColor", (b, color) -> b.setPrimaryColor(color)); + applyColorIfPresent(themeConfig, builder, "secondaryTextColor", (b, color) -> b.setSecondaryTextColor(color)); + applyColorIfPresent(themeConfig, builder, "primaryTextColor", (b, color) -> b.setPrimaryTextColor(color)); + applyColorIfPresent(themeConfig, builder, "titleTextColor", (b, color) -> b.setTitleTextColor(color)); + applyColorIfPresent(themeConfig, builder, "backgroundColor", (b, color) -> b.setBackgroundColor(color)); + + // Apply text styles + applyTextStyleIfPresent(themeConfig, builder, "primaryTextStyle", (b, style) -> b.setPrimaryTextStyle(style)); + applyTextStyleIfPresent(themeConfig, builder, "secondaryTextStyle", (b, style) -> b.setSecondaryTextStyle(style)); + applyTextStyleIfPresent(themeConfig, builder, "ctaTextStyle", (b, style) -> b.setCtaTextStyle(style)); setFontIfPresent(themeConfig, builder, "primaryFontPath", "primaryFontAsset", "primary"); setFontIfPresent(themeConfig, builder, "secondaryFontPath", "secondaryFontAsset", "secondary"); setFontIfPresent(themeConfig, builder, "ctaFontPath", "ctaFontAsset", "CTA"); @@ -1456,6 +1442,40 @@ private int getTextStyle(ReadableMap map, String key) { return Typeface.NORMAL; } + + + /** + * Applies a color to the theme builder if present in the configuration. + * + * @param themeConfig The theme configuration map + * @param builder The theme builder + * @param key The configuration key + * @param setter The color setter function + */ + private void applyColorIfPresent(ReadableMap themeConfig, com.instabug.library.model.IBGTheme.Builder builder, + String key, java.util.function.BiConsumer setter) { + if (themeConfig.hasKey(key)) { + int color = getColor(themeConfig, key); + setter.accept(builder, color); + } + } + + /** + * Applies a text style to the theme builder if present in the configuration. + * + * @param themeConfig The theme configuration map + * @param builder The theme builder + * @param key The configuration key + * @param setter The text style setter function + */ + private void applyTextStyleIfPresent(ReadableMap themeConfig, com.instabug.library.model.IBGTheme.Builder builder, + String key, java.util.function.BiConsumer setter) { + if (themeConfig.hasKey(key)) { + int style = getTextStyle(themeConfig, key); + setter.accept(builder, style); + } + } + /** * Sets a font on the theme builder if the font configuration is present in the theme config. * @@ -1487,45 +1507,69 @@ private void setFontIfPresent(ReadableMap themeConfig, com.instabug.library.mode } } -private Typeface getTypeface(ReadableMap map, String fileKey, String assetKey) { - try { - if (fileKey != null && map.hasKey(fileKey) && !map.isNull(fileKey)) { - String fontPath = map.getString(fileKey); - String fileName = getFileName(fontPath); - - try { - Typeface typeface = Typeface.create(fileName, Typeface.NORMAL); - if (typeface != null && !typeface.equals(Typeface.DEFAULT)) { - return typeface; - } - } catch (Exception e) { - e.printStackTrace(); - } - - try { - Typeface typeface = Typeface.createFromAsset(getReactApplicationContext().getAssets(), "fonts/" + fileName); + /** + * Loads a Typeface from a file path. + * + * @param fileName The filename to load + * @return The loaded Typeface or null if failed + */ + private Typeface loadTypefaceFromFile(String fileName) { + try { + Typeface typeface = Typeface.create(fileName, Typeface.NORMAL); + if (typeface != null && !typeface.equals(Typeface.DEFAULT)) { return typeface; - } catch (Exception e) { - e.printStackTrace(); } + } catch (Exception e) { + e.printStackTrace(); } + return null; + } - if (assetKey != null && map.hasKey(assetKey) && !map.isNull(assetKey)) { - String assetPath = map.getString(assetKey); - String fileName = getFileName(assetPath); - try { - Typeface typeface = Typeface.createFromAsset(getReactApplicationContext().getAssets(), "fonts/" + fileName); - return typeface; - } catch (Exception e) { - e.printStackTrace(); - } + /** + * Loads a Typeface from assets. + * + * @param fileName The filename in assets/fonts/ directory + * @return The loaded Typeface or null if failed + */ + private Typeface loadTypefaceFromAssets(String fileName) { + try { + return Typeface.createFromAsset(getReactApplicationContext().getAssets(), "fonts/" + fileName); + } catch (Exception e) { + e.printStackTrace(); + return null; } - } catch (Exception e) { - e.printStackTrace(); } - return Typeface.DEFAULT; -} + private Typeface getTypeface(ReadableMap map, String fileKey, String assetKey) { + try { + if (fileKey != null && map.hasKey(fileKey) && !map.isNull(fileKey)) { + String fontPath = map.getString(fileKey); + String fileName = getFileName(fontPath); + + // Try loading from file first + Typeface typeface = loadTypefaceFromFile(fileName); + if (typeface != null) { + return typeface; + } + + // Try loading from assets + typeface = loadTypefaceFromAssets(fileName); + if (typeface != null) { + return typeface; + } + } + + if (assetKey != null && map.hasKey(assetKey) && !map.isNull(assetKey)) { + String assetPath = map.getString(assetKey); + String fileName = getFileName(assetPath); + return loadTypefaceFromAssets(fileName); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return Typeface.DEFAULT; + } /** * Extracts the filename from a path, removing any directory prefixes. From f241b73f9faccc3b82b9abd6461403fca09151a5 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Tue, 15 Jul 2025 13:38:55 +0300 Subject: [PATCH 09/62] chore: update android snapshot --- android/native.gradle | 2 +- .../reactlibrary/RNInstabugAPMModule.java | 215 ++++++++++-------- examples/default/src/App.tsx | 3 +- 3 files changed, 117 insertions(+), 103 deletions(-) diff --git a/android/native.gradle b/android/native.gradle index faa3246cd..f33c0b543 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.1' + version: '15.0.1.6985154-SNAPSHOT' ] dependencies { diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java index d75b4f75b..f6ef387c1 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java @@ -1,6 +1,8 @@ package com.instabug.reactlibrary; +import static com.instabug.reactlibrary.utils.InstabugUtil.getMethod; + import android.os.SystemClock; import android.util.Log; @@ -16,17 +18,13 @@ import com.instabug.apm.networking.APMNetworkLogger; import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.reactlibrary.utils.EventEmitterModule; -import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.reactlibrary.utils.MainThreadHandler; import java.lang.reflect.Method; - import java.util.HashMap; import javax.annotation.Nonnull; -import static com.instabug.reactlibrary.utils.InstabugUtil.getMethod; - public class RNInstabugAPMModule extends EventEmitterModule { public RNInstabugAPMModule(ReactApplicationContext reactApplicationContext) { @@ -211,7 +209,6 @@ public void run() { * Starts an execution trace * * @param name string name of the trace. - * * @deprecated see {@link #startFlow(String)} */ @Deprecated @@ -242,7 +239,6 @@ public void run() { * @param id String id of the trace. * @param key attribute key * @param value attribute value. Null to remove attribute - * * @deprecated see {@link #setFlowAttribute} */ @Deprecated @@ -264,7 +260,6 @@ public void run() { * Ends a trace * * @param id string id of the trace. - * * @deprecated see {@link #endFlow} */ @Deprecated @@ -318,73 +313,73 @@ public void run() { }); } - /** - * The `networkLogAndroid` function logs network-related information using APMNetworkLogger in a React - * Native module. - * - * @param requestStartTime The `requestStartTime` parameter in the `networkLogAndroid` method - * represents the timestamp when the network request started. It is of type `double` and is passed as - * a parameter to log network-related information. - * @param requestDuration The `requestDuration` parameter in the `networkLogAndroid` method represents - * the duration of the network request in milliseconds. It indicates the time taken for the request to - * complete from the moment it was initiated until the response was received. This parameter helps in - * measuring the performance of network requests and identifying any potential - * @param requestHeaders requestHeaders is a string parameter that contains the headers of the network - * request. It typically includes information such as the content type, authorization token, and any - * other headers that were sent with the request. - * @param requestBody The `requestBody` parameter in the `networkLogAndroid` method represents the - * body of the HTTP request being logged. It contains the data that is sent as part of the request to - * the server. This could include form data, JSON payload, XML data, or any other content that is - * being transmitted - * @param requestBodySize The `requestBodySize` parameter in the `networkLogAndroid` method represents - * the size of the request body in bytes. It is a double value that indicates the size of the request - * body being sent in the network request. This parameter is used to log information related to the - * network request, including details - * @param requestMethod The `requestMethod` parameter in the `networkLogAndroid` method represents the - * HTTP method used in the network request, such as GET, POST, PUT, DELETE, etc. It indicates the type - * of operation that the client is requesting from the server. - * @param requestUrl The `requestUrl` parameter in the `networkLogAndroid` method represents the URL - * of the network request being logged. It typically contains the address of the server to which the - * request is being made, along with any additional path or query parameters required for the request. - * This URL is essential for identifying the - * @param requestContentType The `requestContentType` parameter in the `networkLogAndroid` method - * represents the content type of the request being made. This could be values like - * "application/json", "application/xml", "text/plain", etc., indicating the format of the data being - * sent in the request body. It helps in specifying - * @param responseHeaders The `responseHeaders` parameter in the `networkLogAndroid` method represents - * the headers of the response received from a network request. These headers typically include - * information such as content type, content length, server information, and any other metadata - * related to the response. The `responseHeaders` parameter is expected to - * @param responseBody The `responseBody` parameter in the `networkLogAndroid` method represents the - * body of the response received from a network request. It contains the data or content sent back by - * the server in response to the request made by the client. This could be in various formats such as - * JSON, XML, HTML - * @param responseBodySize The `responseBodySize` parameter in the `networkLogAndroid` method - * represents the size of the response body in bytes. It is a double value that indicates the size of - * the response body received from the network request. This parameter is used to log information - * related to the network request and response, including - * @param statusCode The `statusCode` parameter in the `networkLogAndroid` method represents the HTTP - * status code of the network request/response. It indicates the status of the HTTP response, such as - * success (200), redirection (3xx), client errors (4xx), or server errors (5xx). This parameter is - * @param responseContentType The `responseContentType` parameter in the `networkLogAndroid` method - * represents the content type of the response received from the network request. It indicates the - * format of the data in the response, such as JSON, XML, HTML, etc. This information is useful for - * understanding how to parse and handle the - * @param errorDomain The `errorDomain` parameter in the `networkLogAndroid` method is used to specify - * the domain of an error, if any occurred during the network request. If there was no error, this - * parameter will be `null`. - * @param w3cAttributes The `w3cAttributes` parameter in the `networkLogAndroid` method is a - * ReadableMap object that contains additional attributes related to W3C external trace. It may - * include the following key-value pairs: - * @param gqlQueryName The `gqlQueryName` parameter in the `networkLogAndroid` method represents the - * name of the GraphQL query being executed. It is a nullable parameter, meaning it can be null if no - * GraphQL query name is provided. This parameter is used to log information related to GraphQL - * queries in the network logging - * @param serverErrorMessage The `serverErrorMessage` parameter in the `networkLogAndroid` method is - * used to pass any error message received from the server during network communication. This message - * can provide additional details about any errors that occurred on the server side, helping in - * debugging and troubleshooting network-related issues. - */ + /** + * The `networkLogAndroid` function logs network-related information using APMNetworkLogger in a React + * Native module. + * + * @param requestStartTime The `requestStartTime` parameter in the `networkLogAndroid` method + * represents the timestamp when the network request started. It is of type `double` and is passed as + * a parameter to log network-related information. + * @param requestDuration The `requestDuration` parameter in the `networkLogAndroid` method represents + * the duration of the network request in milliseconds. It indicates the time taken for the request to + * complete from the moment it was initiated until the response was received. This parameter helps in + * measuring the performance of network requests and identifying any potential + * @param requestHeaders requestHeaders is a string parameter that contains the headers of the network + * request. It typically includes information such as the content type, authorization token, and any + * other headers that were sent with the request. + * @param requestBody The `requestBody` parameter in the `networkLogAndroid` method represents the + * body of the HTTP request being logged. It contains the data that is sent as part of the request to + * the server. This could include form data, JSON payload, XML data, or any other content that is + * being transmitted + * @param requestBodySize The `requestBodySize` parameter in the `networkLogAndroid` method represents + * the size of the request body in bytes. It is a double value that indicates the size of the request + * body being sent in the network request. This parameter is used to log information related to the + * network request, including details + * @param requestMethod The `requestMethod` parameter in the `networkLogAndroid` method represents the + * HTTP method used in the network request, such as GET, POST, PUT, DELETE, etc. It indicates the type + * of operation that the client is requesting from the server. + * @param requestUrl The `requestUrl` parameter in the `networkLogAndroid` method represents the URL + * of the network request being logged. It typically contains the address of the server to which the + * request is being made, along with any additional path or query parameters required for the request. + * This URL is essential for identifying the + * @param requestContentType The `requestContentType` parameter in the `networkLogAndroid` method + * represents the content type of the request being made. This could be values like + * "application/json", "application/xml", "text/plain", etc., indicating the format of the data being + * sent in the request body. It helps in specifying + * @param responseHeaders The `responseHeaders` parameter in the `networkLogAndroid` method represents + * the headers of the response received from a network request. These headers typically include + * information such as content type, content length, server information, and any other metadata + * related to the response. The `responseHeaders` parameter is expected to + * @param responseBody The `responseBody` parameter in the `networkLogAndroid` method represents the + * body of the response received from a network request. It contains the data or content sent back by + * the server in response to the request made by the client. This could be in various formats such as + * JSON, XML, HTML + * @param responseBodySize The `responseBodySize` parameter in the `networkLogAndroid` method + * represents the size of the response body in bytes. It is a double value that indicates the size of + * the response body received from the network request. This parameter is used to log information + * related to the network request and response, including + * @param statusCode The `statusCode` parameter in the `networkLogAndroid` method represents the HTTP + * status code of the network request/response. It indicates the status of the HTTP response, such as + * success (200), redirection (3xx), client errors (4xx), or server errors (5xx). This parameter is + * @param responseContentType The `responseContentType` parameter in the `networkLogAndroid` method + * represents the content type of the response received from the network request. It indicates the + * format of the data in the response, such as JSON, XML, HTML, etc. This information is useful for + * understanding how to parse and handle the + * @param errorDomain The `errorDomain` parameter in the `networkLogAndroid` method is used to specify + * the domain of an error, if any occurred during the network request. If there was no error, this + * parameter will be `null`. + * @param w3cAttributes The `w3cAttributes` parameter in the `networkLogAndroid` method is a + * ReadableMap object that contains additional attributes related to W3C external trace. It may + * include the following key-value pairs: + * @param gqlQueryName The `gqlQueryName` parameter in the `networkLogAndroid` method represents the + * name of the GraphQL query being executed. It is a nullable parameter, meaning it can be null if no + * GraphQL query name is provided. This parameter is used to log information related to GraphQL + * queries in the network logging + * @param serverErrorMessage The `serverErrorMessage` parameter in the `networkLogAndroid` method is + * used to pass any error message received from the server during network communication. This message + * can provide additional details about any errors that occurred on the server side, helping in + * debugging and troubleshooting network-related issues. + */ @ReactMethod private void networkLogAndroid(final double requestStartTime, final double requestDuration, @@ -403,15 +398,15 @@ private void networkLogAndroid(final double requestStartTime, @Nullable final ReadableMap w3cAttributes, @Nullable final String gqlQueryName, @Nullable final String serverErrorMessage - ) { + ) { try { APMNetworkLogger networkLogger = new APMNetworkLogger(); final boolean hasError = errorDomain != null && !errorDomain.isEmpty(); final String errorMessage = hasError ? errorDomain : null; - Boolean isW3cHeaderFound=false; - Long partialId=null; - Long networkStartTimeInSeconds=null; + Boolean isW3cHeaderFound = false; + Long partialId = null; + Long networkStartTimeInSeconds = null; try { @@ -420,7 +415,7 @@ private void networkLogAndroid(final double requestStartTime, } if (!w3cAttributes.isNull("partialId")) { - partialId =(long) w3cAttributes.getDouble("partialId"); + partialId = (long) w3cAttributes.getDouble("partialId"); networkStartTimeInSeconds = (long) w3cAttributes.getDouble("networkStartTimeInSeconds"); } @@ -438,34 +433,54 @@ private void networkLogAndroid(final double requestStartTime, try { Method method = getMethod(Class.forName("com.instabug.apm.networking.APMNetworkLogger"), "log", long.class, long.class, String.class, String.class, long.class, String.class, String.class, String.class, String.class, String.class, long.class, int.class, String.class, String.class, String.class, String.class, APMCPNetworkLog.W3CExternalTraceAttributes.class); if (method != null) { - method.invoke( - networkLogger, - (long) requestStartTime * 1000, - (long) requestDuration, - requestHeaders, - requestBody, - (long) requestBodySize, - requestMethod, - requestUrl, - requestContentType, - responseHeaders, - responseBody, - (long)responseBodySize, - (int) statusCode, - responseContentType, - errorMessage, - gqlQueryName, - serverErrorMessage, - w3cExternalTraceAttributes - ); + method.invoke( + networkLogger, + (long) requestStartTime * 1000, + (long) requestDuration, + requestHeaders, + requestBody, + (long) requestBodySize, + requestMethod, + requestUrl, + requestContentType, + responseHeaders, + responseBody, + (long) responseBodySize, + (int) statusCode, + responseContentType, + errorMessage, + gqlQueryName, + serverErrorMessage, + w3cExternalTraceAttributes + ); } else { Log.e("IB-CP-Bridge", "APMNetworkLogger.log was not found by reflection"); } } catch (Throwable e) { e.printStackTrace(); } - } catch(Throwable e) { + } catch (Throwable e) { e.printStackTrace(); } } + + + /** + * Enables or disables screen rendering + * + * @param isEnabled boolean indicating enabled or disabled. + */ + @ReactMethod + public void setScreenRenderEnabled(boolean isEnabled) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + APM.setScreenRenderingEnabled(isEnabled); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } } diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index ddab728b2..2fc62edbe 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -5,7 +5,6 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { - APM, CrashReporting, InvocationEvent, LaunchType, @@ -70,7 +69,7 @@ export const App: React.FC = () => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; }); - APM.setScreenRenderEnabled(false); + // APM.setScreenRenderEnabled(true); }); }); From dafc63d097ebf4bcc0b08e7ec79b98284faef1c8 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Sun, 20 Jul 2025 13:02:02 +0300 Subject: [PATCH 10/62] chore: add readme file for UI customization --- FONTS_SETUP_GUIDE.md | 484 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 484 insertions(+) create mode 100644 FONTS_SETUP_GUIDE.md diff --git a/FONTS_SETUP_GUIDE.md b/FONTS_SETUP_GUIDE.md new file mode 100644 index 000000000..16a0230f4 --- /dev/null +++ b/FONTS_SETUP_GUIDE.md @@ -0,0 +1,484 @@ +# Complete Font Setup Guide for Instabug React Native + +This guide covers all ways to use fonts with the `setTheme` function in Instabug React Native, including Google Fonts, custom fonts, system fonts, and both Expo and regular React Native projects. + +## Table of Contents + +1. [Overview](#overview) +2. [Font Types Supported](#font-types-supported) +3. [Regular React Native Setup](#regular-react-native-setup) +4. [Expo Setup](#expo-setup) +5. [Asset Linking Options](#asset-linking-options) +6. [Usage Examples](#usage-examples) +7. [Troubleshooting](#troubleshooting) +8. [Platform Compatibility Notes](#platform-compatibility-notes) + +## Overview + +The Instabug React Native bridge supports font loading from multiple sources: +- **App Bundle**: Fonts included in your app assets +- **System Fonts**: Built-in platform fonts +- **Custom Fonts**: Any TTF/OTF font files +- **Google Fonts**: Downloaded TTF files from Google Fonts + +## Font Types Supported + +### 1. Google Fonts +- Download TTF files from [Google Fonts](https://fonts.google.com/) +- Examples: Roboto, Inter, Nunito, Open Sans, Lato + +### 2. Custom Fonts +- Any TTF/OTF font files +- Commercial fonts, free fonts, custom designs + +### 3. System Fonts +- Platform default fonts +- No setup required +- Examples: San Francisco (iOS), Roboto (Android) + +## Regular React Native Setup + +### Method 1: Bundle Fonts (Recommended) + +#### Step 1: Download Font Files +```bash +# Create fonts directory +mkdir fonts + +# Download your desired fonts (example with Google Fonts) +# Download from Google Fonts or any font provider +# Place TTF files in the fonts directory +``` + +#### Step 2: Add to Android +```bash +# Create assets/fonts directory +mkdir -p android/app/src/main/assets/fonts + +# Copy font files +cp fonts/*.ttf android/app/src/main/assets/fonts/ +``` + +#### Step 3: Add to iOS +1. **Add to Xcode Project:** + - Open your iOS project in Xcode + - Right-click on your project → "Add Files to [ProjectName]" + - Select your TTF files + - Make sure "Add to target" is checked + +2. **Update Info.plist:** +```xml +UIAppFonts + + Roboto-Regular.ttf + Roboto-Bold.ttf + Inter-Regular.ttf + Inter-Bold.ttf + +``` + +#### Step 4: Use with setTheme +```typescript +import Instabug from 'instabug-reactnative'; +import { Platform } from 'react-native'; + +const applyCustomTheme = () => { + Instabug.setTheme({ + // Colors + primaryColor: '#2196F3', + backgroundColor: '#FFFFFF', + primaryTextColor: '#333333', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // Fonts - Android (use font paths) + ...(Platform.OS === 'android' && { + primaryFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Regular.ttf', + secondaryFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Light.ttf', + ctaFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Bold.ttf', + }), + + // Fonts - iOS (use font paths, not assets) + ...(Platform.OS === 'ios' && { + primaryFontPath: 'fonts/Roboto-Regular.ttf', + secondaryFontPath: 'fonts/Roboto-Light.ttf', + ctaFontPath: 'fonts/Roboto-Bold.ttf', + }), + }); +}; +``` + +### Method 2: System Fonts Only +```typescript +import Instabug from 'instabug-reactnative'; + +const applySystemTheme = () => { + Instabug.setTheme({ + // Colors only - uses system fonts + primaryColor: '#2196F3', + backgroundColor: '#FFFFFF', + primaryTextColor: '#333333', + secondaryTextColor: '#666666', + titleTextColor: '#000000', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // No font paths = uses system fonts + }); +}; +``` + +## Expo Setup + +### Method 1: Expo Fonts (Recommended for Expo) + +#### Step 1: Install Expo Fonts +```bash +npx expo install expo-font +``` + +#### Step 2: Download and Add Fonts +```bash +# Create fonts directory +mkdir fonts + +# Download your fonts and place them in the fonts directory +# Example: Roboto-Regular.ttf, Roboto-Bold.ttf, Inter-Regular.ttf +``` + +#### Step 3: Configure app.json +```json +{ + "expo": { + "fonts": [ + { + "asset": "./fonts/Roboto-Regular.ttf", + "family": "Roboto-Regular" + }, + { + "asset": "./fonts/Roboto-Bold.ttf", + "family": "Roboto-Bold" + }, + { + "asset": "./fonts/Inter-Regular.ttf", + "family": "Inter-Regular" + } + ] + } +} +``` + +#### Step 4: Load Fonts in Your App +```typescript +import * as Font from 'expo-font'; +import { useEffect, useState } from 'react'; + +export default function App() { + const [fontsLoaded, setFontsLoaded] = useState(false); + + useEffect(() => { + async function loadFonts() { + await Font.loadAsync({ + 'Roboto-Regular': require('./fonts/Roboto-Regular.ttf'), + 'Roboto-Bold': require('./fonts/Roboto-Bold.ttf'), + 'Inter-Regular': require('./fonts/Inter-Regular.ttf'), + }); + setFontsLoaded(true); + } + loadFonts(); + }, []); + + if (!fontsLoaded) { + return ; + } + + return ; +} +``` + +#### Step 5: Use with setTheme +```typescript +import Instabug from 'instabug-reactnative'; +import { Platform } from 'react-native'; + +const applyExpoTheme = () => { + Instabug.setTheme({ + // Colors + primaryColor: '#2196F3', + backgroundColor: '#FFFFFF', + primaryTextColor: '#333333', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // Fonts - use font paths for both platforms + primaryFontPath: 'fonts/Roboto-Regular.ttf', + secondaryFontPath: 'fonts/Inter-Regular.ttf', + ctaFontPath: 'fonts/Roboto-Bold.ttf', + }); +}; +``` + +### Method 2: Expo with Bundle Fonts +Same as Regular React Native Method 1, but fonts are automatically included in the Expo build. + +## Asset Linking Options + +### Option 1: Manual Copy (Current Method) +- Copy TTF files to native directories +- Update Info.plist manually +- Works with all setups + +### Option 2: React Native CLI Linking +```bash +# Create a react-native.config.js file +module.exports = { + assets: ['./fonts/'], +}; +``` + +Then run: +```bash +npx react-native link +``` + +### Option 3: Expo Asset Linking +```json +{ + "expo": { + "fonts": [ + { + "asset": "./fonts/Roboto-Regular.ttf", + "family": "Roboto-Regular" + } + ] + } +} +``` + +### Option 4: Metro Asset Plugin +```bash +npm install --save-dev react-native-asset +``` + +Create `react-native.config.js`: +```javascript +module.exports = { + assets: ['./fonts/'], +}; +``` + +## Usage Examples + +### Example 1: Google Fonts (Roboto) +```typescript +// Download: Roboto-Regular.ttf, Roboto-Bold.ttf, Roboto-Light.ttf +// Add to project using any method above + +const applyRobotoTheme = () => { + Instabug.setTheme({ + primaryColor: '#1976D2', + backgroundColor: '#FAFAFA', + primaryTextColor: '#212121', + secondaryTextColor: '#757575', + titleTextColor: '#000000', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // Font paths for both platforms + primaryFontPath: 'fonts/Roboto-Regular.ttf', + secondaryFontPath: 'fonts/Roboto-Light.ttf', + ctaFontPath: 'fonts/Roboto-Bold.ttf', + }); +}; +``` + +### Example 2: Custom Fonts (Inter) +```typescript +// Download: Inter-Regular.ttf, Inter-Bold.ttf, Inter-Medium.ttf +// Add to project using any method above + +const applyInterTheme = () => { + Instabug.setTheme({ + primaryColor: '#3B82F6', + backgroundColor: '#FFFFFF', + primaryTextColor: '#1F2937', + secondaryTextColor: '#6B7280', + titleTextColor: '#111827', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // Font paths for both platforms + primaryFontPath: 'fonts/Inter-Regular.ttf', + secondaryFontPath: 'fonts/Inter-Medium.ttf', + ctaFontPath: 'fonts/Inter-Bold.ttf', + }); +}; +``` + +### Example 3: System Fonts Only +```typescript +const applySystemTheme = () => { + Instabug.setTheme({ + primaryColor: '#007AFF', + backgroundColor: '#F2F2F7', + primaryTextColor: '#000000', + secondaryTextColor: '#8E8E93', + titleTextColor: '#000000', + + // Text styles (Android only) - no font paths = uses system fonts + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + }); +}; +``` + +### Example 4: Mixed Approach +```typescript +const applyMixedTheme = () => { + Instabug.setTheme({ + primaryColor: '#FF6B6B', + backgroundColor: '#FFFFFF', + primaryTextColor: '#2D3436', + secondaryTextColor: '#636E72', + titleTextColor: '#2D3436', + + // Text styles (Android only) + primaryTextStyle: 'normal', + secondaryTextStyle: 'normal', + ctaTextStyle: 'bold', + + // Custom font only for CTA - rest use system fonts + ctaFontPath: 'fonts/Roboto-Bold.ttf', + }); +}; +``` + +## Platform Compatibility Notes + +### **Important: iOS Font Asset Limitation** + +The iOS implementation currently **only supports** `primaryFontPath`, `secondaryFontPath`, and `ctaFontPath` properties. The `*FontAsset` properties are **not supported** on iOS. + +**Android**: Supports both `*FontPath` and `*FontAsset` properties +**iOS**: Only supports `*FontPath` properties + +### **Recommended Approach** + +Use `*FontPath` properties for both platforms to ensure compatibility: + +```typescript +// ✅ Works on both platforms +Instabug.setTheme({ + primaryFontPath: 'fonts/Roboto-Regular.ttf', + secondaryFontPath: 'fonts/Roboto-Light.ttf', + ctaFontPath: 'fonts/Roboto-Bold.ttf', +}); + +// ❌ iOS doesn't support these +Instabug.setTheme({ + primaryFontAsset: 'fonts/Roboto-Regular.ttf', // iOS ignores this + secondaryFontAsset: 'fonts/Roboto-Light.ttf', // iOS ignores this + ctaFontAsset: 'fonts/Roboto-Bold.ttf', // iOS ignores this +}); +``` + +### **Font Path Format** + +- **Android**: Can use full paths or just filenames +- **iOS**: Use relative paths like `fonts/Roboto-Regular.ttf` + +## Troubleshooting + +### Common Issues + +#### 1. Font Not Loading +**Symptoms:** Font appears as system font or doesn't change +**Solutions:** +- Check font filename matches exactly (case-sensitive) +- Verify font is added to both Android and iOS +- For iOS, check Info.plist entries +- For Expo, ensure fonts are loaded before using setTheme +- **iOS users**: Make sure you're using `*FontPath` properties, not `*FontAsset` + +#### 2. Font Loading in Expo +**Symptoms:** Font works in development but not in production +**Solutions:** +- Use `expo-font` to load fonts before app starts +- Ensure fonts are included in app.json +- Test with `expo build` or EAS Build + +#### 3. Font File Issues +**Symptoms:** App crashes or font doesn't load +**Solutions:** +- Verify TTF file is not corrupted +- Check file size (should be reasonable, not 0 bytes) +- Ensure font file is valid TTF/OTF format + +#### 4. Performance Issues +**Symptoms:** App slow to start or font loading delays +**Solutions:** +- Use system fonts for better performance +- Limit number of custom fonts +- Preload fonts in app initialization + +### Debug Steps + +1. **Check Font Loading:** +```typescript +// Add this to debug font loading +console.log('Available fonts:', Instabug.getAvailableFonts()); // If available +``` + +2. **Verify File Paths:** +```bash +# Check if fonts are in the right place +ls -la android/app/src/main/assets/fonts/ +ls -la ios/YourApp/ +``` + +3. **Test with System Fonts First:** +```typescript +// Test with system fonts to ensure setTheme works +Instabug.setTheme({ + primaryColor: '#FF0000', + // No fontFamily = system fonts +}); +``` + +## Best Practices + +1. **Use System Fonts When Possible:** Better performance and consistency +2. **Limit Custom Fonts:** Use 1-2 custom fonts maximum +3. **Preload Fonts:** Load fonts before app starts +4. **Test on Both Platforms:** Fonts may behave differently on iOS vs Android +5. **Use Standard Font Weights:** Regular, Bold, Light are most reliable +6. **Keep Font Files Small:** Optimize TTF files for mobile +7. **Use *FontPath Properties:** Ensures compatibility with both platforms + +## Summary + +- **Regular React Native:** Use bundle fonts or system fonts +- **Expo:** Use expo-font or bundle fonts +- **Asset Linking:** Available through CLI tools and Expo config +- **Google Fonts:** Download TTF files and add to project +- **Custom Fonts:** Any TTF/OTF file works the same way +- **System Fonts:** No setup required, best performance +- **Platform Compatibility:** Use `*FontPath` properties for both platforms + +The native bridge handles all font loading automatically once fonts are properly added to your project! \ No newline at end of file From c3a5b9792590037e701ba7d103f989dffe4ad0f1 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Sun, 20 Jul 2025 13:05:18 +0300 Subject: [PATCH 11/62] fix: lint --- FONTS_SETUP_GUIDE.md | 70 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/FONTS_SETUP_GUIDE.md b/FONTS_SETUP_GUIDE.md index 16a0230f4..5c0c6c903 100644 --- a/FONTS_SETUP_GUIDE.md +++ b/FONTS_SETUP_GUIDE.md @@ -16,6 +16,7 @@ This guide covers all ways to use fonts with the `setTheme` function in Instabug ## Overview The Instabug React Native bridge supports font loading from multiple sources: + - **App Bundle**: Fonts included in your app assets - **System Fonts**: Built-in platform fonts - **Custom Fonts**: Any TTF/OTF font files @@ -24,14 +25,17 @@ The Instabug React Native bridge supports font loading from multiple sources: ## Font Types Supported ### 1. Google Fonts + - Download TTF files from [Google Fonts](https://fonts.google.com/) - Examples: Roboto, Inter, Nunito, Open Sans, Lato ### 2. Custom Fonts + - Any TTF/OTF font files - Commercial fonts, free fonts, custom designs ### 3. System Fonts + - Platform default fonts - No setup required - Examples: San Francisco (iOS), Roboto (Android) @@ -41,6 +45,7 @@ The Instabug React Native bridge supports font loading from multiple sources: ### Method 1: Bundle Fonts (Recommended) #### Step 1: Download Font Files + ```bash # Create fonts directory mkdir fonts @@ -51,6 +56,7 @@ mkdir fonts ``` #### Step 2: Add to Android + ```bash # Create assets/fonts directory mkdir -p android/app/src/main/assets/fonts @@ -60,13 +66,16 @@ cp fonts/*.ttf android/app/src/main/assets/fonts/ ``` #### Step 3: Add to iOS + 1. **Add to Xcode Project:** + - Open your iOS project in Xcode - Right-click on your project → "Add Files to [ProjectName]" - Select your TTF files - Make sure "Add to target" is checked 2. **Update Info.plist:** + ```xml UIAppFonts @@ -78,6 +87,7 @@ cp fonts/*.ttf android/app/src/main/assets/fonts/ ``` #### Step 4: Use with setTheme + ```typescript import Instabug from 'instabug-reactnative'; import { Platform } from 'react-native'; @@ -88,19 +98,19 @@ const applyCustomTheme = () => { primaryColor: '#2196F3', backgroundColor: '#FFFFFF', primaryTextColor: '#333333', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // Fonts - Android (use font paths) ...(Platform.OS === 'android' && { primaryFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Regular.ttf', secondaryFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Light.ttf', ctaFontPath: '/data/user/0/com.yourapp/files/fonts/Roboto-Bold.ttf', }), - + // Fonts - iOS (use font paths, not assets) ...(Platform.OS === 'ios' && { primaryFontPath: 'fonts/Roboto-Regular.ttf', @@ -112,6 +122,7 @@ const applyCustomTheme = () => { ``` ### Method 2: System Fonts Only + ```typescript import Instabug from 'instabug-reactnative'; @@ -123,12 +134,12 @@ const applySystemTheme = () => { primaryTextColor: '#333333', secondaryTextColor: '#666666', titleTextColor: '#000000', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // No font paths = uses system fonts }); }; @@ -139,11 +150,13 @@ const applySystemTheme = () => { ### Method 1: Expo Fonts (Recommended for Expo) #### Step 1: Install Expo Fonts + ```bash npx expo install expo-font ``` #### Step 2: Download and Add Fonts + ```bash # Create fonts directory mkdir fonts @@ -153,6 +166,7 @@ mkdir fonts ``` #### Step 3: Configure app.json + ```json { "expo": { @@ -175,6 +189,7 @@ mkdir fonts ``` #### Step 4: Load Fonts in Your App + ```typescript import * as Font from 'expo-font'; import { useEffect, useState } from 'react'; @@ -203,6 +218,7 @@ export default function App() { ``` #### Step 5: Use with setTheme + ```typescript import Instabug from 'instabug-reactnative'; import { Platform } from 'react-native'; @@ -213,12 +229,12 @@ const applyExpoTheme = () => { primaryColor: '#2196F3', backgroundColor: '#FFFFFF', primaryTextColor: '#333333', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // Fonts - use font paths for both platforms primaryFontPath: 'fonts/Roboto-Regular.ttf', secondaryFontPath: 'fonts/Inter-Regular.ttf', @@ -228,16 +244,19 @@ const applyExpoTheme = () => { ``` ### Method 2: Expo with Bundle Fonts + Same as Regular React Native Method 1, but fonts are automatically included in the Expo build. ## Asset Linking Options ### Option 1: Manual Copy (Current Method) + - Copy TTF files to native directories - Update Info.plist manually - Works with all setups ### Option 2: React Native CLI Linking + ```bash # Create a react-native.config.js file module.exports = { @@ -246,11 +265,13 @@ module.exports = { ``` Then run: + ```bash npx react-native link ``` ### Option 3: Expo Asset Linking + ```json { "expo": { @@ -265,11 +286,13 @@ npx react-native link ``` ### Option 4: Metro Asset Plugin + ```bash npm install --save-dev react-native-asset ``` Create `react-native.config.js`: + ```javascript module.exports = { assets: ['./fonts/'], @@ -279,6 +302,7 @@ module.exports = { ## Usage Examples ### Example 1: Google Fonts (Roboto) + ```typescript // Download: Roboto-Regular.ttf, Roboto-Bold.ttf, Roboto-Light.ttf // Add to project using any method above @@ -290,12 +314,12 @@ const applyRobotoTheme = () => { primaryTextColor: '#212121', secondaryTextColor: '#757575', titleTextColor: '#000000', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // Font paths for both platforms primaryFontPath: 'fonts/Roboto-Regular.ttf', secondaryFontPath: 'fonts/Roboto-Light.ttf', @@ -305,6 +329,7 @@ const applyRobotoTheme = () => { ``` ### Example 2: Custom Fonts (Inter) + ```typescript // Download: Inter-Regular.ttf, Inter-Bold.ttf, Inter-Medium.ttf // Add to project using any method above @@ -316,12 +341,12 @@ const applyInterTheme = () => { primaryTextColor: '#1F2937', secondaryTextColor: '#6B7280', titleTextColor: '#111827', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // Font paths for both platforms primaryFontPath: 'fonts/Inter-Regular.ttf', secondaryFontPath: 'fonts/Inter-Medium.ttf', @@ -331,6 +356,7 @@ const applyInterTheme = () => { ``` ### Example 3: System Fonts Only + ```typescript const applySystemTheme = () => { Instabug.setTheme({ @@ -339,7 +365,7 @@ const applySystemTheme = () => { primaryTextColor: '#000000', secondaryTextColor: '#8E8E93', titleTextColor: '#000000', - + // Text styles (Android only) - no font paths = uses system fonts primaryTextStyle: 'normal', secondaryTextStyle: 'normal', @@ -349,6 +375,7 @@ const applySystemTheme = () => { ``` ### Example 4: Mixed Approach + ```typescript const applyMixedTheme = () => { Instabug.setTheme({ @@ -357,12 +384,12 @@ const applyMixedTheme = () => { primaryTextColor: '#2D3436', secondaryTextColor: '#636E72', titleTextColor: '#2D3436', - + // Text styles (Android only) primaryTextStyle: 'normal', secondaryTextStyle: 'normal', ctaTextStyle: 'bold', - + // Custom font only for CTA - rest use system fonts ctaFontPath: 'fonts/Roboto-Bold.ttf', }); @@ -408,8 +435,10 @@ Instabug.setTheme({ ### Common Issues #### 1. Font Not Loading + **Symptoms:** Font appears as system font or doesn't change **Solutions:** + - Check font filename matches exactly (case-sensitive) - Verify font is added to both Android and iOS - For iOS, check Info.plist entries @@ -417,22 +446,28 @@ Instabug.setTheme({ - **iOS users**: Make sure you're using `*FontPath` properties, not `*FontAsset` #### 2. Font Loading in Expo + **Symptoms:** Font works in development but not in production **Solutions:** + - Use `expo-font` to load fonts before app starts - Ensure fonts are included in app.json - Test with `expo build` or EAS Build #### 3. Font File Issues + **Symptoms:** App crashes or font doesn't load **Solutions:** + - Verify TTF file is not corrupted - Check file size (should be reasonable, not 0 bytes) - Ensure font file is valid TTF/OTF format #### 4. Performance Issues + **Symptoms:** App slow to start or font loading delays **Solutions:** + - Use system fonts for better performance - Limit number of custom fonts - Preload fonts in app initialization @@ -440,12 +475,14 @@ Instabug.setTheme({ ### Debug Steps 1. **Check Font Loading:** + ```typescript // Add this to debug font loading console.log('Available fonts:', Instabug.getAvailableFonts()); // If available ``` 2. **Verify File Paths:** + ```bash # Check if fonts are in the right place ls -la android/app/src/main/assets/fonts/ @@ -453,6 +490,7 @@ ls -la ios/YourApp/ ``` 3. **Test with System Fonts First:** + ```typescript // Test with system fonts to ensure setTheme works Instabug.setTheme({ @@ -469,7 +507,7 @@ Instabug.setTheme({ 4. **Test on Both Platforms:** Fonts may behave differently on iOS vs Android 5. **Use Standard Font Weights:** Regular, Bold, Light are most reliable 6. **Keep Font Files Small:** Optimize TTF files for mobile -7. **Use *FontPath Properties:** Ensures compatibility with both platforms +7. **Use \*FontPath Properties:** Ensures compatibility with both platforms ## Summary @@ -481,4 +519,4 @@ Instabug.setTheme({ - **System Fonts:** No setup required, best performance - **Platform Compatibility:** Use `*FontPath` properties for both platforms -The native bridge handles all font loading automatically once fonts are properly added to your project! \ No newline at end of file +The native bridge handles all font loading automatically once fonts are properly added to your project! From 45714518935bc24ff214b2ee8ad301be6f5311ac Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Sun, 20 Jul 2025 13:06:30 +0300 Subject: [PATCH 12/62] fix: rename some variables --- .../RNInstabugReactnativeModule.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index fa9d6cee7..551eecb09 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -1370,16 +1370,16 @@ public void run() { com.instabug.library.model.IBGTheme.Builder builder = new com.instabug.library.model.IBGTheme.Builder(); // Apply colors - applyColorIfPresent(themeConfig, builder, "primaryColor", (b, color) -> b.setPrimaryColor(color)); - applyColorIfPresent(themeConfig, builder, "secondaryTextColor", (b, color) -> b.setSecondaryTextColor(color)); - applyColorIfPresent(themeConfig, builder, "primaryTextColor", (b, color) -> b.setPrimaryTextColor(color)); - applyColorIfPresent(themeConfig, builder, "titleTextColor", (b, color) -> b.setTitleTextColor(color)); - applyColorIfPresent(themeConfig, builder, "backgroundColor", (b, color) -> b.setBackgroundColor(color)); + applyColorIfPresent(themeConfig, builder, "primaryColor", (themeBuilder, color) -> themeBuilder.setPrimaryColor(color)); + applyColorIfPresent(themeConfig, builder, "secondaryTextColor", (themeBuilder, color) -> themeBuilder.setSecondaryTextColor(color)); + applyColorIfPresent(themeConfig, builder, "primaryTextColor", (themeBuilder, color) -> themeBuilder.setPrimaryTextColor(color)); + applyColorIfPresent(themeConfig, builder, "titleTextColor", (themeBuilder, color) -> themeBuilder.setTitleTextColor(color)); + applyColorIfPresent(themeConfig, builder, "backgroundColor", (themeBuilder, color) -> themeBuilder.setBackgroundColor(color)); // Apply text styles - applyTextStyleIfPresent(themeConfig, builder, "primaryTextStyle", (b, style) -> b.setPrimaryTextStyle(style)); - applyTextStyleIfPresent(themeConfig, builder, "secondaryTextStyle", (b, style) -> b.setSecondaryTextStyle(style)); - applyTextStyleIfPresent(themeConfig, builder, "ctaTextStyle", (b, style) -> b.setCtaTextStyle(style)); + applyTextStyleIfPresent(themeConfig, builder, "primaryTextStyle", (themeBuilder, style) -> themeBuilder.setPrimaryTextStyle(style)); + applyTextStyleIfPresent(themeConfig, builder, "secondaryTextStyle", (themeBuilder, style) -> themeBuilder.setSecondaryTextStyle(style)); + applyTextStyleIfPresent(themeConfig, builder, "ctaTextStyle", (themeBuilder, style) -> themeBuilder.setCtaTextStyle(style)); setFontIfPresent(themeConfig, builder, "primaryFontPath", "primaryFontAsset", "primary"); setFontIfPresent(themeConfig, builder, "secondaryFontPath", "secondaryFontAsset", "secondary"); setFontIfPresent(themeConfig, builder, "ctaFontPath", "ctaFontAsset", "CTA"); From 190e36429bb88d712b3591887b52c944b81e13a3 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 20 Jul 2025 15:45:39 +0300 Subject: [PATCH 13/62] add screen render to sample app , add unit testing to android, ios and RN --- .../RNInstabugReactnativeModule.java | 45 ++- .../reactlibrary/RNInstabugAPMModuleTest.java | 8 + .../ios/InstabugTests/InstabugAPMTests.m | 25 ++ examples/default/src/navigation/HomeStack.tsx | 8 + .../default/src/screens/apm/APMScreen.tsx | 26 +- .../default/src/screens/apm/ScreenRender.tsx | 317 ++++++++++++++++++ test/mocks/mockAPM.ts | 1 + test/modules/APM.spec.ts | 7 + 8 files changed, 389 insertions(+), 48 deletions(-) create mode 100644 examples/default/src/screens/apm/ScreenRender.tsx diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 17f48656f..8507993ad 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -26,7 +26,6 @@ import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.uimanager.UIManagerModule; import com.instabug.apm.InternalAPM; -import com.instabug.apm.configuration.cp.APMFeature; import com.instabug.library.Feature; import com.instabug.library.Instabug; import com.instabug.library.InstabugColorTheme; @@ -35,12 +34,11 @@ import com.instabug.library.LogLevel; import com.instabug.library.ReproConfigurations; import com.instabug.library.core.InstabugCore; +import com.instabug.library.featuresflags.model.IBGFeatureFlag; import com.instabug.library.internal.crossplatform.CoreFeature; import com.instabug.library.internal.crossplatform.CoreFeaturesState; import com.instabug.library.internal.crossplatform.FeaturesStateListener; import com.instabug.library.internal.crossplatform.InternalCore; -import com.instabug.library.featuresflags.model.IBGFeatureFlag; -import com.instabug.library.internal.crossplatform.InternalCore; import com.instabug.library.internal.crossplatform.OnFeaturesUpdatedListener; import com.instabug.library.internal.module.InstabugLocale; import com.instabug.library.invocation.InstabugInvocationEvent; @@ -48,11 +46,9 @@ import com.instabug.library.model.NetworkLog; import com.instabug.library.model.Report; import com.instabug.library.ui.onboarding.WelcomeMessage; -import com.instabug.library.util.InstabugSDKLogger; import com.instabug.reactlibrary.utils.ArrayUtil; import com.instabug.reactlibrary.utils.EventEmitterModule; import com.instabug.reactlibrary.utils.MainThreadHandler; - import com.instabug.reactlibrary.utils.RNTouchedViewExtractor; import org.json.JSONException; @@ -115,6 +111,7 @@ public void removeListeners(Integer count) { /** * Enables or disables Instabug functionality. + * * @param isEnabled A boolean to enable/disable Instabug. */ @ReactMethod @@ -1175,7 +1172,7 @@ public void invoke(@NonNull CoreFeaturesState featuresState) { params.putBoolean("isW3ExternalTraceIDEnabled", featuresState.isW3CExternalTraceIdEnabled()); params.putBoolean("isW3ExternalGeneratedHeaderEnabled", featuresState.isAttachingGeneratedHeaderEnabled()); params.putBoolean("isW3CaughtHeaderEnabled", featuresState.isAttachingCapturedHeaderEnabled()); - params.putInt("networkBodyLimit",featuresState.getNetworkLogCharLimit()); + params.putInt("networkBodyLimit", featuresState.getNetworkLogCharLimit()); sendEvent(Constants.IBG_ON_FEATURE_FLAGS_UPDATE_RECEIVED_CALLBACK, params); } @@ -1259,7 +1256,7 @@ public void run() { * Map between the exported JS constant and the arg key in {@link ArgsRegistry}. * The constant name and the arg key should match to be able to resolve the * constant with its actual value from the {@link ArgsRegistry} maps. - * + *

* This is a workaround, because RN cannot resolve enums in the constants map. */ @Override @@ -1290,23 +1287,25 @@ public void invoke() { } }); } + /** - * Enables or disables capturing network body. - * @param isEnabled A boolean to enable/disable capturing network body. - */ - @ReactMethod - public void setNetworkLogBodyEnabled(final boolean isEnabled) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Instabug.setNetworkLogBodyEnabled(isEnabled); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } + * Enables or disables capturing network body. + * + * @param isEnabled A boolean to enable/disable capturing network body. + */ + @ReactMethod + public void setNetworkLogBodyEnabled(final boolean isEnabled) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + Instabug.setNetworkLogBodyEnabled(isEnabled); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } /** * Sets the auto mask screenshots types. diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java index 85ca1384d..63445978f 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java @@ -205,5 +205,13 @@ public void testSetFlowAttribute() { APM.endUITrace(); } + @Test + public void given$setScreenRenderEnabled_whenQuery_thenShouldCallNativeApiWithEnabled() { + apmModule.setScreenRenderEnabled(true); + // then + verify(APM.class, times(1)); + APM.setScreenRenderingEnabled(true); + } + } diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 949393adb..53ae18962 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -176,7 +176,32 @@ - (void) testEndUITrace { [self.instabugBridge endUITrace]; OCMVerify([mock endUITrace]); } +// +//- (void) testSetScreenRenderEnabled { +// id mock = OCMClassMock([IBGAPM class]); +// BOOL isEnabled = YES; +// +// OCMStub([mock enabled:isEnabled]); +// [self.instabugBridge setScreenRenderEnabled:isEnabled]; +// OCMVerify([mock setScreenRenderEnabled:isEnabled]); +//} + +- (void) testSetScreenRenderEnabled { + id mock = OCMClassMock([IBGAPM class]); + NSNumber *isEnabled = @1; + + [self.instabugBridge setScreenRenderEnabled:isEnabled]; + OCMVerify([mock setScreenRenderingEnabled:YES]); +} + +- (void) testSetScreenRenderDisabled { + id mock = OCMClassMock([IBGAPM class]); + NSNumber *isEnabled = @0; + [self.instabugBridge setScreenRenderEnabled:isEnabled]; + + OCMVerify([mock setScreenRenderingEnabled:NO]); +} @end diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index 090aa6587..ef19126a1 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -31,6 +31,7 @@ import { HttpScreen } from '../screens/apm/HttpScreen'; import { WebViewsScreen } from '../screens/apm/webViews/WebViewsScreen'; import { FullWebViewsScreen } from '../screens/apm/webViews/FullWebViewsScreen'; import { PartialWebViewsScreen } from '../screens/apm/webViews/PartialWebViewsScreen'; +import ScreenRender from '../screens/apm/ScreenRender'; export type HomeStackParamList = { Home: undefined; @@ -61,6 +62,7 @@ export type HomeStackParamList = { WebViews: undefined; FullWebViews: undefined; PartialWebViews: undefined; + ScreenRender: undefined; }; const HomeStack = createNativeStackNavigator(); @@ -163,6 +165,12 @@ export const HomeStackNavigator: React.FC = () => { component={PartialWebViewsScreen} options={{ title: 'PartialWebViews' }} /> + + ); }; diff --git a/examples/default/src/screens/apm/APMScreen.tsx b/examples/default/src/screens/apm/APMScreen.tsx index f072fba07..2f5dbf601 100644 --- a/examples/default/src/screens/apm/APMScreen.tsx +++ b/examples/default/src/screens/apm/APMScreen.tsx @@ -38,31 +38,7 @@ export const APMScreen: React.FC navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> - - { - // Simulate slow rendering - const heavyComputation = () => { - for (let i = 0; i < 1000000; i++) { - Math.random() * Math.random(); - } - }; - heavyComputation(); - showNotification('Slow Frames', 'Heavy computation executed to simulate slow frames'); - }} - /> - { - const freezeDuration = 3000; // 3 seconds - const start = Date.now(); - while (Date.now() - start < freezeDuration) { - // Busy wait to block JS thread - } - showNotification('Frozen Frames', `UI frozen for ${freezeDuration / 1000} seconds`); - }} - /> + navigation.navigate('ScreenRender')} /> ); }; diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx new file mode 100644 index 000000000..e49e92f21 --- /dev/null +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -0,0 +1,317 @@ +import { NativeStackScreenProps } from '@react-navigation/native-stack'; +import React, { useState, useEffect, useRef } from 'react'; +import { + View, + Text, + StyleSheet, + TouchableOpacity, + ScrollView, + SafeAreaView, + Animated, +} from 'react-native'; +import { HomeStackParamList } from '../../navigation/HomeStack'; +import { APM } from 'instabug-reactnative'; + +// CustomComponents +const ScreenRenderSwitch: React.FC = () => { + const [isEnabled, setIsEnabled] = useState(false); + + return ( + + Screen Render Monitoring + { + setIsEnabled(!isEnabled); + APM.setScreenRenderEnabled(isEnabled); + }}> + + + + ); +}; + +const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { + const [counter, setCounter] = useState(0); + const animatedValue = useRef(new Animated.Value(0)).current; + const intervalRef = useRef(null); + + // Continuous animation + useEffect(() => { + const animation = Animated.loop( + Animated.sequence([ + Animated.timing(animatedValue, { + toValue: 1, + duration: 1000, + useNativeDriver: true, + }), + Animated.timing(animatedValue, { + toValue: 0, + duration: 1000, + useNativeDriver: true, + }), + ]), + ); + animation.start(); + + return () => animation.stop(); + }, []); + + // High frequency counter updates to force re-renders + useEffect(() => { + intervalRef.current = setInterval(() => { + setCounter((prev) => { + // This is where we block if isBlocking is true + if (isBlocking) { + const startTime = Date.now(); + // Block for 100ms every render cycle + while (Date.now() - startTime < 100) { + // Busy wait - this will cause visible frozen frames + } + } + return prev + 1; + }); + }, 16); // ~60fps updates + + return () => { + if (intervalRef.current) { + clearInterval(intervalRef.current); + } + }; + }, [isBlocking]); + + const translateX = animatedValue.interpolate({ + inputRange: [0, 1], + outputRange: [0, 100], + }); + + return ( + + Frame Counter: {counter} + + {isBlocking ? 'FROZEN!' : 'Smooth'} + + + ); +}; + +interface InstabugButtonProps { + text: string; + onPress: () => void; + disabled?: boolean; +} + +const InstabugButton: React.FC = ({ text, onPress, disabled }) => { + return ( + + {text} + + ); +}; + +// Main Component +const ScreenRenderPage: React.FC> = ({ + navigation, +}) => { + const [isBlocking, setIsBlocking] = useState(false); + const blockingTimeoutRef = useRef(null); + + const triggerSlowFrames = (): void => { + setIsBlocking(true); + + // Clear any existing timeout + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + + // Stop blocking after 3 seconds + blockingTimeoutRef.current = setTimeout(() => { + setIsBlocking(false); + }, 500); + }; + + const triggerFrozenFrames = (): void => { + setIsBlocking(true); + + // Clear any existing timeout + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + + // Stop blocking after 5 seconds + blockingTimeoutRef.current = setTimeout(() => { + setIsBlocking(false); + }, 3000); + }; + + const navigateToComplexPage = (): void => { + navigation.navigate('ComplexViews'); + }; + + // Cleanup timeout on unmount + useEffect(() => { + return () => { + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + }; + }, []); + + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#f5f5f5', + }, + scrollContent: { + padding: 20, + }, + title: { + fontSize: 24, + fontWeight: 'bold', + textAlign: 'center', + marginBottom: 20, + color: '#333', + }, + spacer: { + height: 16, + }, + largeSpacer: { + height: 50, + }, + buttonContainer: { + gap: 12, + }, + button: { + backgroundColor: '#007AFF', + paddingVertical: 12, + paddingHorizontal: 20, + borderRadius: 8, + alignItems: 'center', + marginVertical: 4, + }, + buttonText: { + color: 'white', + fontSize: 16, + fontWeight: '600', + }, + buttonDisabled: { + backgroundColor: '#ccc', + opacity: 0.7, + }, + buttonTextDisabled: { + color: '#888', + }, + switchContainer: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingVertical: 12, + paddingHorizontal: 16, + backgroundColor: 'white', + borderRadius: 8, + marginVertical: 8, + }, + switchLabel: { + fontSize: 16, + color: '#333', + }, + switch: { + width: 50, + height: 30, + borderRadius: 15, + backgroundColor: '#ccc', + justifyContent: 'center', + padding: 2, + }, + switchEnabled: { + backgroundColor: '#007AFF', + }, + switchThumb: { + width: 26, + height: 26, + borderRadius: 13, + backgroundColor: 'white', + alignSelf: 'flex-start', + }, + switchThumbEnabled: { + alignSelf: 'flex-end', + }, + animatedContainer: { + alignItems: 'center', + paddingVertical: 20, + backgroundColor: 'white', + borderRadius: 8, + marginVertical: 8, + }, + counterText: { + fontSize: 18, + fontWeight: 'bold', + color: '#333', + marginBottom: 15, + }, + animatedBox: { + width: 100, + height: 60, + backgroundColor: '#FF6B6B', + borderRadius: 8, + justifyContent: 'center', + alignItems: 'center', + transform: [{ scale: 1 }], + }, + animatedBoxActive: { + backgroundColor: '#4ECDC4', + transform: [{ scale: 1.1 }], + }, + animatedBoxText: { + color: 'white', + fontSize: 14, + fontWeight: '600', + textAlign: 'center', + }, +}); + +export default ScreenRenderPage; + +// Export the screen name constant for navigation +export const SCREEN_NAME = 'ScreenRender'; diff --git a/test/mocks/mockAPM.ts b/test/mocks/mockAPM.ts index 27644c694..beb0b068b 100644 --- a/test/mocks/mockAPM.ts +++ b/test/mocks/mockAPM.ts @@ -17,6 +17,7 @@ const mockAPM: ApmNativeModule = { endAppLaunch: jest.fn(), ibgSleep: jest.fn(), networkLogAndroid: jest.fn(), + setScreenRenderEnabled: jest.fn(), }; export default mockAPM; diff --git a/test/modules/APM.spec.ts b/test/modules/APM.spec.ts index cf932d25c..39d5df4be 100644 --- a/test/modules/APM.spec.ts +++ b/test/modules/APM.spec.ts @@ -155,4 +155,11 @@ describe('APM Module', () => { expect(NativeAPM.ibgSleep).toBeCalledTimes(1); expect(NativeAPM.ibgSleep).toBeCalledWith(); }); + + it('should call the native method setScreenRenderEnabled', () => { + APM.setScreenRenderEnabled(true); + + expect(NativeAPM.setScreenRenderEnabled).toBeCalledTimes(1); + expect(NativeAPM.setScreenRenderEnabled).toBeCalledWith(true); + }); }); From 0f9365f20f714de7963b88e1f59866437c608c35 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 20 Jul 2025 16:38:47 +0300 Subject: [PATCH 14/62] fix format --- .../default/ios/InstabugTests/InstabugAPMTests.m | 13 ++----------- examples/default/ios/Podfile.lock | 4 ++-- examples/default/src/navigation/HomeStack.tsx | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 53ae18962..cac456550 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -176,19 +176,10 @@ - (void) testEndUITrace { [self.instabugBridge endUITrace]; OCMVerify([mock endUITrace]); } -// -//- (void) testSetScreenRenderEnabled { -// id mock = OCMClassMock([IBGAPM class]); -// BOOL isEnabled = YES; -// -// OCMStub([mock enabled:isEnabled]); -// [self.instabugBridge setScreenRenderEnabled:isEnabled]; -// OCMVerify([mock setScreenRenderEnabled:isEnabled]); -//} - (void) testSetScreenRenderEnabled { id mock = OCMClassMock([IBGAPM class]); - NSNumber *isEnabled = @1; + BOOL isEnabled = YES; [self.instabugBridge setScreenRenderEnabled:isEnabled]; @@ -197,7 +188,7 @@ - (void) testSetScreenRenderEnabled { - (void) testSetScreenRenderDisabled { id mock = OCMClassMock([IBGAPM class]); - NSNumber *isEnabled = @0; + BOOL isEnabled = NO; [self.instabugBridge setScreenRenderEnabled:isEnabled]; diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ddf819b04..046a940fa 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index ef19126a1..c3d09797f 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -170,7 +170,6 @@ export const HomeStackNavigator: React.FC = () => { component={ScreenRender} options={{ title: 'ScreenRender' }} /> - ); }; From ca776921097d1ccc8baa4ec4314df7a945e713af Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 21 Jul 2025 18:00:53 +0300 Subject: [PATCH 15/62] update the sample app --- .../default/src/screens/apm/ScreenRender.tsx | 244 +++++++++++++----- 1 file changed, 186 insertions(+), 58 deletions(-) diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index e49e92f21..687143e08 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -1,18 +1,18 @@ -import { NativeStackScreenProps } from '@react-navigation/native-stack'; -import React, { useState, useEffect, useRef } from 'react'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import React, { useEffect, useRef, useState } from 'react'; import { - View, - Text, + Animated, + SafeAreaView, + ScrollView, StyleSheet, + Text, TouchableOpacity, - ScrollView, - SafeAreaView, - Animated, + View, } from 'react-native'; -import { HomeStackParamList } from '../../navigation/HomeStack'; +import type { HomeStackParamList } from '../../navigation/HomeStack'; import { APM } from 'instabug-reactnative'; -// CustomComponents +// Custom Components const ScreenRenderSwitch: React.FC = () => { const [isEnabled, setIsEnabled] = useState(false); @@ -31,46 +31,45 @@ const ScreenRenderSwitch: React.FC = () => { ); }; -const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { +const AnimatedBox: React.FC<{ isBlocking: boolean; blockingIntensity: number }> = ({ + isBlocking, + blockingIntensity, +}) => { const [counter, setCounter] = useState(0); + const [layoutThrasher, setLayoutThrasher] = useState(0); const animatedValue = useRef(new Animated.Value(0)).current; const intervalRef = useRef(null); - // Continuous animation + // Continuous animation - Use native driver for native thread work useEffect(() => { const animation = Animated.loop( Animated.sequence([ Animated.timing(animatedValue, { toValue: 1, duration: 1000, - useNativeDriver: true, + useNativeDriver: true, // Native driver for native thread }), Animated.timing(animatedValue, { toValue: 0, duration: 1000, - useNativeDriver: true, + useNativeDriver: true, // Native driver for native thread }), ]), ); animation.start(); return () => animation.stop(); - }, []); + }, [animatedValue]); - // High frequency counter updates to force re-renders + // High frequency counter updates useEffect(() => { intervalRef.current = setInterval(() => { - setCounter((prev) => { - // This is where we block if isBlocking is true - if (isBlocking) { - const startTime = Date.now(); - // Block for 100ms every render cycle - while (Date.now() - startTime < 100) { - // Busy wait - this will cause visible frozen frames - } - } - return prev + 1; - }); + setCounter((prev) => prev + 1); + + // Layout thrashing to block native thread + if (isBlocking) { + setLayoutThrasher((prev) => prev + 1); + } }, 16); // ~60fps updates return () => { @@ -85,19 +84,121 @@ const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { outputRange: [0, 100], }); + const getStatusText = () => { + if (!isBlocking) { + return 'Running Smoothly'; + } + if (blockingIntensity === 1) { + return 'SLOW NATIVE RENDERING!'; + } + if (blockingIntensity === 2) { + return 'FROZEN NATIVE THREAD!'; + } + return 'BLOCKING NATIVE THREAD!'; + }; + + const getBoxColor = () => { + if (!isBlocking) { + return '#4ECDC4'; + } + if (blockingIntensity === 1) { + return '#FFB347'; + } // Orange for slow + if (blockingIntensity === 2) { + return '#FF6B6B'; + } // Red for frozen + return '#FF6B6B'; + }; + + // Generate many layout-heavy elements to stress native thread + const generateHeavyNativeElements = () => { + if (!isBlocking) return null; + + const elementCount = blockingIntensity === 1 ? 50 : 200; // More elements = more native work + + return Array.from({ length: elementCount }, (_, i) => ( + + )); + }; + return ( Frame Counter: {counter} - + Status: {getStatusText()} + + + {/* Native thread heavy work area */} + + - {isBlocking ? 'FROZEN!' : 'Smooth'} - + width: 60, + height: 60, + borderRadius: 30, + justifyContent: 'center', + alignItems: 'center', + }}> + + {blockingIntensity === 1 ? 'Slow!' : blockingIntensity === 2 ? 'Frozen!' : 'Smooth'} + + + + {/* Heavy native rendering elements */} + {generateHeavyNativeElements()} + + + {/* Additional native-heavy components */} + {isBlocking && ( + + {/* Multiple ScrollViews to stress native scrolling */} + + {Array.from({ length: 100 }, (_, i) => ( + + ))} + + + {/* Text that forces layout recalculation */} + + Layout Thrashing Text: {layoutThrasher} + + + )} ); }; @@ -124,24 +225,12 @@ const ScreenRenderPage: React.FC { const [isBlocking, setIsBlocking] = useState(false); + const [blockingIntensity, setBlockingIntensity] = useState(0); // 0 = none, 1 = slow, 2 = frozen const blockingTimeoutRef = useRef(null); - const triggerSlowFrames = (): void => { - setIsBlocking(true); - - // Clear any existing timeout - if (blockingTimeoutRef.current) { - clearTimeout(blockingTimeoutRef.current); - } - - // Stop blocking after 3 seconds - blockingTimeoutRef.current = setTimeout(() => { - setIsBlocking(false); - }, 500); - }; - const triggerFrozenFrames = (): void => { setIsBlocking(true); + setBlockingIntensity(2); // Frozen frames mode // Clear any existing timeout if (blockingTimeoutRef.current) { @@ -151,7 +240,8 @@ const ScreenRenderPage: React.FC { setIsBlocking(false); - }, 3000); + setBlockingIntensity(0); + }, 5000); }; const navigateToComplexPage = (): void => { @@ -174,19 +264,13 @@ const ScreenRenderPage: React.FC - + - - @@ -309,6 +393,50 @@ const styles = StyleSheet.create({ fontWeight: '600', textAlign: 'center', }, + statusText: { + fontSize: 16, + color: '#666', + marginBottom: 10, + }, + statusTextAlert: { + color: '#FF6B6B', // Red for alert + fontWeight: 'bold', + }, + additionalElements: { + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'center', + marginTop: 20, + }, + smallBox: { + width: 30, + height: 30, + margin: 5, + borderRadius: 15, + }, + nativeWorkArea: { + position: 'relative', + width: 200, + height: 200, + backgroundColor: '#f0f0f0', + borderRadius: 10, + justifyContent: 'center', + alignItems: 'center', + marginVertical: 10, + borderWidth: 1, + borderColor: '#ccc', + }, + heavyNativeSection: { + marginTop: 20, + alignItems: 'center', + }, + miniScrollView: { + width: '100%', + height: 100, + backgroundColor: '#e0e0e0', + borderRadius: 8, + marginBottom: 10, + }, }); export default ScreenRenderPage; From 8bb2986d746ff93ff2c06717986918184ff62327 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 21 Jul 2025 19:03:13 +0300 Subject: [PATCH 16/62] chore: fix lint --- examples/default/src/screens/apm/ScreenRender.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index 687143e08..397a29946 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-native/no-inline-styles */ import type { NativeStackScreenProps } from '@react-navigation/native-stack'; import React, { useEffect, useRef, useState } from 'react'; import { @@ -112,7 +113,9 @@ const AnimatedBox: React.FC<{ isBlocking: boolean; blockingIntensity: number }> // Generate many layout-heavy elements to stress native thread const generateHeavyNativeElements = () => { - if (!isBlocking) return null; + if (!isBlocking) { + return null; + } const elementCount = blockingIntensity === 1 ? 50 : 200; // More elements = more native work @@ -440,6 +443,3 @@ const styles = StyleSheet.create({ }); export default ScreenRenderPage; - -// Export the screen name constant for navigation -export const SCREEN_NAME = 'ScreenRender'; From 535c4abb6b4896f0c1218a47b47d3573ddf6aa12 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Tue, 22 Jul 2025 15:04:57 +0300 Subject: [PATCH 17/62] chore: first commit --- examples/default/ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 046a940fa..ddf819b04 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 From b7e259a7a7f66daa7b0de0b35c2235d33988c4a9 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Wed, 23 Jul 2025 10:10:06 +0300 Subject: [PATCH 18/62] chore: fix Podfile.lock --- examples/default/ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ddf819b04..046a940fa 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 From db2da26ee9ad27c08c66f7ce42b8de22fc185dcd Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 27 Jul 2025 10:56:22 +0300 Subject: [PATCH 19/62] chore: refactor example app, add new screen for custom traces, update native dependencies --- android/native.gradle | 2 +- examples/default/ios/Podfile | 2 +- examples/default/src/navigation/HomeStack.tsx | 9 ++- .../default/src/screens/apm/APMScreen.tsx | 3 +- .../src/screens/apm/CustomUITraceScreen.tsx | 58 +++++++++++++++++++ ...cesScreen.tsx => ExecutionTraceScreen.tsx} | 2 +- .../default/src/screens/apm/ScreenRender.tsx | 4 +- .../screens/user-steps/ComplexViewsScreen.tsx | 11 ++-- ios/native.rb | 2 +- 9 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 examples/default/src/screens/apm/CustomUITraceScreen.tsx rename examples/default/src/screens/apm/{TracesScreen.tsx => ExecutionTraceScreen.tsx} (97%) diff --git a/android/native.gradle b/android/native.gradle index f33c0b543..d9c7a2f5b 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.1.6985154-SNAPSHOT' + version: '15.0.2.7020723-SNAPSHOT' ] dependencies { diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index d8659054c..7b4496b80 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index c3d09797f..0eafe75cb 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -22,7 +22,8 @@ import { import { GoogleMapsScreen } from '../screens/user-steps/GoogleMapsScreen'; import { LargeImageListScreen } from '../screens/user-steps/LargeImageListScreen'; import { APMScreen } from '../screens/apm/APMScreen'; -import { TracesScreen } from '../screens/apm/TracesScreen'; +import { ExecutionTraceScreen } from '../screens/apm/ExecutionTraceScreen'; +import { CustomUITraceScreen } from '../screens/apm/CustomUITraceScreen'; import { NetworkScreen } from '../screens/apm/NetworkScreen'; import { FlowsScreen } from '../screens/apm/FlowsScreen'; import { SessionReplayScreen } from '../screens/SessionReplayScreen'; @@ -44,7 +45,7 @@ export type HomeStackParamList = { BasicComponents: undefined; ScrollView: undefined; FlatList: undefined; - ComplexViews: undefined; + ComplexViews: { initialDepth?: number; initialBreadth?: number } | undefined; SectionList: undefined; Gestures: undefined; GoogleMapsScreen: undefined; @@ -58,6 +59,7 @@ export type HomeStackParamList = { APM: undefined; NetworkTraces: undefined; ExecutionTraces: undefined; + CustomUITraces: undefined; AppFlows: undefined; WebViews: undefined; FullWebViews: undefined; @@ -142,7 +144,8 @@ export const HomeStackNavigator: React.FC = () => { - + + APM.endAppLaunch()} /> navigation.navigate('NetworkTraces')} /> - navigation.navigate('ExecutionTraces')} /> + navigation.navigate('ExecutionTraces')} /> + navigation.navigate('CustomUITraces')} /> navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> diff --git a/examples/default/src/screens/apm/CustomUITraceScreen.tsx b/examples/default/src/screens/apm/CustomUITraceScreen.tsx new file mode 100644 index 000000000..f03b13334 --- /dev/null +++ b/examples/default/src/screens/apm/CustomUITraceScreen.tsx @@ -0,0 +1,58 @@ +import React, { useState } from 'react'; +import { APM } from 'instabug-reactnative'; +import { ScrollView } from 'react-native'; +import { Section } from '../../components/Section'; +import { Screen } from '../../components/Screen'; +import { VStack } from 'native-base'; +import { InputField } from '../../components/InputField'; +import { CustomButton } from '../../components/CustomButton'; +import BackgroundTimer from 'react-native-background-timer'; + +export const CustomUITraceScreen: React.FC = () => { + const [traceName, setTraceName] = useState(''); + + function startUITrace() { + if (!traceName.trim()) { + console.log('Please enter a trace name before starting.'); + return; + } + APM.startUITrace(traceName); + + console.log(`UI trace "${traceName}" started.`); + } + + function startDelayedUITrace() { + if (!traceName.trim()) { + console.log('Please enter a trace name before starting.'); + return; + } + return BackgroundTimer.setTimeout(() => { + APM.startUITrace(traceName); + console.log(`Delayed UI trace "${traceName}" started.`); + }, 5000); + } + + function endUITrace() { + APM.endUITrace(); + console.log('UI trace ended.'); + } + + return ( + + +

+ + setTraceName(text)} + value={traceName} + /> + + + + +
+ + + ); +}; diff --git a/examples/default/src/screens/apm/TracesScreen.tsx b/examples/default/src/screens/apm/ExecutionTraceScreen.tsx similarity index 97% rename from examples/default/src/screens/apm/TracesScreen.tsx rename to examples/default/src/screens/apm/ExecutionTraceScreen.tsx index bd3e41838..c25c14cae 100644 --- a/examples/default/src/screens/apm/TracesScreen.tsx +++ b/examples/default/src/screens/apm/ExecutionTraceScreen.tsx @@ -8,7 +8,7 @@ import { InputField } from '../../components/InputField'; import { CustomButton } from '../../components/CustomButton'; import BackgroundTimer from 'react-native-background-timer'; -export const TracesScreen: React.FC = () => { +export const ExecutionTraceScreen: React.FC = () => { const [traceName, setTraceName] = useState(''); const [traceAttributeKey, setTraceAttributeKey] = useState(''); const [traceAttributeValue, setTraceAttributeValue] = useState(''); diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index 397a29946..f9113a2c8 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -248,7 +248,7 @@ const ScreenRenderPage: React.FC { - navigation.navigate('ComplexViews'); + navigation.navigate('ComplexViews', { initialDepth: 10, initialBreadth: 2 }); }; // Cleanup timeout on unmount @@ -273,7 +273,7 @@ const ScreenRenderPage: React.FC diff --git a/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx b/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx index 0035d5775..b6fc337a6 100644 --- a/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx +++ b/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx @@ -1,4 +1,6 @@ import React, { useRef, useState } from 'react'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import type { HomeStackParamList } from '../../navigation/HomeStack'; import { Screen } from '../../components/Screen'; import { Section } from '../../components/Section'; @@ -7,10 +9,11 @@ import { Button } from 'react-native'; import { ScrollView, VStack } from 'native-base'; import { InputField } from '../../components/InputField'; -export const ComplexViewsScreen: React.FC = () => { - const initialDepth = 10; - const initialBreadth = 2; - +export const ComplexViewsScreen: React.FC< + NativeStackScreenProps +> = ({ route }) => { + const initialDepth = route.params?.initialDepth ?? 10; + const initialBreadth = route.params?.initialBreadth ?? 2; const depthRef = useRef(initialDepth); const breadthRef = useRef(initialBreadth); diff --git a/ios/native.rb b/ios/native.rb index 08e43fdae..a62fd4577 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.15' } +$instabug = { :version => '15.1.16' } def use_instabug! (spec = nil) version = $instabug[:version] From 556220ecd9ba3e24c16195064588240238b8876f Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 27 Jul 2025 11:01:34 +0300 Subject: [PATCH 20/62] chore: push Podfile.lock --- examples/default/ios/Podfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 046a940fa..6795679c7 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.15) + - Instabug (15.1.16) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.15) + - Instabug (= 15.1.16) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2024,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: ed81d3e95f406f0e6d808e91a42dae929dfd4908 + Instabug: 9fcae5627558e1832a0f49c81bb26c20aaf8af7f instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2092,7 +2092,7 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: fc1585dd6ede766139ab908b103d43efdcc8899a + RNInstabug: 62ac32fd0a0ecb7720aa115fec391e74b8bd5a27 RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d @@ -2100,6 +2100,6 @@ SPEC CHECKSUMS: SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 -PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 +PODFILE CHECKSUM: 06ff71958843b5a526fbd11ecc1aad124421d74f COCOAPODS: 1.14.0 From eb03bcaacdf8ff678508b3d578801d5dd9f103af Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 10:43:27 +0300 Subject: [PATCH 21/62] chore: remove deperecated APIs --- examples/default/src/navigation/HomeStack.tsx | 2 - .../default/src/screens/apm/APMScreen.tsx | 1 - .../default/src/screens/apm/TracesScreen.tsx | 70 ------------------- ios/RNInstabug/InstabugAPMBridge.m | 35 ---------- ios/RNInstabug/InstabugBugReportingBridge.m | 2 +- ios/RNInstabug/InstabugReactBridge.m | 14 +--- src/index.ts | 2 - src/models/Trace.ts | 33 --------- src/modules/APM.ts | 24 ------- src/modules/BugReporting.ts | 5 +- src/modules/Instabug.ts | 34 ++------- src/native/NativeAPM.ts | 4 -- src/native/NativeInstabug.ts | 4 -- test/models/Trace.spec.ts | 39 ----------- test/modules/APM.spec.ts | 56 +-------------- 15 files changed, 11 insertions(+), 314 deletions(-) delete mode 100644 examples/default/src/screens/apm/TracesScreen.tsx delete mode 100644 src/models/Trace.ts delete mode 100644 test/models/Trace.spec.ts diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index 090aa6587..f3ebbf79b 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -22,7 +22,6 @@ import { import { GoogleMapsScreen } from '../screens/user-steps/GoogleMapsScreen'; import { LargeImageListScreen } from '../screens/user-steps/LargeImageListScreen'; import { APMScreen } from '../screens/apm/APMScreen'; -import { TracesScreen } from '../screens/apm/TracesScreen'; import { NetworkScreen } from '../screens/apm/NetworkScreen'; import { FlowsScreen } from '../screens/apm/FlowsScreen'; import { SessionReplayScreen } from '../screens/SessionReplayScreen'; @@ -140,7 +139,6 @@ export const HomeStackNavigator: React.FC = () => { - APM.endAppLaunch()} /> navigation.navigate('NetworkTraces')} /> - navigation.navigate('ExecutionTraces')} /> navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> diff --git a/examples/default/src/screens/apm/TracesScreen.tsx b/examples/default/src/screens/apm/TracesScreen.tsx deleted file mode 100644 index bd3e41838..000000000 --- a/examples/default/src/screens/apm/TracesScreen.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import React, { useState } from 'react'; -import { APM, Trace } from 'instabug-reactnative'; -import { ScrollView } from 'react-native'; -import { Section } from '../../components/Section'; -import { Screen } from '../../components/Screen'; -import { VStack } from 'native-base'; -import { InputField } from '../../components/InputField'; -import { CustomButton } from '../../components/CustomButton'; -import BackgroundTimer from 'react-native-background-timer'; - -export const TracesScreen: React.FC = () => { - const [traceName, setTraceName] = useState(''); - const [traceAttributeKey, setTraceAttributeKey] = useState(''); - const [traceAttributeValue, setTraceAttributeValue] = useState(''); - let executionTrace: Trace; - - async function startTrace() { - executionTrace = await APM.startExecutionTrace(traceName ?? ''); - } - - async function startDelayedTrace() { - return BackgroundTimer.setTimeout(async () => { - executionTrace = await APM.startExecutionTrace(traceName ?? ''); - }, 5000); - } - - function setTraceAttribute() { - if (!executionTrace) { - console.log('Please, start a trace before setting attributes.'); - } - return executionTrace.setAttribute(traceAttributeKey ?? '', traceAttributeValue ?? ''); - } - - function endExecutionTrace() { - if (!executionTrace) { - console.log('Please, start a trace before ending it.'); - } - return executionTrace.end(); - } - - return ( - - -
- - setTraceName(text)} - value={traceName} - /> - - - setTraceAttributeKey(text)} - value={traceAttributeKey} - /> - setTraceAttributeValue(text)} - value={traceAttributeValue} - /> - - - -
-
-
- ); -}; diff --git a/ios/RNInstabug/InstabugAPMBridge.m b/ios/RNInstabug/InstabugAPMBridge.m index c28c7f425..29319264d 100644 --- a/ios/RNInstabug/InstabugAPMBridge.m +++ b/ios/RNInstabug/InstabugAPMBridge.m @@ -61,41 +61,6 @@ - (id) init IBGAPM.autoUITraceEnabled = isEnabled; } -// Starts new execution trace with the specified `name`. -// -// Deprecated see [startFlow: (NSString *)name] -RCT_EXPORT_METHOD(startExecutionTrace:(NSString *)name :(NSString *)id - :(RCTPromiseResolveBlock)resolve - :(RCTPromiseRejectBlock)reject) { - IBGExecutionTrace *trace = [IBGAPM startExecutionTraceWithName:name]; - if (trace != nil) { - [traces setObject: trace forKey: id]; - resolve(id); - } else { - resolve([NSNull null]); - } -} - -// Sets a user defined attribute for the execution trace. -// -// Deprecated see [setFlowAttribute:(NSString *)name :(NSString *)key :(NSString *_Nullable)value] -RCT_EXPORT_METHOD(setExecutionTraceAttribute:(NSString *)id :(NSString *)key :(NSString *)value) { - IBGExecutionTrace *trace = [traces objectForKey:id]; - if (trace != nil) { - [trace setAttributeWithKey:key value:value]; - } -} - -// Ends execution trace with the specified `name`. -// -// Deprecated see [endFlow: (NSString *)name] -RCT_EXPORT_METHOD(endExecutionTrace:(NSString *)id) { - IBGExecutionTrace *trace = [traces objectForKey:id]; - if (trace != nil) { - [trace end]; - } -} - // Starts a flow trace with the specified `name`, // allowing the SDK to capture and analyze the flow of execution within the application. RCT_EXPORT_METHOD(startFlow: (NSString *)name) { diff --git a/ios/RNInstabug/InstabugBugReportingBridge.m b/ios/RNInstabug/InstabugBugReportingBridge.m index 75e058eb7..e5833e2c4 100644 --- a/ios/RNInstabug/InstabugBugReportingBridge.m +++ b/ios/RNInstabug/InstabugBugReportingBridge.m @@ -216,7 +216,7 @@ - (void) showBugReportingWithReportTypeAndOptionsHelper:(NSArray*)args { } } - [IBGBugReporting setCommentMinimumCharacterCountForReportTypes:parsedReportTypes withLimit:limit.intValue]; + [IBGBugReporting setCommentMinimumCharacterCount:limit.intValue forBugReportType:parsedReportTypes]; } RCT_EXPORT_METHOD(addUserConsent:(NSString *)key diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index a48851ba8..e86479067 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -170,7 +170,7 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(setPrimaryColor:(UIColor *)color) { - Instabug.tintColor = color; + Instabug.theme.primaryColor = color; } RCT_EXPORT_METHOD(appendTags:(NSArray *)tags) { @@ -355,18 +355,6 @@ - (dispatch_queue_t)methodQueue { } } -RCT_EXPORT_METHOD(addExperiments:(NSArray *)experiments) { - [Instabug addExperiments:experiments]; -} - -RCT_EXPORT_METHOD(removeExperiments:(NSArray *)experiments) { - [Instabug removeExperiments:experiments]; -} - -RCT_EXPORT_METHOD(clearAllExperiments) { - [Instabug clearAllExperiments]; -} - RCT_EXPORT_METHOD(addFeatureFlags:(NSDictionary *)featureFlagsMap) { NSMutableArray *featureFlags = [NSMutableArray array]; for(id key in featureFlagsMap){ diff --git a/src/index.ts b/src/index.ts index 6e7de0284..406275095 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ // Models import type { InstabugConfig } from './models/InstabugConfig'; import Report from './models/Report'; -import Trace from './models/Trace'; // Modules import * as APM from './modules/APM'; import * as BugReporting from './modules/BugReporting'; @@ -19,7 +18,6 @@ import type { SessionMetadata } from './models/SessionMetadata'; export * from './utils/Enums'; export { Report, - Trace, APM, BugReporting, CrashReporting, diff --git a/src/models/Trace.ts b/src/models/Trace.ts deleted file mode 100644 index 19cd26d58..000000000 --- a/src/models/Trace.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { NativeAPM } from '../native/NativeAPM'; -import type * as APM from '../modules/APM'; - -export default class Trace { - constructor( - public readonly id: string, - public readonly name: string = '', - public readonly attributes: Record = {}, - ) {} - - /** - * Adds an attribute with a specified key and value to the Trace to be sent. - * - * @param key - The key of the attribute. - * @param value - The value of the attribute. - * - * @deprecated Please migrate to the App Flows APIs: {@link APM.startFlow}, {@link APM.endFlow}, and {@link APM.setFlowAttribute}. - */ - setAttribute(key: string, value: string) { - NativeAPM.setExecutionTraceAttribute(this.id, key, value); - this.attributes[key] = value; - } - - /** - * Ends the execution trace. - * - * @deprecated Please migrate to the App Flows APIs: {@link APM.startFlow}, {@link APM.endFlow}, and {@link APM.setFlowAttribute}. - */ - - end() { - NativeAPM.endExecutionTrace(this.id); - } -} diff --git a/src/modules/APM.ts b/src/modules/APM.ts index 92d401389..9f2dcbe01 100644 --- a/src/modules/APM.ts +++ b/src/modules/APM.ts @@ -1,6 +1,5 @@ import { Platform } from 'react-native'; -import Trace from '../models/Trace'; import { NativeAPM } from '../native/NativeAPM'; import { NativeInstabug } from '../native/NativeInstabug'; @@ -48,29 +47,6 @@ export const setAutoUITraceEnabled = (isEnabled: boolean) => { NativeAPM.setAutoUITraceEnabled(isEnabled); }; -/** - * Starts a custom execution trace. - * - * Returns a promise which resolves with the trace reference if APM is enabled; otherwise, the promise is rejected. - * - * @param name - The name of the trace to start. - * @returns A promise that resolves with a Trace object. - * - * @deprecated Please migrate to the App Flows APIs: {@link startFlow}, {@link endFlow}, and {@link setFlowAttribute}. - */ -export const startExecutionTrace = async (name: string): Promise => { - const TRACE_NOT_STARTED_APM_NOT_ENABLED = `Execution trace "${name}" wasn't created. Please make sure to enable APM first by following the instructions at this link: https://docs.instabug.com/reference#enable-or-disable-apm`; - const timestamp = Date.now() + ''; - - const id = await NativeAPM.startExecutionTrace(name, timestamp); - - if (!id) { - throw new Error(TRACE_NOT_STARTED_APM_NOT_ENABLED); - } - - return new Trace(id, name); -}; - /** * Starts an AppFlow with the specified name. * diff --git a/src/modules/BugReporting.ts b/src/modules/BugReporting.ts index 486169ecc..c514e1ba9 100644 --- a/src/modules/BugReporting.ts +++ b/src/modules/BugReporting.ts @@ -245,7 +245,10 @@ export const setDisclaimerText = (text: string) => { * Sets a minimum number of characters as a requirement for the comments field in the different report types. * @param limit int number of characters. * @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types. + * @platform iOS */ export const setCommentMinimumCharacterCount = (limit: number, reportTypes?: ReportType[]) => { - NativeBugReporting.setCommentMinimumCharacterCount(limit, reportTypes ?? []); + if (Platform.OS === 'ios') { + NativeBugReporting.setCommentMinimumCharacterCount(limit, reportTypes ?? []); + } }; diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts index f7d582e70..30c6b0cbc 100644 --- a/src/modules/Instabug.ts +++ b/src/modules/Instabug.ts @@ -389,9 +389,12 @@ export const setColorTheme = (sdkTheme: ColorTheme) => { * To use, import processColor and pass to it with argument the color hex * as argument. * @param color A color to set the UI elements of the SDK to. + * @platform iOS */ export const setPrimaryColor = (color: string) => { - NativeInstabug.setPrimaryColor(processColor(color)); + if (Platform.OS === 'ios') { + NativeInstabug.setPrimaryColor(processColor(color)); + } }; /** @@ -775,35 +778,6 @@ export const reportScreenChange = (screenName: string) => { NativeInstabug.reportScreenChange(screenName); }; -/** - * Add experiments to next report. - * @param experiments An array of experiments to add to the next report. - * - * @deprecated Please migrate to the new Feature Flags APIs: {@link addFeatureFlags}. - */ -export const addExperiments = (experiments: string[]) => { - NativeInstabug.addExperiments(experiments); -}; - -/** - * Remove experiments from next report. - * @param experiments An array of experiments to remove from the next report. - * - * @deprecated Please migrate to the new Feature Flags APIs: {@link removeFeatureFlags}. - */ -export const removeExperiments = (experiments: string[]) => { - NativeInstabug.removeExperiments(experiments); -}; - -/** - * Clear all experiments - * - * @deprecated Please migrate to the new Feature Flags APIs: {@link removeAllFeatureFlags}. - */ -export const clearAllExperiments = () => { - NativeInstabug.clearAllExperiments(); -}; - /** * Add feature flags to the next report. * @param featureFlags An array of feature flags to add to the next report. diff --git a/src/native/NativeAPM.ts b/src/native/NativeAPM.ts index 9fa30b702..86d017167 100644 --- a/src/native/NativeAPM.ts +++ b/src/native/NativeAPM.ts @@ -34,10 +34,6 @@ export interface ApmNativeModule extends NativeModule { endAppLaunch(): void; // Execution Traces APIs // - startExecutionTrace(name: string, timestamp: string): Promise; - setExecutionTraceAttribute(id: string, key: string, value: string): void; - endExecutionTrace(id: string): void; - // App Flows APIs // startFlow(name: string): void; endFlow(name: string): void; diff --git a/src/native/NativeInstabug.ts b/src/native/NativeInstabug.ts index 7032bbc07..64dc0b20b 100644 --- a/src/native/NativeInstabug.ts +++ b/src/native/NativeInstabug.ts @@ -118,10 +118,6 @@ export interface InstabugNativeModule extends NativeModule { getTags(): Promise; // Experiments APIs // - addExperiments(experiments: string[]): void; - removeExperiments(experiments: string[]): void; - clearAllExperiments(): void; - addFeatureFlags(featureFlags: Record): void; removeFeatureFlags(featureFlags: string[]): void; diff --git a/test/models/Trace.spec.ts b/test/models/Trace.spec.ts deleted file mode 100644 index 8421b419a..000000000 --- a/test/models/Trace.spec.ts +++ /dev/null @@ -1,39 +0,0 @@ -import Trace from '../../src/models/Trace'; -import { NativeAPM } from '../../src/native/NativeAPM'; - -describe('Trace Model', () => { - it('should set the id, name and attributes if passed', () => { - const id = 'trace-id'; - const name = 'my-trace'; - const attributes = { screen: 'login' }; - const trace = new Trace(id, name, attributes); - - expect(trace.id).toBe(id); - expect(trace.name).toBe(name); - expect(trace.attributes).toBe(attributes); - }); - - it('should set execution trace attributes', () => { - const attribute = { key: 'isAuthenticated', value: 'yes' }; - - const trace = new Trace('trace-id'); - trace.setAttribute(attribute.key, attribute.value); - - expect(trace.attributes[attribute.key]).toBe(attribute.value); - expect(NativeAPM.setExecutionTraceAttribute).toBeCalledTimes(1); - expect(NativeAPM.setExecutionTraceAttribute).toBeCalledWith( - trace.id, - attribute.key, - attribute.value, - ); - }); - - it('should end execution trace', () => { - const trace = new Trace('trace-id'); - - trace.end(); - - expect(NativeAPM.endExecutionTrace).toBeCalledTimes(1); - expect(NativeAPM.endExecutionTrace).toBeCalledWith(trace.id); - }); -}); diff --git a/test/modules/APM.spec.ts b/test/modules/APM.spec.ts index cf932d25c..ea703d3ea 100644 --- a/test/modules/APM.spec.ts +++ b/test/modules/APM.spec.ts @@ -1,11 +1,8 @@ import { Platform } from 'react-native'; -import { mocked } from 'jest-mock'; - -import Trace from '../../src/models/Trace'; -import * as APM from '../../src/modules/APM'; import { NativeAPM } from '../../src/native/NativeAPM'; import { NativeInstabug } from '../../src/native/NativeInstabug'; +import * as APM from '../../src/modules/APM'; describe('APM Module', () => { it('should call the native method setEnabled', () => { @@ -51,57 +48,6 @@ describe('APM Module', () => { expect(NativeAPM.setAutoUITraceEnabled).toBeCalledWith(true); }); - it('should call the native method startExecutionTrace', () => { - mocked(NativeAPM).startExecutionTrace.mockResolvedValueOnce('trace-id'); - - APM.startExecutionTrace('trace'); - - expect(NativeAPM.startExecutionTrace).toBeCalledTimes(1); - expect(NativeAPM.startExecutionTrace).toBeCalledWith('trace', expect.any(String)); - }); - - it("should throw an error if native startExecutionTrace didn't return an ID", async () => { - mocked(NativeAPM).startExecutionTrace.mockResolvedValueOnce(null); - const promise = APM.startExecutionTrace('trace'); - - await expect(promise).rejects.toThrowError(/trace "trace" wasn't created/i); - }); - - it('should resolve with an Trace object if native startExecutionTrace returned an ID', async () => { - mocked(NativeAPM).startExecutionTrace.mockResolvedValueOnce('trace-id'); - - const promise = APM.startExecutionTrace('trace'); - - await expect(promise).resolves.toBeInstanceOf(Trace); - await expect(promise).resolves.toHaveProperty('name', 'trace'); - }); - - it('should call the native method setExecutionTraceAttribute', () => { - mocked(NativeAPM).startExecutionTrace.mockResolvedValueOnce('trace-id'); - - APM.startExecutionTrace('trace').then((trace) => { - trace.setAttribute('key', 'value'); - - expect(NativeAPM.setExecutionTraceAttribute).toBeCalledTimes(1); - expect(NativeAPM.setExecutionTraceAttribute).toBeCalledWith( - expect.any(String), - 'key', - 'value', - ); - }); - }); - - it('should call the native method endExecutionTrace', () => { - mocked(NativeAPM).startExecutionTrace.mockResolvedValueOnce('trace-id'); - - APM.startExecutionTrace('trace').then((trace) => { - trace.end(); - - expect(NativeAPM.endExecutionTrace).toBeCalledTimes(1); - expect(NativeAPM.endExecutionTrace).toBeCalledWith(expect.any(String)); - }); - }); - it('should call the native method startFlow', () => { const appFlowName = 'flowName'; From 3bcf21f09417328e4111ad4b8b701c4811da9679 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 10:47:13 +0300 Subject: [PATCH 22/62] chore: add change log --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index abda7ed70..ccc5af24f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased](https://github.com/Instabug/Instabug-React-Native/compare/v15.0.1...dev) + +### Changed + +- **BREAKING** Remove deprecated APIs ([#1424](https://github.com/Instabug/Instabug-React-Native/pull/1424)). See migration guide for more details. + ## [15.0.1](https://github.com/Instabug/Instabug-React-Native/compare/v14.3.0...v15.0.1) ### Added From fdc8a20dbff2e8ccaaac7fe8c4456327c1ee14b8 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 10:59:55 +0300 Subject: [PATCH 23/62] fix: removed unused tests --- .../reactlibrary/RNInstabugAPMModule.java | 75 ------------------- .../RNInstabugBugReportingModule.java | 28 ------- .../RNInstabugReactnativeModule.java | 75 +------------------ .../RNInstabugBugReportingModuleTest.java | 19 +---- .../RNInstabugReactnativeModuleTest.java | 41 +--------- .../ios/InstabugTests/InstabugAPMTests.m | 47 ------------ .../InstabugTests/InstabugBugReportingTests.m | 12 --- .../ios/InstabugTests/InstabugSampleTests.m | 37 --------- 8 files changed, 3 insertions(+), 331 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java index d75b4f75b..f5ab372a9 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java @@ -207,81 +207,6 @@ public void run() { }); } - /** - * Starts an execution trace - * - * @param name string name of the trace. - * - * @deprecated see {@link #startFlow(String)} - */ - @Deprecated - @ReactMethod - public void startExecutionTrace(final String name, final String id, final Promise promise) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - String result = ""; - ExecutionTrace trace = APM.startExecutionTrace(name); - if (trace != null) { - result = id; - traces.put(id, trace); - } - promise.resolve(result); - } catch (Exception e) { - e.printStackTrace(); - promise.resolve(null); - } - } - }); - } - - /** - * Adds a new attribute to trace - * - * @param id String id of the trace. - * @param key attribute key - * @param value attribute value. Null to remove attribute - * - * @deprecated see {@link #setFlowAttribute} - */ - @Deprecated - @ReactMethod - public void setExecutionTraceAttribute(final String id, final String key, final String value) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - traces.get(id).setAttribute(key, value); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * Ends a trace - * - * @param id string id of the trace. - * - * @deprecated see {@link #endFlow} - */ - @Deprecated - @ReactMethod - public void endExecutionTrace(final String id) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - traces.get(id).end(); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - /** * Starts a UI trace * diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java index 0dd9270e0..c491a88a9 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java @@ -390,34 +390,6 @@ public void run() { }); } - /** - * Sets a minimum number of characters as a requirement for the comments field in the different report types. - * @param limit int number of characters. - * @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types. - */ - @ReactMethod - public void setCommentMinimumCharacterCount(final int limit, final ReadableArray reportTypes){ - MainThreadHandler.runOnMainThread(new Runnable() { - @SuppressLint("WrongConstant") - @Override - public void run() { - try { - final ArrayList keys = ArrayUtil.parseReadableArrayOfStrings(reportTypes); - final ArrayList types = ArgsRegistry.reportTypes.getAll(keys); - - final int[] typesInts = new int[types.size()]; - for (int i = 0; i < types.size(); i++) { - typesInts[i] = types.get(i); - } - - BugReporting.setCommentMinimumCharacterCount(limit, typesInts); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - /** * Adds a user consent item to the bug reporting * @param key A unique identifier string for the consent item. diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 17f48656f..90568496c 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -281,26 +281,6 @@ public void run() { }); } - /** - * Set the primary color that the SDK will use to tint certain UI elements in the SDK - * - * @param primaryColor The value of the primary color , - * whatever this color was parsed from a resource color or hex color - * or RGB color values - */ - @ReactMethod - public void setPrimaryColor(final int primaryColor) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Instabug.setPrimaryColor(primaryColor); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } /** * Gets tags. @@ -1036,60 +1016,7 @@ public void run() { }); } - /** - * @deprecated see {@link #addFeatureFlags(ReadableArray)} - */ - @ReactMethod - public void addExperiments(final ReadableArray experiments) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Object[] objectArray = ArrayUtil.toArray(experiments); - String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class); - Instabug.addExperiments(Arrays.asList(stringArray)); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * @deprecated see {@link #removeFeatureFlags(ReadableArray)} - */ - @ReactMethod - public void removeExperiments(final ReadableArray experiments) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Object[] objectArray = ArrayUtil.toArray(experiments); - String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class); - Instabug.removeExperiments(Arrays.asList(stringArray)); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } - - /** - * @deprecated see {@link #removeAllFeatureFlags()} - */ - @ReactMethod - public void clearAllExperiments() { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Instabug.clearAllExperiments(); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } + @ReactMethod public void addFeatureFlags(final ReadableMap featureFlagsMap) { diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java index dc55e81a5..7b4c3b632 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java @@ -344,24 +344,7 @@ public Object answer(InvocationOnMock invocation) { BugReporting.setDisclaimerText(text); } - @Test - public void givenArgs$setCommentMinimumCharacterCount_whenQuery_thenShouldCallNativeApiWithArgs() { - // given - final int count = 20; - final Map args = ArgsRegistry.reportTypes; - final String[] keysArray = args.keySet().toArray(new String[0]); - JavaOnlyArray actualArray = new JavaOnlyArray(); - actualArray.pushString(keysArray[0]); - - // when - bugReportingModule.setCommentMinimumCharacterCount(count, actualArray); - - // then - verify(BugReporting.class, VerificationModeFactory.times(1)); - int type1 = args.get(keysArray[0]); - - BugReporting.setCommentMinimumCharacterCount(count, type1); - } + @Test public void TestAddUserConsent() { final Map args = ArgsRegistry.userConsentActionType; diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java index f4f6f9bc1..137d11ce5 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java @@ -193,18 +193,6 @@ public void tearDown() { Instabug.setUserData(data); } - @Test - public void givenArg$setPrimaryColor_whenQuery_thenShouldCallNativeApiWithArg() { - // given - - int color = 3902; - // when - rnModule.setPrimaryColor(color); - // then - verify(Instabug.class,times(1)); - Instabug.setPrimaryColor(color); - } - @Test public void testSetCodePushVersion() { String codePushVersion = "123"; @@ -535,24 +523,7 @@ public void testIdentifyUserWithId() { } - @Test - public void givenArg$addExperiments_whenQuery_thenShouldCallNativeApiWithArg() { - // given - JavaOnlyArray array = new JavaOnlyArray(); - array.pushString("exp1"); - array.pushString("exp2"); - - // when - rnModule.addExperiments(array); - - // then - verify(Instabug.class,times(1)); - List expectedList = new ArrayList(); - expectedList.add("exp1"); - expectedList.add("exp2"); - Instabug.addExperiments(expectedList); - } - + @Test public void givenArg$removeExperiments_whenQuery_thenShouldCallNativeApiWithArg() { // given @@ -571,16 +542,6 @@ public void testIdentifyUserWithId() { Instabug.removeExperiments(expectedList); } - @Test - public void given$clearAllExperiments_whenQuery_thenShouldCallNativeApi() { - // when - rnModule.clearAllExperiments(); - - // then - verify(Instabug.class,times(1)); - Instabug.clearAllExperiments(); - } - @Test public void testAddFeatureFlags() { // given diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 949393adb..40fae6129 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -86,53 +86,6 @@ - (void) testSetAutoUITraceEnabled { OCMVerify([mock setAutoUITraceEnabled:isEnabled]); } -- (void) testStartExecutionTrace { - id mock = OCMClassMock([IBGAPM class]); - NSString* traceName = @"Trace_1"; - NSString* traceKey = @"1"; - RCTPromiseResolveBlock resolve = ^(id result) {}; - RCTPromiseRejectBlock reject = ^(NSString *code, NSString *message, NSError *error) {}; - - OCMStub([mock startExecutionTraceWithName:traceName]); - [self.instabugBridge startExecutionTrace:traceName :traceKey :resolve :reject]; - OCMVerify([mock startExecutionTraceWithName:traceName]); -} - -- (void) testSetExecutionTraceAttribute { - NSString* traceName = @"Trace_1"; - NSString* traceId = @"Id_1"; - NSString* traceKey = @"Key_1"; - NSString* traceValue = @"1"; - RCTPromiseResolveBlock resolve = ^(id result) {}; - RCTPromiseRejectBlock reject = ^(NSString *code, NSString *message, NSError *error) {}; - IBGExecutionTrace * trace = [IBGExecutionTrace alloc]; - id mock = OCMClassMock([IBGAPM class]); - id traceMock = OCMPartialMock(trace); - - OCMStub([mock startExecutionTraceWithName:traceName]).andReturn(trace); - [self.instabugBridge startExecutionTrace:traceName :traceId :resolve :reject]; - - OCMStub([traceMock setAttributeWithKey:traceKey value:traceValue]); - [self.instabugBridge setExecutionTraceAttribute:traceId :traceKey :traceValue]; - OCMVerify([traceMock setAttributeWithKey:traceKey value:traceValue]); -} - -- (void) testEndExecutionTrace { - NSString* traceName = @"Trace_1"; - NSString* traceId = @"Id_1"; - RCTPromiseResolveBlock resolve = ^(id result) {}; - RCTPromiseRejectBlock reject = ^(NSString *code, NSString *message, NSError *error) {}; - IBGExecutionTrace * trace = [IBGExecutionTrace alloc]; - id apmMock = OCMClassMock([IBGAPM class]); - id traceMock = OCMPartialMock(trace); - - OCMStub([apmMock startExecutionTraceWithName:traceName]).andReturn(trace); - [self.instabugBridge startExecutionTrace:traceName :traceId :resolve :reject]; - - OCMStub([traceMock end]); - [self.instabugBridge endExecutionTrace:traceId]; - OCMVerify([traceMock end]); -} - (void) testStartFlow { id mock = OCMClassMock([IBGAPM class]); diff --git a/examples/default/ios/InstabugTests/InstabugBugReportingTests.m b/examples/default/ios/InstabugTests/InstabugBugReportingTests.m index f0b6f97ec..4d0250dc1 100644 --- a/examples/default/ios/InstabugTests/InstabugBugReportingTests.m +++ b/examples/default/ios/InstabugTests/InstabugBugReportingTests.m @@ -175,18 +175,6 @@ - (void) testSetDisclaimerText { OCMVerify([mock setDisclaimerText:text]); } -- (void) testSetCommentMinimumCharacterCount { - id mock = OCMClassMock([IBGBugReporting class]); - NSNumber *limit = [NSNumber numberWithInt:20]; - NSArray *reportTypesArr = [NSArray arrayWithObjects: @(IBGReportTypeBug), nil]; - IBGBugReportingReportType reportTypes = 0; - for (NSNumber *reportType in reportTypesArr) { - reportTypes |= [reportType intValue]; - } - OCMStub([mock setCommentMinimumCharacterCountForReportTypes:reportTypes withLimit:limit.intValue]); - [self.instabugBridge setCommentMinimumCharacterCount:limit reportTypes:reportTypesArr]; - OCMVerify([mock setCommentMinimumCharacterCountForReportTypes:reportTypes withLimit:limit.intValue]); -} - (void)testAddUserConsentWithKey { id mock = OCMClassMock([IBGBugReporting class]); diff --git a/examples/default/ios/InstabugTests/InstabugSampleTests.m b/examples/default/ios/InstabugTests/InstabugSampleTests.m index ded37c3af..3db399816 100644 --- a/examples/default/ios/InstabugTests/InstabugSampleTests.m +++ b/examples/default/ios/InstabugTests/InstabugSampleTests.m @@ -141,19 +141,6 @@ - (void)testSetColorTheme { [self waitForExpectationsWithTimeout:EXPECTATION_TIMEOUT handler:nil]; } -- (void)testSetPrimaryColor { - UIColor *color = [UIColor whiteColor]; - XCTestExpectation *expectation = [self expectationWithDescription:@"Testing [Instabug setPrimaryColor]"]; - - [self.instabugBridge setPrimaryColor:color]; - [[NSRunLoop mainRunLoop] performBlock:^{ - XCTAssertEqualObjects(Instabug.tintColor, color); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:EXPECTATION_TIMEOUT handler:nil]; -} - - (void)testAppendTags { id mock = OCMClassMock([Instabug class]); NSArray *tags = @[@"tag1", @"tag2"]; @@ -486,30 +473,6 @@ - (void)testClearLogs { OCMVerify([mock clearAllLogs]); } -- (void)testAddExperiments { - id mock = OCMClassMock([Instabug class]); - NSArray *experiments = @[@"exp1", @"exp2"]; - - OCMStub([mock addExperiments:experiments]); - [self.instabugBridge addExperiments:experiments]; - OCMVerify([mock addExperiments:experiments]); -} - -- (void)testRemoveExperiments { - id mock = OCMClassMock([Instabug class]); - NSArray *experiments = @[@"exp1", @"exp2"]; - - OCMStub([mock removeExperiments:experiments]); - [self.instabugBridge removeExperiments:experiments]; - OCMVerify([mock removeExperiments:experiments]); -} - -- (void)testClearAllExperiments { - id mock = OCMClassMock([Instabug class]); - OCMStub([mock clearAllExperiments]); - [self.instabugBridge clearAllExperiments]; - OCMVerify([mock clearAllExperiments]); -} - (void)testAddFeatureFlags { id mock = OCMClassMock([Instabug class]); From d1086e15fa77ab67ec37205d4ae4b9582cabcc0e Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 11:05:28 +0300 Subject: [PATCH 24/62] fix: remove tests --- ios/RNInstabug/InstabugAPMBridge.h | 6 ------ test/mocks/mockAPM.ts | 3 --- 2 files changed, 9 deletions(-) diff --git a/ios/RNInstabug/InstabugAPMBridge.h b/ios/RNInstabug/InstabugAPMBridge.h index 0a0ea397c..6b09dba6b 100644 --- a/ios/RNInstabug/InstabugAPMBridge.h +++ b/ios/RNInstabug/InstabugAPMBridge.h @@ -15,12 +15,6 @@ - (void)setAppLaunchEnabled:(BOOL)isEnabled; - (void)endAppLaunch; - (void)setAutoUITraceEnabled:(BOOL)isEnabled; -- (void)startExecutionTrace:(NSString *)name :(NSString *)id - :(RCTPromiseResolveBlock)resolve - :(RCTPromiseRejectBlock)reject DEPRECATED_MSG_ATTRIBUTE("Please use APM.startFlow instead."); -- (void)setExecutionTraceAttribute:(NSString *)id:(NSString *)key - :(NSString *)value DEPRECATED_MSG_ATTRIBUTE("Please use APM.setTraceAttribute instead."); -- (void)endExecutionTrace:(NSString *)id DEPRECATED_MSG_ATTRIBUTE("Please use APM.endFlow instead."); - (void)startFlow:(NSString *)name; - (void)endFlow:(NSString *)name; - (void)setFlowAttribute:(NSString *)name :(NSString *)key :(NSString *_Nullable)value; diff --git a/test/mocks/mockAPM.ts b/test/mocks/mockAPM.ts index 27644c694..7a9c5bac9 100644 --- a/test/mocks/mockAPM.ts +++ b/test/mocks/mockAPM.ts @@ -6,9 +6,6 @@ const mockAPM: ApmNativeModule = { setEnabled: jest.fn(), setAppLaunchEnabled: jest.fn(), setAutoUITraceEnabled: jest.fn(), - startExecutionTrace: jest.fn(), - setExecutionTraceAttribute: jest.fn(), - endExecutionTrace: jest.fn(), startFlow: jest.fn(), setFlowAttribute: jest.fn(), endFlow: jest.fn(), From bc123a934e0bea48a1319d4e59517ac410774fe3 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 11:26:07 +0300 Subject: [PATCH 25/62] fix: test failure --- .../reactlibrary/RNInstabugAPMModuleTest.java | 11 ----------- .../RNInstabugReactnativeModuleTest.java | 18 ------------------ 2 files changed, 29 deletions(-) diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java index 85ca1384d..dfac232fc 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java @@ -114,17 +114,6 @@ public void givenTruesetEnabled_whenQuery_thenShouldCallNativeApiWithEnabled() { APM.endAppLaunch(); } - @Test - public void givenString$startExecutionTrace_whenQuery_thenShouldCallNativeApi() { - Promise promise = mock(Promise.class); - // when - apmModule.startExecutionTrace("trace", "1", promise); - // then - verify(APM.class, times(1)); - APM.startExecutionTrace("trace"); - verify(promise).resolve(any()); - } - @Test public void testStartFlow() { String appFlowName = "appFlowName"; diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java index 137d11ce5..9c25d3400 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugReactnativeModuleTest.java @@ -523,24 +523,6 @@ public void testIdentifyUserWithId() { } - - @Test - public void givenArg$removeExperiments_whenQuery_thenShouldCallNativeApiWithArg() { - // given - JavaOnlyArray array = new JavaOnlyArray(); - array.pushString("exp1"); - array.pushString("exp2"); - - // when - rnModule.removeExperiments(array); - - // then - verify(Instabug.class,times(1)); - List expectedList = new ArrayList(); - expectedList.add("exp1"); - expectedList.add("exp2"); - Instabug.removeExperiments(expectedList); - } @Test public void testAddFeatureFlags() { From 7018193b83698bde5c21d07f6c17cd7686fe2bc2 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 11:43:16 +0300 Subject: [PATCH 26/62] fix: remove deprecated apis --- test/mocks/mockInstabug.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/mocks/mockInstabug.ts b/test/mocks/mockInstabug.ts index 391a00a38..b9b839bcc 100644 --- a/test/mocks/mockInstabug.ts +++ b/test/mocks/mockInstabug.ts @@ -49,9 +49,6 @@ const mockInstabug: InstabugNativeModule = { setPreSendingHandler: jest.fn(), reportScreenChange: jest.fn(), reportCurrentViewChange: jest.fn(), - addExperiments: jest.fn(), - removeExperiments: jest.fn(), - clearAllExperiments: jest.fn(), networkLogIOS: jest.fn(), networkLogAndroid: jest.fn(), addFeatureFlags: jest.fn(), From 8b0c750854b69c6a252d6307921f6ddf38b4862d Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 11:47:22 +0300 Subject: [PATCH 27/62] fix: remove tests --- test/modules/Instabug.spec.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts index f6e36d8e4..14dbb1632 100644 --- a/test/modules/Instabug.spec.ts +++ b/test/modules/Instabug.spec.ts @@ -825,25 +825,6 @@ describe('Instabug Module', () => { expect(emitter.listenerCount(NativeEvents.PRESENDING_HANDLER)).toBe(1); }); - it('should call native addExperiments method', () => { - const experiments = ['exp1', 'exp2']; - Instabug.addExperiments(experiments); - expect(NativeInstabug.addExperiments).toBeCalledTimes(1); - expect(NativeInstabug.addExperiments).toBeCalledWith(experiments); - }); - - it('should call native removeExperiments method', () => { - const experiments = ['exp1', 'exp2']; - Instabug.removeExperiments(experiments); - expect(NativeInstabug.removeExperiments).toBeCalledTimes(1); - expect(NativeInstabug.removeExperiments).toBeCalledWith(experiments); - }); - - it('should call native clearAllExperiments method', () => { - Instabug.clearAllExperiments(); - expect(NativeInstabug.clearAllExperiments).toBeCalledTimes(1); - }); - it('should call native addFeatureFlags method', () => { const featureFlags: Array = [ { From 821ad6d781f6230183c1cf8c139a41d5d3f46347 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 11:56:05 +0300 Subject: [PATCH 28/62] fix: unit test --- test/modules/Instabug.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts index 14dbb1632..98d3aede2 100644 --- a/test/modules/Instabug.spec.ts +++ b/test/modules/Instabug.spec.ts @@ -455,7 +455,8 @@ describe('Instabug Module', () => { expect(NativeInstabug.setColorTheme).toBeCalledWith(theme); }); - it('should call the native method setPrimaryColor', () => { + it('should call the native method setPrimaryColor on iOS', () => { + Platform.OS = 'ios'; const color = '#fff'; Instabug.setPrimaryColor(color); From 69794340233cdb532847ddc4fe4efba2b30ed743 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 12:40:39 +0300 Subject: [PATCH 29/62] remove commented code --- .../reactlibrary/RNInstabugAPMModule.java | 3 -- .../reactlibrary/RNInstabugAPMModuleTest.java | 28 ------------------- 2 files changed, 31 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java index f5ab372a9..6ed3541cb 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java @@ -12,7 +12,6 @@ import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import com.instabug.apm.APM; -import com.instabug.apm.model.ExecutionTrace; import com.instabug.apm.networking.APMNetworkLogger; import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.reactlibrary.utils.EventEmitterModule; @@ -33,8 +32,6 @@ public RNInstabugAPMModule(ReactApplicationContext reactApplicationContext) { super(reactApplicationContext); } - @Deprecated - HashMap traces = new HashMap(); @Nonnull @Override diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java index dfac232fc..b10058f48 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java @@ -145,34 +145,6 @@ public void testSetFlowAttribute() { mockAPM.verifyNoMoreInteractions(); } - // @Test - // public void givenString$setExecutionTraceAttribute_whenQuery_thenShouldCallNativeApiWithIntArgs() { - // // given - // PowerMockito.mockStatic(APM.class); - // ExecutionTrace trace = mock(ExecutionTrace.class); - // Callback callback = mock(Callback.class); - // // when - // PowerMockito.whenNew(ExecutionTrace.class).withArguments("trace").thenReturn(trace); - // apmModule.startExecutionTrace("trace", "1", callback); - // apmModule.setExecutionTraceAttribute("trace", "key", "value"); - // // then - // verify(trace).setAttribute("key", "value"); - // } - - // @Test - // public void givenTrace$endExecutionTrace_whenQuery_thenShouldCallNativeApiWithIntArgs() { - // // given - // PowerMockito.mockStatic(APM.class); - // ExecutionTrace trace = mock(ExecutionTrace.class); - // Callback callback = mock(Callback.class); - // // when - // PowerMockito.whenNew(ExecutionTrace.class).withArguments("trace").thenReturn(trace); - // apmModule.startExecutionTrace("trace", "1", callback); - // apmModule.endExecutionTrace("1"); - // // then - // verify(trace).end(); - // } - @Test public void givenString$startUITrace_whenQuery_thenShouldCallNativeApiWithEnabled() { From 5fa987423aedce0bb23d33621e26c934d1a98830 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 14:08:27 +0300 Subject: [PATCH 30/62] fix: resolve comments --- .../RNInstabugBugReportingModule.java | 27 +++++++++++++++++++ .../RNInstabugBugReportingModuleTest.java | 19 ++++++++++++- ios/RNInstabug/InstabugBugReportingBridge.m | 8 +++--- ios/RNInstabug/InstabugReactBridge.m | 6 ++--- src/modules/Instabug.ts | 12 ++------- 5 files changed, 53 insertions(+), 19 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java index c491a88a9..25d7da216 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java @@ -389,6 +389,33 @@ public void run() { } }); } + /** + * Sets a minimum number of characters as a requirement for the comments field in the different report types. + * @param limit int number of characters. + * @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types. + */ + @ReactMethod + public void setCommentMinimumCharacterCount(final int limit, final ReadableArray reportTypes){ + MainThreadHandler.runOnMainThread(new Runnable() { + @SuppressLint("WrongConstant") + @Override + public void run() { + try { + final ArrayList keys = ArrayUtil.parseReadableArrayOfStrings(reportTypes); + final ArrayList types = ArgsRegistry.reportTypes.getAll(keys); + + final int[] typesInts = new int[types.size()]; + for (int i = 0; i < types.size(); i++) { + typesInts[i] = types.get(i); + } + + BugReporting.setCommentMinimumCharacterCount(limit, typesInts); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } /** * Adds a user consent item to the bug reporting diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java index 7b4c3b632..e4452c6e3 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java @@ -344,7 +344,24 @@ public Object answer(InvocationOnMock invocation) { BugReporting.setDisclaimerText(text); } - + @Test + public void givenArgs$setCommentMinimumCharacterCount_whenQuery_thenShouldCallNativeApiWithArgs() { + // given + final int count = 20; + final Map args = ArgsRegistry.reportTypes; + final String[] keysArray = args.keySet().toArray(new String[0]); + JavaOnlyArray actualArray = new JavaOnlyArray(); + actualArray.pushString(keysArray[0]); + + // when + bugReportingModule.setCommentMinimumCharacterCount(count, actualArray); + + // then + verify(BugReporting.class, VerificationModeFactory.times(1)); + int type1 = args.get(keysArray[0]); + + BugReporting.setCommentMinimumCharacterCount(count, type1); + } @Test public void TestAddUserConsent() { final Map args = ArgsRegistry.userConsentActionType; diff --git a/ios/RNInstabug/InstabugBugReportingBridge.m b/ios/RNInstabug/InstabugBugReportingBridge.m index e5833e2c4..70efaa129 100644 --- a/ios/RNInstabug/InstabugBugReportingBridge.m +++ b/ios/RNInstabug/InstabugBugReportingBridge.m @@ -205,18 +205,16 @@ - (void) showBugReportingWithReportTypeAndOptionsHelper:(NSArray*)args { } RCT_EXPORT_METHOD(setCommentMinimumCharacterCount:(nonnull NSNumber *)limit reportTypes:(NSArray *)reportTypes) { - IBGBugReportingReportType parsedReportTypes = 0; - + IBGBugReportingType parsedReportTypes = 0; if (![reportTypes count]) { - parsedReportTypes = @(IBGBugReportingReportTypeBug).integerValue | @(IBGBugReportingReportTypeFeedback).integerValue | @(IBGBugReportingReportTypeQuestion).integerValue; + parsedReportTypes = @(IBGBugReportingTypeBug).integerValue | @(IBGBugReportingTypeFeedback).integerValue | @(IBGBugReportingTypeQuestion).integerValue; } else { for (NSNumber *reportType in reportTypes) { parsedReportTypes |= [reportType intValue]; } } - - [IBGBugReporting setCommentMinimumCharacterCount:limit.intValue forBugReportType:parsedReportTypes]; + [IBGBugReporting setCommentMinimumCharacterCount:[limit integerValue] forBugReportType:parsedReportTypes]; } RCT_EXPORT_METHOD(addUserConsent:(NSString *)key diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index e2eeb89f1..3194d8777 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -62,8 +62,8 @@ - (dispatch_queue_t)methodQueue { RCT_EXPORT_METHOD(setReproStepsConfig:(IBGUserStepsMode)bugMode :(IBGUserStepsMode)crashMode:(IBGUserStepsMode)sessionReplayMode) { [Instabug setReproStepsFor:IBGIssueTypeBug withMode:bugMode]; - [Instabug setReproStepsFor:IBGIssueTypeCrash withMode:crashMode]; - [Instabug setReproStepsFor:IBGIssueTypeSessionReplay withMode:sessionReplayMode]; + [Instabug setReproStepsFor:IBGIssueTypeAllCrashes withMode:crashMode]; + [Instabug setReproStepsFor:IBGIssueTypeSessionReplay withMode:sessionReplayMode]; } RCT_EXPORT_METHOD(setFileAttachment:(NSString *)fileLocation) { @@ -170,7 +170,7 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(setPrimaryColor:(UIColor *)color) { - Instabug.theme.primaryColor = color; + Instabug.tintColor = color; } RCT_EXPORT_METHOD(setTheme:(NSDictionary *)themeConfig) { diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts index a07c760f8..1706d7bc4 100644 --- a/src/modules/Instabug.ts +++ b/src/modules/Instabug.ts @@ -1,10 +1,4 @@ -import { - AppState, - type AppStateStatus, - findNodeHandle, - Platform, - processColor, -} from 'react-native'; +import { AppState, type AppStateStatus, findNodeHandle, Platform } from 'react-native'; import type { NavigationContainerRefWithCurrent, @@ -393,9 +387,7 @@ export const setColorTheme = (sdkTheme: ColorTheme) => { * @platform iOS */ export const setPrimaryColor = (color: string) => { - if (Platform.OS === 'ios') { - NativeInstabug.setPrimaryColor(processColor(color)); - } + NativeInstabug.setTheme({ primaryColor: color }); }; /** From 50beca4b3f120ea997e6b41771114ba9557b3515 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 14:18:49 +0300 Subject: [PATCH 31/62] fix: unit tests --- src/modules/Instabug.ts | 2 +- test/modules/Instabug.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/Instabug.ts b/src/modules/Instabug.ts index 1706d7bc4..c6ec8ad39 100644 --- a/src/modules/Instabug.ts +++ b/src/modules/Instabug.ts @@ -384,7 +384,7 @@ export const setColorTheme = (sdkTheme: ColorTheme) => { * To use, import processColor and pass to it with argument the color hex * as argument. * @param color A color to set the UI elements of the SDK to. - * @platform iOS + * @deprecated Please migrate to the new UI customization API: {@link setTheme} */ export const setPrimaryColor = (color: string) => { NativeInstabug.setTheme({ primaryColor: color }); diff --git a/test/modules/Instabug.spec.ts b/test/modules/Instabug.spec.ts index 98d3aede2..695d7310e 100644 --- a/test/modules/Instabug.spec.ts +++ b/test/modules/Instabug.spec.ts @@ -1,7 +1,7 @@ import '../mocks/mockInstabugUtils'; import '../mocks/mockNetworkLogger'; -import { findNodeHandle, Platform, processColor } from 'react-native'; +import { findNodeHandle, Platform } from 'react-native'; import type { NavigationContainerRefWithCurrent } from '@react-navigation/native'; // Import the hook import { mocked } from 'jest-mock'; import waitForExpect from 'wait-for-expect'; @@ -458,10 +458,10 @@ describe('Instabug Module', () => { it('should call the native method setPrimaryColor on iOS', () => { Platform.OS = 'ios'; const color = '#fff'; - Instabug.setPrimaryColor(color); + Instabug.setTheme({ primaryColor: color }); - expect(NativeInstabug.setPrimaryColor).toBeCalledTimes(1); - expect(NativeInstabug.setPrimaryColor).toBeCalledWith(processColor(color)); + expect(NativeInstabug.setTheme).toBeCalledTimes(1); + expect(NativeInstabug.setTheme).toBeCalledWith({ primaryColor: color }); }); it('should call the native method appendTags', () => { From e3836b13d26d70563122eb2fbb0a7c0bb781e03e Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 14:49:55 +0300 Subject: [PATCH 32/62] fix: setCommentMinimumCharacterCountForBugReportType --- .../instabug/reactlibrary/RNInstabugBugReportingModule.java | 3 +-- .../reactlibrary/RNInstabugBugReportingModuleTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java index 25d7da216..420011ddb 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugBugReportingModule.java @@ -409,8 +409,7 @@ public void run() { typesInts[i] = types.get(i); } - BugReporting.setCommentMinimumCharacterCount(limit, typesInts); - } catch (Exception e) { + BugReporting.setCommentMinimumCharacterCountForBugReportType(limit, typesInts); } catch (Exception e) { e.printStackTrace(); } } diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java index e4452c6e3..15cef0e2f 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugBugReportingModuleTest.java @@ -360,7 +360,7 @@ public Object answer(InvocationOnMock invocation) { verify(BugReporting.class, VerificationModeFactory.times(1)); int type1 = args.get(keysArray[0]); - BugReporting.setCommentMinimumCharacterCount(count, type1); + BugReporting.setCommentMinimumCharacterCountForBugReportType(count, type1); } @Test public void TestAddUserConsent() { From 48fc00a170921433864f9038326e705070d99f33 Mon Sep 17 00:00:00 2001 From: AyaMahmoud148 Date: Thu, 31 Jul 2025 14:55:15 +0300 Subject: [PATCH 33/62] fix: ios tests --- examples/default/ios/InstabugTests/InstabugSampleTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/default/ios/InstabugTests/InstabugSampleTests.m b/examples/default/ios/InstabugTests/InstabugSampleTests.m index df2b2914b..b91213a01 100644 --- a/examples/default/ios/InstabugTests/InstabugSampleTests.m +++ b/examples/default/ios/InstabugTests/InstabugSampleTests.m @@ -226,7 +226,7 @@ - (void)testSetReproStepsConfig { [self.instabugBridge setReproStepsConfig:bugMode :crashMode :sessionReplayMode]; OCMVerify([mock setReproStepsFor:IBGIssueTypeBug withMode:bugMode]); - OCMVerify([mock setReproStepsFor:IBGIssueTypeCrash withMode:crashMode]); + OCMVerify([mock setReproStepsFor:IBGIssueTypeAllCrashes withMode:crashMode]); OCMVerify([mock setReproStepsFor:IBGIssueTypeSessionReplay withMode:sessionReplayMode]); } From fe21f67135085f5e9cb0541aab7ed220df5be544 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:14:31 +0300 Subject: [PATCH 34/62] chore: update the iOS pods --- examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 18 +++++----- examples/default/src/App.tsx | 57 +++++++++++++++++-------------- ios/native.rb | 2 +- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index 7b4496b80..5c34c2892 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 6795679c7..0bdb702a9 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.16) + - Instabug (15.1.24) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.16) + - Instabug (= 15.1.24) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2024,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 9fcae5627558e1832a0f49c81bb26c20aaf8af7f + Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2092,14 +2092,14 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: 62ac32fd0a0ecb7720aa115fec391e74b8bd5a27 + RNInstabug: c1334b03231d29e6abb93b93de52190cd325ce65 RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 06ff71958843b5a526fbd11ecc1aad124421d74f +PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 2fc62edbe..330d0d250 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -3,8 +3,8 @@ import { ActivityIndicator, StyleSheet } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; -import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { + APM, CrashReporting, InvocationEvent, LaunchType, @@ -12,6 +12,7 @@ import Instabug, { NetworkInterceptionMode, NetworkLogger, ReproStepsMode, + type SessionMetadata, SessionReplay, } from 'instabug-reactnative'; import { NativeBaseProvider } from 'native-base'; @@ -42,36 +43,42 @@ export const App: React.FC = () => { const [isInstabugInitialized, setIsInstabugInitialized] = useState(false); - const initializeInstabug = async () => { - try { - SessionReplay.setSyncCallback((data) => shouldSyncSession(data)); - - await Instabug.init({ - token: 'deb1910a7342814af4e4c9210c786f35', - invocationEvents: [InvocationEvent.floatingButton], - debugLogsLevel: LogLevel.verbose, - networkInterceptionMode: NetworkInterceptionMode.javascript, + const initializeInstabug = () => { + // Synchronous setup + SessionReplay.setSyncCallback((data) => shouldSyncSession(data)); + + // Start async initialization but don't block rendering + Instabug.init({ + token: 'deb1910a7342814af4e4c9210c786f35', + invocationEvents: [InvocationEvent.floatingButton], + debugLogsLevel: LogLevel.verbose, + networkInterceptionMode: NetworkInterceptionMode.javascript, + }) + .then(() => { + // Post-initialization setup + NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { + networkData.url = `${networkData.url}/JS/Obfuscated`; + return networkData; }); - - CrashReporting.setNDKCrashesEnabled(true); - Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); - - setIsInstabugInitialized(true); // Set to true after initialization - } catch (error) { + APM.setScreenRenderEnabled(true); + setIsInstabugInitialized(true); + }) + .catch((error) => { console.error('Instabug initialization failed:', error); setIsInstabugInitialized(true); // Proceed even if initialization fails - } + }); + + // Synchronous configuration that doesn't depend on init completion + CrashReporting.setNDKCrashesEnabled(true); + Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); + + // Set initialized immediately to show UI - initialization continues in background + setIsInstabugInitialized(true); }; useEffect(() => { - initializeInstabug().then(() => { - NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { - networkData.url = `${networkData.url}/JS/Obfuscated`; - return networkData; - }); - // APM.setScreenRenderEnabled(true); - }); - }); + initializeInstabug(); + }, []); useEffect(() => { // @ts-ignore diff --git a/ios/native.rb b/ios/native.rb index a62fd4577..1ca2aded7 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.16' } +$instabug = { :version => '15.1.24' } def use_instabug! (spec = nil) version = $instabug[:version] From a627e98d2b1f32120879777578a109bc4c1e0f1d Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:25:57 +0300 Subject: [PATCH 35/62] fix format --- examples/default/ios/Podfile.lock | 4 ++-- examples/default/src/App.tsx | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 0bdb702a9..ebaada4cc 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 330d0d250..13482f397 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -54,24 +54,24 @@ export const App: React.FC = () => { debugLogsLevel: LogLevel.verbose, networkInterceptionMode: NetworkInterceptionMode.javascript, }) - .then(() => { - // Post-initialization setup - NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { - networkData.url = `${networkData.url}/JS/Obfuscated`; - return networkData; + .then(() => { + // Post-initialization setup + NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { + networkData.url = `${networkData.url}/JS/Obfuscated`; + return networkData; + }); + APM.setScreenRenderEnabled(true); + setIsInstabugInitialized(true); + }) + .catch((error) => { + console.error('Instabug initialization failed:', error); + setIsInstabugInitialized(true); // Proceed even if initialization fails }); - APM.setScreenRenderEnabled(true); - setIsInstabugInitialized(true); - }) - .catch((error) => { - console.error('Instabug initialization failed:', error); - setIsInstabugInitialized(true); // Proceed even if initialization fails - }); // Synchronous configuration that doesn't depend on init completion CrashReporting.setNDKCrashesEnabled(true); Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); - + // Set initialized immediately to show UI - initialization continues in background setIsInstabugInitialized(true); }; From c366f122c53331e2c6ca051a95d223140074b436 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:31:11 +0300 Subject: [PATCH 36/62] fix lint --- examples/default/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 13482f397..703932594 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -78,7 +78,7 @@ export const App: React.FC = () => { useEffect(() => { initializeInstabug(); - }, []); + }); useEffect(() => { // @ts-ignore From 8df6508094f5c5258cb934c7ae1044e410efab05 Mon Sep 17 00:00:00 2001 From: Eyad Heikal Date: Thu, 7 Aug 2025 01:21:05 +0300 Subject: [PATCH 37/62] Remove Links override --- .../InstabugExample.xcodeproj/project.pbxproj | 36 ++++-- .../ios/InstabugExample/Instabug.plist | Bin 157 -> 0 bytes examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 120 +++++++++--------- ios/native.rb | 2 +- 5 files changed, 85 insertions(+), 75 deletions(-) delete mode 100644 examples/default/ios/InstabugExample/Instabug.plist diff --git a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj index fb1253b31..6cbf4e3b0 100644 --- a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj +++ b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ CC3DF8932A1DFC9A003E9914 /* InstabugSurveysTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */; }; CC3DF8942A1DFC9A003E9914 /* InstabugAPMTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */; }; CC3DF8952A1DFC9A003E9914 /* IBGConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */; }; - CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */ = {isa = PBXBuildFile; fileRef = CC487A9B2C71FCFC0021F680 /* Instabug.plist */; }; CCF1E4092B022CF20024802D /* RNInstabugTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF1E4082B022CF20024802D /* RNInstabugTests.m */; }; CD36F4707EA1F435D2CC7A15 /* libPods-InstabugExample-InstabugTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AF7A6E02D40E0CEEA833CC4 /* libPods-InstabugExample-InstabugTests.a */; }; F7BF47401EF3A435254C97BB /* libPods-InstabugExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAED0D0441A708AE2390E153 /* libPods-InstabugExample.a */; }; @@ -57,7 +56,7 @@ BE3328762BDACE030078249A /* IBGCrashReporting+CP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IBGCrashReporting+CP.h"; sourceTree = ""; }; C3C8C24386310A3120006604 /* CrashReportingExampleModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CrashReportingExampleModule.m; sourceTree = ""; }; C3C8C784EADC037C5A752B94 /* CrashReportingExampleModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReportingExampleModule.h; sourceTree = ""; }; - C4E7796400B3B360DD0B6E73 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = InstabugExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + C4E7796400B3B360DD0B6E73 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = InstabugExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; CC3DF8852A1DFC99003E9914 /* InstabugCrashReportingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugCrashReportingTests.m; sourceTree = ""; }; CC3DF8862A1DFC99003E9914 /* InstabugBugReportingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugBugReportingTests.m; sourceTree = ""; }; CC3DF8872A1DFC99003E9914 /* InstabugSampleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugSampleTests.m; sourceTree = ""; }; @@ -67,7 +66,6 @@ CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugSurveysTests.m; sourceTree = ""; }; CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugAPMTests.m; sourceTree = ""; }; CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IBGConstants.m; sourceTree = ""; }; - CC487A9B2C71FCFC0021F680 /* Instabug.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = Instabug.plist; path = InstabugExample/Instabug.plist; sourceTree = ""; }; CCF1E4082B022CF20024802D /* RNInstabugTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNInstabugTests.m; sourceTree = ""; }; DBCB1B1D023646D84146C91E /* Pods-InstabugExample-InstabugTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugExample-InstabugTests.release.xcconfig"; path = "Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -124,7 +122,6 @@ 13B07FAE1A68108700A75B9A /* InstabugExample */ = { isa = PBXGroup; children = ( - CC487A9B2C71FCFC0021F680 /* Instabug.plist */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, @@ -302,7 +299,6 @@ buildActionMask = 2147483647; files = ( 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, - CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, AF8A18C6FA80B2BFE6006C9E /* PrivacyInfo.xcprivacy in Resources */, ); @@ -335,10 +331,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources.sh\"\n"; @@ -396,10 +396,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources.sh\"\n"; @@ -413,10 +417,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks.sh\"\n"; @@ -427,7 +435,11 @@ buildActionMask = 2147483647; files = ( ); + inputPaths = ( + ); name = "[CP-User] [instabug-reactnative] Upload Sourcemap"; + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "#!/bin/sh\n\nmain() {\n # Read environment variables from ios/.xcode.env if it exists\n env_path=\"$PODS_ROOT/../.xcode.env\"\n if [ -f \"$env_path\" ]; then\n source \"$env_path\"\n fi\n\n # Read environment variables from ios/.xcode.env.local if it exists\n local_env_path=\"${ENV_PATH}.local\"\n if [ -f \"$local_env_path\" ]; then\n source \"$local_env_path\"\n fi\n\n if [[ \"$INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\" = true ]]; then\n echo \"[Info] \\`INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\\` was set to true, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ \"$CONFIGURATION\" = \"Debug\" ]]; then\n echo \"[Info] Building in debug mode, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ -z \"$INFOPLIST_FILE\" ]] || [[ -z \"$PROJECT_DIR\" ]]; then\n echo \"[Error] Instabug sourcemaps script must be invoked by Xcode\"\n exit 0\n fi\n\n local source_map_file=$(generate_sourcemaps | tail -n 1)\n\n local js_project_dir=\"$PROJECT_DIR/..\"\n local instabug_dir=$(dirname $(node -p \"require.resolve('instabug-reactnative/package.json')\"))\n local inferred_token=$(cd $js_project_dir && source $instabug_dir/scripts/find-token.sh)\n local app_token=$(resolve_var \"App Token\" \"INSTABUG_APP_TOKEN\" \"$inferred_token\" | tail -n 1)\n\n local inferred_name=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_name=$(resolve_var \"Version Name\" \"INSTABUG_APP_VERSION_NAME\" \"$inferred_name\" | tail -n 1)\n\n local inferred_code=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_code=$(resolve_var \"Version Code\" \"INSTABUG_APP_VERSION_CODE\" \"$inferred_code\" | tail -n 1)\n\n node $instabug_dir/bin/index.js upload-sourcemaps \\\n --platform ios \\\n --file $source_map_file \\\n --token $app_token \\\n --name $version_name \\\n --code $version_code\n}\n\ngenerate_sourcemaps() {\n local react_native_dir=$(dirname $(node -p \"require.resolve('react-native/package.json')\"))\n\n # Fixes an issue with react-native prior to v0.67.0\n # For more info: https://github.com/facebook/react-native/issues/32168\n export RN_DIR=$react_native_dir\n\n # Used withing `react-native-xcode.sh` to generate sourcemap file\n export SOURCEMAP_FILE=\"$(pwd)/main.jsbundle.map\";\n\n source \"$react_native_dir/scripts/react-native-xcode.sh\"\n\n if [[ ! -f \"$SOURCEMAP_FILE\" ]]; then\n echo \"[Error] Unable to find source map file at: $SOURCEMAP_FILE\"\n exit 0\n fi\n\n echo $SOURCEMAP_FILE\n}\n\nresolve_var() {\n local name=$1\n local env_key=$2\n local default_value=$3\n\n local env_value=\"${!env_key}\"\n\n if [[ -n \"$env_value\" ]] && [[ -n \"$default_value\" ]] && [[ \"$env_value\" != default_value ]]; then\n echo \"[Warning] Environment variable \\`$env_key\\` might have incorrect value, make sure this was intentional:\"\n echo \" Environment Value: $env_value\"\n echo \" Default Value: $default_value\"\n fi\n\n local value=\"${env_value:-$default_value}\"\n\n if [[ -z \"$value\" ]]; then\n echo \"[Error] Unable to find $name! Set the environment variable \\`$env_key\\` and try again.\"\n exit 0\n fi\n\n echo $value\n}\n\nmain \"$@\"; exit\n"; @@ -440,10 +452,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks.sh\"\n"; @@ -684,10 +700,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -759,10 +772,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/examples/default/ios/InstabugExample/Instabug.plist b/examples/default/ios/InstabugExample/Instabug.plist deleted file mode 100644 index 24d035f427616a1490762b3e7c6b8861c863c4a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmYc)$jK}&F)+Bq$i&PN=b2Yrl9*JQ?ik=38srlV;{w_70_qthB?ZM+`ud3lnYxJu vxq6vU#d^v4xgbIP;*@OtGUIpwWh9ljRB`aiXaq5U0V5-XW?+TVFscFo;^Zpb diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index 5c34c2892..0d3e454c6 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ebaada4cc..42a84fa71 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2017,15 +2017,15 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 4cb898d0bf20404aab1850c656dcea009429d6c1 - DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 + DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: 69ef571f3de08433d766d614c73a9838a06bf7eb + glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 - instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 + instabug-reactnative-ndk: e6f3fd45d6426aa7d37f479f153b5c2bdc1f5eb9 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1 @@ -2033,73 +2033,73 @@ SPEC CHECKSUMS: RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205 React: c2830fa483b0334bda284e46a8579ebbe0c5447e React-callinvoker: 4aecde929540c26b841a4493f70ebf6016691eb8 - React-Core: 9c059899f00d46b5cec3ed79251f77d9c469553d - React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5 - React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494 + React-Core: 32a581847d74ce9b5f51d9d11a4e4d132ad61553 + React-CoreModules: f53e0674e1747fa41c83bc970e82add97b14ad87 + React-cxxreact: 86f3b1692081fd954a0cb27cc90d14674645b64b React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5 - React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae - React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df - React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8 - React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364 - React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1 + React-defaultsnativemodule: 2ed121c5a1edeab09cff382b8d9b538260f07848 + React-domnativemodule: 4393dd5dd7e13dbe42e69ebc791064a616990f91 + React-Fabric: cbf38ceefb1ac6236897abdb538130228e126695 + React-FabricComponents: dd4b01c4a60920d8dc15f3b5594c6fe9e7648a38 + React-FabricImage: 8b13aedfbd20f349b9b3314baf993c71c02995d9 React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5 - React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803 - React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96 - React-hermes: 2069b08e965e48b7f8aa2c0ca0a2f383349ed55d - React-idlecallbacksnativemodule: e211b2099b6dced97959cb58257bab2b2de4d7ef - React-ImageManager: ab7a7d17dd0ff1ef1d4e1e88197d1119da9957ce - React-jserrorhandler: d9e867bb83b868472f3f7601883f0403b3e3942d - React-jsi: d68f1d516e5120a510afe356647a6a1e1f98f2db - React-jsiexecutor: 6366a08a0fc01c9b65736f8deacd47c4a397912a - React-jsinspector: 0ac947411f0c73b34908800cc7a6a31d8f93e1a8 - React-jsitracing: 0e8c0aadb1fcec6b1e4f2a66ee3b0da80f0f8615 - React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b - React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3 - React-microtasksnativemodule: 2b73e68f0462f3175f98782db08896f8501afd20 - react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe - react-native-config: 8f7283449bbb048902f4e764affbbf24504454af - react-native-google-maps: 1bcc1f9f13f798fcf230db7fe476f3566d0bc0a3 - react-native-maps: 72a8a903f8a1b53e2c777ba79102078ab502e0bf - react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac - react-native-safe-area-context: 142fade490cbebbe428640b8cbdb09daf17e8191 - react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4 - react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9 + React-featureflagsnativemodule: 87b58caf3cd8eca1e53179453789def019af2a65 + React-graphics: f5c4cf3abc5aa083e28fe7a866bd95fb3bbbc1e0 + React-hermes: cad69ee9a53870cc38e5386889aa7ea81c75b6a1 + React-idlecallbacksnativemodule: 445390be0f533797ace18c419eb57110dbfe90d6 + React-ImageManager: cb78d7a24f45f8f9a5a1640b52fce4c9f637f98d + React-jserrorhandler: dfe9b96e99a93d4f4858bad66d5bc4813a87a21a + React-jsi: bc1f6073e203fb540edd6d26f926ad041809b443 + React-jsiexecutor: 1e8fc70dd9614c3e9d5c3c876b2ea3cd1d931ee4 + React-jsinspector: 7544a20e9beac390f1b65d9f0040d97cd55dc198 + React-jsitracing: cac972ccc097db399df8044e49add8e5b25cb34a + React-logger: 80d87daf2f98bf95ab668b79062c1e0c3f0c2f8a + React-Mapbuffer: acffb35a53a5f474ede09f082ac609b41aafab2e + React-microtasksnativemodule: 71ca9282bce93b319218d75362c0d646b376eb43 + react-native-background-timer: 4638ae3bee00320753647900b21260b10587b6f7 + react-native-config: ea75335a7cca1d3326de1da384227e580a7c082e + react-native-google-maps: 98754480fbb4fd5ccd016d0f75a2168a6c84ebc5 + react-native-maps: 6f92b1fd37f9421b171c977a42785270703875dc + react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 + react-native-safe-area-context: 8b8404e70b0cbf2a56428a17017c14c1dcc16448 + react-native-slider: fc7f35c082abec47e341dfe43657a1c26f38db2f + react-native-webview: 042b9dfd509d23e7ebc07da06c38a8bcc4679d46 React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794 - React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614 + React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5 React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914 - React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed + React-performancetimeline: 3e3f5c5576fe1cc2dd5fcfb1ae2046d5dceda3d7 React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc - React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc - React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631 - React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9 - React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689 - React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465 - React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d - React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91 - React-RCTSettings: e10b8e42b0fce8a70fbf169de32a2ae03243ef6b - React-RCTText: e7bf9f4997a1a0b45c052d4ad9a0fe653061cf29 - React-RCTVibration: 5b70b7f11e48d1c57e0d4832c2097478adbabe93 + React-RCTAnimation: 051f0781709c5ed80ba8aa2b421dfb1d72a03162 + React-RCTAppDelegate: 106d225d076988b06aa4834e68d1ab754f40cacf + React-RCTBlob: 895eaf8bca2e76ee1c95b479235c6ccebe586fc6 + React-RCTFabric: 8d01df202ee9e933f9b5dd44b72ec89a7ac6ee01 + React-RCTImage: b73149c0cd54b641dba2d6250aaf168fee784d9f + React-RCTLinking: 23e519712285427e50372fbc6e0265d422abf462 + React-RCTNetwork: a5d06d122588031989115f293654b13353753630 + React-RCTSettings: 87d03b5d94e6eadd1e8c1d16a62f790751aafb55 + React-RCTText: 75e9dd39684f4bcd1836134ac2348efaca7437b3 + React-RCTVibration: 033c161fe875e6fa096d0d9733c2e2501682e3d4 React-rendererconsistency: f620c6e003e3c4593e6349d8242b8aeb3d4633f0 - React-rendererdebug: e697680f4dd117becc5daf9ea9800067abcee91c + React-rendererdebug: 5be7b834677b2a7a263f4d2545f0d4966cafad82 React-rncore: c22bd84cc2f38947f0414fab6646db22ff4f80cd - React-RuntimeApple: de0976836b90b484305638616898cbc665c67c13 - React-RuntimeCore: 3c4a5aa63d9e7a3c17b7fb23f32a72a8bcfccf57 + React-RuntimeApple: 71160e6c02efa07d198b84ef5c3a52a7d9d0399d + React-RuntimeCore: f88f79ec995c12af56a265d7505c7630733d9d82 React-runtimeexecutor: ea90d8e3a9e0f4326939858dafc6ab17c031a5d3 - React-RuntimeHermes: c6b0afdf1f493621214eeb6517fb859ce7b21b81 - React-runtimescheduler: 84f0d876d254bce6917a277b3930eb9bc29df6c7 - React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0 - ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1 - ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad - RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb - RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: c1334b03231d29e6abb93b93de52190cd325ce65 - RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb - RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 - RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d - RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 + React-RuntimeHermes: 49f86328914021f50fd5a5b9756685f5f6d8b4da + React-runtimescheduler: fed70991b942c6df752a59a22081e45fc811b11c + React-utils: 02526ea15628a768b8db9517b6017a1785c734d2 + ReactCodegen: 8b5341ecb61898b8bd40a73ebc443c6bf2d14423 + ReactCommon: 36d48f542b4010786d6b2bcee615fe5f906b7105 + RNCClipboard: 7c3e3b5f71d84ef61690ad377b6c50cf27864ff5 + RNGestureHandler: 27a63f2218affdf1a426d56682f9b174904838b3 + RNInstabug: 1eed7d7d7bd3557bd62789d531753fcb608ebb28 + RNReanimated: 8bf536bd3964d10a9bacabf179897e79f6bea34f + RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 + RNSVG: 8542aa11770b27563714bbd8494a8436385fc85f + RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.14.0 +COCOAPODS: 1.16.2 diff --git a/ios/native.rb b/ios/native.rb index 1ca2aded7..8296dbcdb 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.24' } +$instabug = { :version => '15.1.26' } def use_instabug! (spec = nil) version = $instabug[:version] From 0b230379af11b9e246c035e78e28906ea61bcd76 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Thu, 7 Aug 2025 10:41:01 +0300 Subject: [PATCH 38/62] chore: remove properties override from iOS --- .../InstabugExample.xcodeproj/project.pbxproj | 30 ++-- examples/default/ios/Podfile.lock | 134 +++++++++--------- 2 files changed, 75 insertions(+), 89 deletions(-) diff --git a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj index 6cbf4e3b0..9424acb7e 100644 --- a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj +++ b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj @@ -331,14 +331,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources.sh\"\n"; @@ -396,14 +392,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources.sh\"\n"; @@ -417,14 +409,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks.sh\"\n"; @@ -435,11 +423,7 @@ buildActionMask = 2147483647; files = ( ); - inputPaths = ( - ); name = "[CP-User] [instabug-reactnative] Upload Sourcemap"; - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "#!/bin/sh\n\nmain() {\n # Read environment variables from ios/.xcode.env if it exists\n env_path=\"$PODS_ROOT/../.xcode.env\"\n if [ -f \"$env_path\" ]; then\n source \"$env_path\"\n fi\n\n # Read environment variables from ios/.xcode.env.local if it exists\n local_env_path=\"${ENV_PATH}.local\"\n if [ -f \"$local_env_path\" ]; then\n source \"$local_env_path\"\n fi\n\n if [[ \"$INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\" = true ]]; then\n echo \"[Info] \\`INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\\` was set to true, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ \"$CONFIGURATION\" = \"Debug\" ]]; then\n echo \"[Info] Building in debug mode, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ -z \"$INFOPLIST_FILE\" ]] || [[ -z \"$PROJECT_DIR\" ]]; then\n echo \"[Error] Instabug sourcemaps script must be invoked by Xcode\"\n exit 0\n fi\n\n local source_map_file=$(generate_sourcemaps | tail -n 1)\n\n local js_project_dir=\"$PROJECT_DIR/..\"\n local instabug_dir=$(dirname $(node -p \"require.resolve('instabug-reactnative/package.json')\"))\n local inferred_token=$(cd $js_project_dir && source $instabug_dir/scripts/find-token.sh)\n local app_token=$(resolve_var \"App Token\" \"INSTABUG_APP_TOKEN\" \"$inferred_token\" | tail -n 1)\n\n local inferred_name=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_name=$(resolve_var \"Version Name\" \"INSTABUG_APP_VERSION_NAME\" \"$inferred_name\" | tail -n 1)\n\n local inferred_code=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_code=$(resolve_var \"Version Code\" \"INSTABUG_APP_VERSION_CODE\" \"$inferred_code\" | tail -n 1)\n\n node $instabug_dir/bin/index.js upload-sourcemaps \\\n --platform ios \\\n --file $source_map_file \\\n --token $app_token \\\n --name $version_name \\\n --code $version_code\n}\n\ngenerate_sourcemaps() {\n local react_native_dir=$(dirname $(node -p \"require.resolve('react-native/package.json')\"))\n\n # Fixes an issue with react-native prior to v0.67.0\n # For more info: https://github.com/facebook/react-native/issues/32168\n export RN_DIR=$react_native_dir\n\n # Used withing `react-native-xcode.sh` to generate sourcemap file\n export SOURCEMAP_FILE=\"$(pwd)/main.jsbundle.map\";\n\n source \"$react_native_dir/scripts/react-native-xcode.sh\"\n\n if [[ ! -f \"$SOURCEMAP_FILE\" ]]; then\n echo \"[Error] Unable to find source map file at: $SOURCEMAP_FILE\"\n exit 0\n fi\n\n echo $SOURCEMAP_FILE\n}\n\nresolve_var() {\n local name=$1\n local env_key=$2\n local default_value=$3\n\n local env_value=\"${!env_key}\"\n\n if [[ -n \"$env_value\" ]] && [[ -n \"$default_value\" ]] && [[ \"$env_value\" != default_value ]]; then\n echo \"[Warning] Environment variable \\`$env_key\\` might have incorrect value, make sure this was intentional:\"\n echo \" Environment Value: $env_value\"\n echo \" Default Value: $default_value\"\n fi\n\n local value=\"${env_value:-$default_value}\"\n\n if [[ -z \"$value\" ]]; then\n echo \"[Error] Unable to find $name! Set the environment variable \\`$env_key\\` and try again.\"\n exit 0\n fi\n\n echo $value\n}\n\nmain \"$@\"; exit\n"; @@ -452,14 +436,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks.sh\"\n"; @@ -700,7 +680,10 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -772,7 +755,10 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 42a84fa71..eab18a2da 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.24) + - Instabug (15.1.26) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.24) + - Instabug (= 15.1.26) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2017,15 +2017,15 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 4cb898d0bf20404aab1850c656dcea009429d6c1 - DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 + DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b + glog: 69ef571f3de08433d766d614c73a9838a06bf7eb Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 - instabug-reactnative-ndk: e6f3fd45d6426aa7d37f479f153b5c2bdc1f5eb9 + Instabug: c47bd604b5212496da79b19b368eb5de73833d69 + instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1 @@ -2033,73 +2033,73 @@ SPEC CHECKSUMS: RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205 React: c2830fa483b0334bda284e46a8579ebbe0c5447e React-callinvoker: 4aecde929540c26b841a4493f70ebf6016691eb8 - React-Core: 32a581847d74ce9b5f51d9d11a4e4d132ad61553 - React-CoreModules: f53e0674e1747fa41c83bc970e82add97b14ad87 - React-cxxreact: 86f3b1692081fd954a0cb27cc90d14674645b64b + React-Core: 9c059899f00d46b5cec3ed79251f77d9c469553d + React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5 + React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494 React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5 - React-defaultsnativemodule: 2ed121c5a1edeab09cff382b8d9b538260f07848 - React-domnativemodule: 4393dd5dd7e13dbe42e69ebc791064a616990f91 - React-Fabric: cbf38ceefb1ac6236897abdb538130228e126695 - React-FabricComponents: dd4b01c4a60920d8dc15f3b5594c6fe9e7648a38 - React-FabricImage: 8b13aedfbd20f349b9b3314baf993c71c02995d9 + React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae + React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df + React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8 + React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364 + React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1 React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5 - React-featureflagsnativemodule: 87b58caf3cd8eca1e53179453789def019af2a65 - React-graphics: f5c4cf3abc5aa083e28fe7a866bd95fb3bbbc1e0 - React-hermes: cad69ee9a53870cc38e5386889aa7ea81c75b6a1 - React-idlecallbacksnativemodule: 445390be0f533797ace18c419eb57110dbfe90d6 - React-ImageManager: cb78d7a24f45f8f9a5a1640b52fce4c9f637f98d - React-jserrorhandler: dfe9b96e99a93d4f4858bad66d5bc4813a87a21a - React-jsi: bc1f6073e203fb540edd6d26f926ad041809b443 - React-jsiexecutor: 1e8fc70dd9614c3e9d5c3c876b2ea3cd1d931ee4 - React-jsinspector: 7544a20e9beac390f1b65d9f0040d97cd55dc198 - React-jsitracing: cac972ccc097db399df8044e49add8e5b25cb34a - React-logger: 80d87daf2f98bf95ab668b79062c1e0c3f0c2f8a - React-Mapbuffer: acffb35a53a5f474ede09f082ac609b41aafab2e - React-microtasksnativemodule: 71ca9282bce93b319218d75362c0d646b376eb43 - react-native-background-timer: 4638ae3bee00320753647900b21260b10587b6f7 - react-native-config: ea75335a7cca1d3326de1da384227e580a7c082e - react-native-google-maps: 98754480fbb4fd5ccd016d0f75a2168a6c84ebc5 - react-native-maps: 6f92b1fd37f9421b171c977a42785270703875dc - react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 - react-native-safe-area-context: 8b8404e70b0cbf2a56428a17017c14c1dcc16448 - react-native-slider: fc7f35c082abec47e341dfe43657a1c26f38db2f - react-native-webview: 042b9dfd509d23e7ebc07da06c38a8bcc4679d46 + React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803 + React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96 + React-hermes: 2069b08e965e48b7f8aa2c0ca0a2f383349ed55d + React-idlecallbacksnativemodule: e211b2099b6dced97959cb58257bab2b2de4d7ef + React-ImageManager: ab7a7d17dd0ff1ef1d4e1e88197d1119da9957ce + React-jserrorhandler: d9e867bb83b868472f3f7601883f0403b3e3942d + React-jsi: d68f1d516e5120a510afe356647a6a1e1f98f2db + React-jsiexecutor: 6366a08a0fc01c9b65736f8deacd47c4a397912a + React-jsinspector: 0ac947411f0c73b34908800cc7a6a31d8f93e1a8 + React-jsitracing: 0e8c0aadb1fcec6b1e4f2a66ee3b0da80f0f8615 + React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b + React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3 + React-microtasksnativemodule: 2b73e68f0462f3175f98782db08896f8501afd20 + react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe + react-native-config: 8f7283449bbb048902f4e764affbbf24504454af + react-native-google-maps: 1bcc1f9f13f798fcf230db7fe476f3566d0bc0a3 + react-native-maps: 72a8a903f8a1b53e2c777ba79102078ab502e0bf + react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac + react-native-safe-area-context: 142fade490cbebbe428640b8cbdb09daf17e8191 + react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4 + react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9 React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794 - React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5 + React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614 React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914 - React-performancetimeline: 3e3f5c5576fe1cc2dd5fcfb1ae2046d5dceda3d7 + React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc - React-RCTAnimation: 051f0781709c5ed80ba8aa2b421dfb1d72a03162 - React-RCTAppDelegate: 106d225d076988b06aa4834e68d1ab754f40cacf - React-RCTBlob: 895eaf8bca2e76ee1c95b479235c6ccebe586fc6 - React-RCTFabric: 8d01df202ee9e933f9b5dd44b72ec89a7ac6ee01 - React-RCTImage: b73149c0cd54b641dba2d6250aaf168fee784d9f - React-RCTLinking: 23e519712285427e50372fbc6e0265d422abf462 - React-RCTNetwork: a5d06d122588031989115f293654b13353753630 - React-RCTSettings: 87d03b5d94e6eadd1e8c1d16a62f790751aafb55 - React-RCTText: 75e9dd39684f4bcd1836134ac2348efaca7437b3 - React-RCTVibration: 033c161fe875e6fa096d0d9733c2e2501682e3d4 + React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc + React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631 + React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9 + React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689 + React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465 + React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d + React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91 + React-RCTSettings: e10b8e42b0fce8a70fbf169de32a2ae03243ef6b + React-RCTText: e7bf9f4997a1a0b45c052d4ad9a0fe653061cf29 + React-RCTVibration: 5b70b7f11e48d1c57e0d4832c2097478adbabe93 React-rendererconsistency: f620c6e003e3c4593e6349d8242b8aeb3d4633f0 - React-rendererdebug: 5be7b834677b2a7a263f4d2545f0d4966cafad82 + React-rendererdebug: e697680f4dd117becc5daf9ea9800067abcee91c React-rncore: c22bd84cc2f38947f0414fab6646db22ff4f80cd - React-RuntimeApple: 71160e6c02efa07d198b84ef5c3a52a7d9d0399d - React-RuntimeCore: f88f79ec995c12af56a265d7505c7630733d9d82 + React-RuntimeApple: de0976836b90b484305638616898cbc665c67c13 + React-RuntimeCore: 3c4a5aa63d9e7a3c17b7fb23f32a72a8bcfccf57 React-runtimeexecutor: ea90d8e3a9e0f4326939858dafc6ab17c031a5d3 - React-RuntimeHermes: 49f86328914021f50fd5a5b9756685f5f6d8b4da - React-runtimescheduler: fed70991b942c6df752a59a22081e45fc811b11c - React-utils: 02526ea15628a768b8db9517b6017a1785c734d2 - ReactCodegen: 8b5341ecb61898b8bd40a73ebc443c6bf2d14423 - ReactCommon: 36d48f542b4010786d6b2bcee615fe5f906b7105 - RNCClipboard: 7c3e3b5f71d84ef61690ad377b6c50cf27864ff5 - RNGestureHandler: 27a63f2218affdf1a426d56682f9b174904838b3 - RNInstabug: 1eed7d7d7bd3557bd62789d531753fcb608ebb28 - RNReanimated: 8bf536bd3964d10a9bacabf179897e79f6bea34f - RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 - RNSVG: 8542aa11770b27563714bbd8494a8436385fc85f - RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 + React-RuntimeHermes: c6b0afdf1f493621214eeb6517fb859ce7b21b81 + React-runtimescheduler: 84f0d876d254bce6917a277b3930eb9bc29df6c7 + React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0 + ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1 + ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad + RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb + RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 + RNInstabug: 35bf420d77731598fae13c33ceecf0343fd8dd99 + RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb + RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 + RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d + RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 +PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 -COCOAPODS: 1.16.2 +COCOAPODS: 1.15.2 From 432295eb542896f5d0294afd0cb7f8b312d250be Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 14 Jul 2025 11:57:01 +0300 Subject: [PATCH 39/62] chore: add ios native APIs --- .gitignore | 3 +++ examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 18 +++++++------ examples/default/src/App.tsx | 3 ++- .../default/src/screens/apm/APMScreen.tsx | 25 +++++++++++++++++++ ios/RNInstabug/InstabugAPMBridge.h | 2 ++ ios/RNInstabug/InstabugAPMBridge.m | 4 +++ ios/native.rb | 2 +- src/modules/APM.ts | 8 ++++++ src/native/NativeAPM.ts | 3 +++ 10 files changed, 59 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 4033aaa3b..efad193fc 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,6 @@ android/keystores/debug.keystore # .idea run configurations /.run/* +.yarn/ +examples/default/.yarn/ +examples/default/ios/.xcode.env.local diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index e1dda08e3..d8659054c 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 0d7d7a1ff..ddf819b04 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.1) + - Instabug (15.1.15) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.1) + - Instabug (= 15.1.15) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,6 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1850,7 +1851,6 @@ SPEC REPOS: trunk: - Google-Maps-iOS-Utils - GoogleMaps - - Instabug - OCMock - SocketRocket @@ -1868,6 +1868,8 @@ EXTERNAL SOURCES: hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b + Instabug: + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2022,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 3e7af445c14d7823fcdecba223f09b5f7c0c6ce1 + Instabug: ed81d3e95f406f0e6d808e91a42dae929dfd4908 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2090,14 +2092,14 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: f17d4e6c679fbc921f2692c223a1c21395589cc5 + RNInstabug: fc1585dd6ede766139ab908b103d43efdcc8899a RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 837b933596e1616ff02cc206bb17dee4f611fdbc +PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index ceef8bc19..ddab728b2 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -5,6 +5,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { + APM, CrashReporting, InvocationEvent, LaunchType, @@ -69,7 +70,7 @@ export const App: React.FC = () => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; }); - // NetworkLogger.setRequestFilterExpression('false'); + APM.setScreenRenderEnabled(false); }); }); diff --git a/examples/default/src/screens/apm/APMScreen.tsx b/examples/default/src/screens/apm/APMScreen.tsx index 109c70d1d..920451c75 100644 --- a/examples/default/src/screens/apm/APMScreen.tsx +++ b/examples/default/src/screens/apm/APMScreen.tsx @@ -37,6 +37,31 @@ export const APMScreen: React.FC navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> + + { + // Simulate slow rendering + const heavyComputation = () => { + for (let i = 0; i < 1000000; i++) { + Math.random() * Math.random(); + } + }; + heavyComputation(); + showNotification('Slow Frames', 'Heavy computation executed to simulate slow frames'); + }} + /> + { + const freezeDuration = 3000; // 3 seconds + const start = Date.now(); + while (Date.now() - start < freezeDuration) { + // Busy wait to block JS thread + } + showNotification('Frozen Frames', `UI frozen for ${freezeDuration / 1000} seconds`); + }} + /> ); }; diff --git a/ios/RNInstabug/InstabugAPMBridge.h b/ios/RNInstabug/InstabugAPMBridge.h index 6b09dba6b..894fc5ed1 100644 --- a/ios/RNInstabug/InstabugAPMBridge.h +++ b/ios/RNInstabug/InstabugAPMBridge.h @@ -21,6 +21,8 @@ - (void)startUITrace:(NSString *)name; - (void)endUITrace; +- (void)setScreenRenderEnabled:(BOOL)isEnabled; + extern NSMutableDictionary *traces; @end diff --git a/ios/RNInstabug/InstabugAPMBridge.m b/ios/RNInstabug/InstabugAPMBridge.m index 29319264d..fec8f150f 100644 --- a/ios/RNInstabug/InstabugAPMBridge.m +++ b/ios/RNInstabug/InstabugAPMBridge.m @@ -89,6 +89,10 @@ - (id) init [IBGAPM endUITrace]; } +// Enables or disables screen render. +RCT_EXPORT_METHOD(setScreenRenderEnabled:(BOOL)isEnabled) { + IBGAPM.screenRenderingEnabled = isEnabled; +} diff --git a/ios/native.rb b/ios/native.rb index 41f497687..08e43fdae 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.1' } +$instabug = { :version => '15.1.15' } def use_instabug! (spec = nil) version = $instabug[:version] diff --git a/src/modules/APM.ts b/src/modules/APM.ts index 9f2dcbe01..bc6de2fb9 100644 --- a/src/modules/APM.ts +++ b/src/modules/APM.ts @@ -115,3 +115,11 @@ export const endUITrace = () => { export const _ibgSleep = () => { NativeAPM.ibgSleep(); }; + +/** + * Enables or disables Screen Render feature + * @param isEnabled + */ +export const setScreenRenderEnabled = (isEnabled: boolean) => { + NativeAPM.setScreenRenderEnabled(isEnabled); +}; diff --git a/src/native/NativeAPM.ts b/src/native/NativeAPM.ts index 86d017167..2e7594fd5 100644 --- a/src/native/NativeAPM.ts +++ b/src/native/NativeAPM.ts @@ -44,6 +44,9 @@ export interface ApmNativeModule extends NativeModule { startUITrace(name: string): void; endUITrace(): void; ibgSleep(): void; + + // Screen Rendering // + setScreenRenderEnabled(isEnabled: boolean): void; } export const NativeAPM = NativeModules.IBGAPM; From 2944c2a774027297f9dbc9924be9f05b5a629435 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Tue, 15 Jul 2025 13:38:55 +0300 Subject: [PATCH 40/62] chore: pull changes from remove_deprecate_apis branch using rebase --- android/native.gradle | 2 +- .../reactlibrary/RNInstabugAPMModule.java | 212 ++++++++++-------- examples/default/src/App.tsx | 3 +- 3 files changed, 117 insertions(+), 100 deletions(-) diff --git a/android/native.gradle b/android/native.gradle index faa3246cd..f33c0b543 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.1' + version: '15.0.1.6985154-SNAPSHOT' ] dependencies { diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java index 6ed3541cb..e1960b7cd 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java @@ -1,6 +1,8 @@ package com.instabug.reactlibrary; +import static com.instabug.reactlibrary.utils.InstabugUtil.getMethod; + import android.os.SystemClock; import android.util.Log; @@ -15,17 +17,13 @@ import com.instabug.apm.networking.APMNetworkLogger; import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.reactlibrary.utils.EventEmitterModule; -import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.reactlibrary.utils.MainThreadHandler; import java.lang.reflect.Method; - import java.util.HashMap; import javax.annotation.Nonnull; -import static com.instabug.reactlibrary.utils.InstabugUtil.getMethod; - public class RNInstabugAPMModule extends EventEmitterModule { public RNInstabugAPMModule(ReactApplicationContext reactApplicationContext) { @@ -240,73 +238,73 @@ public void run() { }); } - /** - * The `networkLogAndroid` function logs network-related information using APMNetworkLogger in a React - * Native module. - * - * @param requestStartTime The `requestStartTime` parameter in the `networkLogAndroid` method - * represents the timestamp when the network request started. It is of type `double` and is passed as - * a parameter to log network-related information. - * @param requestDuration The `requestDuration` parameter in the `networkLogAndroid` method represents - * the duration of the network request in milliseconds. It indicates the time taken for the request to - * complete from the moment it was initiated until the response was received. This parameter helps in - * measuring the performance of network requests and identifying any potential - * @param requestHeaders requestHeaders is a string parameter that contains the headers of the network - * request. It typically includes information such as the content type, authorization token, and any - * other headers that were sent with the request. - * @param requestBody The `requestBody` parameter in the `networkLogAndroid` method represents the - * body of the HTTP request being logged. It contains the data that is sent as part of the request to - * the server. This could include form data, JSON payload, XML data, or any other content that is - * being transmitted - * @param requestBodySize The `requestBodySize` parameter in the `networkLogAndroid` method represents - * the size of the request body in bytes. It is a double value that indicates the size of the request - * body being sent in the network request. This parameter is used to log information related to the - * network request, including details - * @param requestMethod The `requestMethod` parameter in the `networkLogAndroid` method represents the - * HTTP method used in the network request, such as GET, POST, PUT, DELETE, etc. It indicates the type - * of operation that the client is requesting from the server. - * @param requestUrl The `requestUrl` parameter in the `networkLogAndroid` method represents the URL - * of the network request being logged. It typically contains the address of the server to which the - * request is being made, along with any additional path or query parameters required for the request. - * This URL is essential for identifying the - * @param requestContentType The `requestContentType` parameter in the `networkLogAndroid` method - * represents the content type of the request being made. This could be values like - * "application/json", "application/xml", "text/plain", etc., indicating the format of the data being - * sent in the request body. It helps in specifying - * @param responseHeaders The `responseHeaders` parameter in the `networkLogAndroid` method represents - * the headers of the response received from a network request. These headers typically include - * information such as content type, content length, server information, and any other metadata - * related to the response. The `responseHeaders` parameter is expected to - * @param responseBody The `responseBody` parameter in the `networkLogAndroid` method represents the - * body of the response received from a network request. It contains the data or content sent back by - * the server in response to the request made by the client. This could be in various formats such as - * JSON, XML, HTML - * @param responseBodySize The `responseBodySize` parameter in the `networkLogAndroid` method - * represents the size of the response body in bytes. It is a double value that indicates the size of - * the response body received from the network request. This parameter is used to log information - * related to the network request and response, including - * @param statusCode The `statusCode` parameter in the `networkLogAndroid` method represents the HTTP - * status code of the network request/response. It indicates the status of the HTTP response, such as - * success (200), redirection (3xx), client errors (4xx), or server errors (5xx). This parameter is - * @param responseContentType The `responseContentType` parameter in the `networkLogAndroid` method - * represents the content type of the response received from the network request. It indicates the - * format of the data in the response, such as JSON, XML, HTML, etc. This information is useful for - * understanding how to parse and handle the - * @param errorDomain The `errorDomain` parameter in the `networkLogAndroid` method is used to specify - * the domain of an error, if any occurred during the network request. If there was no error, this - * parameter will be `null`. - * @param w3cAttributes The `w3cAttributes` parameter in the `networkLogAndroid` method is a - * ReadableMap object that contains additional attributes related to W3C external trace. It may - * include the following key-value pairs: - * @param gqlQueryName The `gqlQueryName` parameter in the `networkLogAndroid` method represents the - * name of the GraphQL query being executed. It is a nullable parameter, meaning it can be null if no - * GraphQL query name is provided. This parameter is used to log information related to GraphQL - * queries in the network logging - * @param serverErrorMessage The `serverErrorMessage` parameter in the `networkLogAndroid` method is - * used to pass any error message received from the server during network communication. This message - * can provide additional details about any errors that occurred on the server side, helping in - * debugging and troubleshooting network-related issues. - */ + /** + * The `networkLogAndroid` function logs network-related information using APMNetworkLogger in a React + * Native module. + * + * @param requestStartTime The `requestStartTime` parameter in the `networkLogAndroid` method + * represents the timestamp when the network request started. It is of type `double` and is passed as + * a parameter to log network-related information. + * @param requestDuration The `requestDuration` parameter in the `networkLogAndroid` method represents + * the duration of the network request in milliseconds. It indicates the time taken for the request to + * complete from the moment it was initiated until the response was received. This parameter helps in + * measuring the performance of network requests and identifying any potential + * @param requestHeaders requestHeaders is a string parameter that contains the headers of the network + * request. It typically includes information such as the content type, authorization token, and any + * other headers that were sent with the request. + * @param requestBody The `requestBody` parameter in the `networkLogAndroid` method represents the + * body of the HTTP request being logged. It contains the data that is sent as part of the request to + * the server. This could include form data, JSON payload, XML data, or any other content that is + * being transmitted + * @param requestBodySize The `requestBodySize` parameter in the `networkLogAndroid` method represents + * the size of the request body in bytes. It is a double value that indicates the size of the request + * body being sent in the network request. This parameter is used to log information related to the + * network request, including details + * @param requestMethod The `requestMethod` parameter in the `networkLogAndroid` method represents the + * HTTP method used in the network request, such as GET, POST, PUT, DELETE, etc. It indicates the type + * of operation that the client is requesting from the server. + * @param requestUrl The `requestUrl` parameter in the `networkLogAndroid` method represents the URL + * of the network request being logged. It typically contains the address of the server to which the + * request is being made, along with any additional path or query parameters required for the request. + * This URL is essential for identifying the + * @param requestContentType The `requestContentType` parameter in the `networkLogAndroid` method + * represents the content type of the request being made. This could be values like + * "application/json", "application/xml", "text/plain", etc., indicating the format of the data being + * sent in the request body. It helps in specifying + * @param responseHeaders The `responseHeaders` parameter in the `networkLogAndroid` method represents + * the headers of the response received from a network request. These headers typically include + * information such as content type, content length, server information, and any other metadata + * related to the response. The `responseHeaders` parameter is expected to + * @param responseBody The `responseBody` parameter in the `networkLogAndroid` method represents the + * body of the response received from a network request. It contains the data or content sent back by + * the server in response to the request made by the client. This could be in various formats such as + * JSON, XML, HTML + * @param responseBodySize The `responseBodySize` parameter in the `networkLogAndroid` method + * represents the size of the response body in bytes. It is a double value that indicates the size of + * the response body received from the network request. This parameter is used to log information + * related to the network request and response, including + * @param statusCode The `statusCode` parameter in the `networkLogAndroid` method represents the HTTP + * status code of the network request/response. It indicates the status of the HTTP response, such as + * success (200), redirection (3xx), client errors (4xx), or server errors (5xx). This parameter is + * @param responseContentType The `responseContentType` parameter in the `networkLogAndroid` method + * represents the content type of the response received from the network request. It indicates the + * format of the data in the response, such as JSON, XML, HTML, etc. This information is useful for + * understanding how to parse and handle the + * @param errorDomain The `errorDomain` parameter in the `networkLogAndroid` method is used to specify + * the domain of an error, if any occurred during the network request. If there was no error, this + * parameter will be `null`. + * @param w3cAttributes The `w3cAttributes` parameter in the `networkLogAndroid` method is a + * ReadableMap object that contains additional attributes related to W3C external trace. It may + * include the following key-value pairs: + * @param gqlQueryName The `gqlQueryName` parameter in the `networkLogAndroid` method represents the + * name of the GraphQL query being executed. It is a nullable parameter, meaning it can be null if no + * GraphQL query name is provided. This parameter is used to log information related to GraphQL + * queries in the network logging + * @param serverErrorMessage The `serverErrorMessage` parameter in the `networkLogAndroid` method is + * used to pass any error message received from the server during network communication. This message + * can provide additional details about any errors that occurred on the server side, helping in + * debugging and troubleshooting network-related issues. + */ @ReactMethod private void networkLogAndroid(final double requestStartTime, final double requestDuration, @@ -325,15 +323,15 @@ private void networkLogAndroid(final double requestStartTime, @Nullable final ReadableMap w3cAttributes, @Nullable final String gqlQueryName, @Nullable final String serverErrorMessage - ) { + ) { try { APMNetworkLogger networkLogger = new APMNetworkLogger(); final boolean hasError = errorDomain != null && !errorDomain.isEmpty(); final String errorMessage = hasError ? errorDomain : null; - Boolean isW3cHeaderFound=false; - Long partialId=null; - Long networkStartTimeInSeconds=null; + Boolean isW3cHeaderFound = false; + Long partialId = null; + Long networkStartTimeInSeconds = null; try { @@ -342,7 +340,7 @@ private void networkLogAndroid(final double requestStartTime, } if (!w3cAttributes.isNull("partialId")) { - partialId =(long) w3cAttributes.getDouble("partialId"); + partialId = (long) w3cAttributes.getDouble("partialId"); networkStartTimeInSeconds = (long) w3cAttributes.getDouble("networkStartTimeInSeconds"); } @@ -360,34 +358,54 @@ private void networkLogAndroid(final double requestStartTime, try { Method method = getMethod(Class.forName("com.instabug.apm.networking.APMNetworkLogger"), "log", long.class, long.class, String.class, String.class, long.class, String.class, String.class, String.class, String.class, String.class, long.class, int.class, String.class, String.class, String.class, String.class, APMCPNetworkLog.W3CExternalTraceAttributes.class); if (method != null) { - method.invoke( - networkLogger, - (long) requestStartTime * 1000, - (long) requestDuration, - requestHeaders, - requestBody, - (long) requestBodySize, - requestMethod, - requestUrl, - requestContentType, - responseHeaders, - responseBody, - (long)responseBodySize, - (int) statusCode, - responseContentType, - errorMessage, - gqlQueryName, - serverErrorMessage, - w3cExternalTraceAttributes - ); + method.invoke( + networkLogger, + (long) requestStartTime * 1000, + (long) requestDuration, + requestHeaders, + requestBody, + (long) requestBodySize, + requestMethod, + requestUrl, + requestContentType, + responseHeaders, + responseBody, + (long) responseBodySize, + (int) statusCode, + responseContentType, + errorMessage, + gqlQueryName, + serverErrorMessage, + w3cExternalTraceAttributes + ); } else { Log.e("IB-CP-Bridge", "APMNetworkLogger.log was not found by reflection"); } } catch (Throwable e) { e.printStackTrace(); } - } catch(Throwable e) { + } catch (Throwable e) { e.printStackTrace(); } } + + + /** + * Enables or disables screen rendering + * + * @param isEnabled boolean indicating enabled or disabled. + */ + @ReactMethod + public void setScreenRenderEnabled(boolean isEnabled) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + APM.setScreenRenderingEnabled(isEnabled); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } } diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index ddab728b2..2fc62edbe 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -5,7 +5,6 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { - APM, CrashReporting, InvocationEvent, LaunchType, @@ -70,7 +69,7 @@ export const App: React.FC = () => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; }); - APM.setScreenRenderEnabled(false); + // APM.setScreenRenderEnabled(true); }); }); From ce90c4f36768fdab2487875983ff90dd09bb09db Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 20 Jul 2025 15:45:39 +0300 Subject: [PATCH 41/62] add screen render to sample app , add unit testing to android, ios and RN --- .../RNInstabugReactnativeModule.java | 45 ++- .../reactlibrary/RNInstabugAPMModuleTest.java | 8 + .../ios/InstabugTests/InstabugAPMTests.m | 25 ++ examples/default/src/navigation/HomeStack.tsx | 8 + .../default/src/screens/apm/APMScreen.tsx | 26 +- .../default/src/screens/apm/ScreenRender.tsx | 317 ++++++++++++++++++ test/mocks/mockAPM.ts | 1 + test/modules/APM.spec.ts | 7 + 8 files changed, 389 insertions(+), 48 deletions(-) create mode 100644 examples/default/src/screens/apm/ScreenRender.tsx diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index da8ff03f1..ab97d4c81 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -30,7 +30,6 @@ import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.uimanager.UIManagerModule; import com.instabug.apm.InternalAPM; -import com.instabug.apm.configuration.cp.APMFeature; import com.instabug.library.Feature; import com.instabug.library.Instabug; import com.instabug.library.InstabugColorTheme; @@ -39,12 +38,11 @@ import com.instabug.library.LogLevel; import com.instabug.library.ReproConfigurations; import com.instabug.library.core.InstabugCore; +import com.instabug.library.featuresflags.model.IBGFeatureFlag; import com.instabug.library.internal.crossplatform.CoreFeature; import com.instabug.library.internal.crossplatform.CoreFeaturesState; import com.instabug.library.internal.crossplatform.FeaturesStateListener; import com.instabug.library.internal.crossplatform.InternalCore; -import com.instabug.library.featuresflags.model.IBGFeatureFlag; -import com.instabug.library.internal.crossplatform.InternalCore; import com.instabug.library.internal.crossplatform.OnFeaturesUpdatedListener; import com.instabug.library.internal.module.InstabugLocale; import com.instabug.library.invocation.InstabugInvocationEvent; @@ -53,11 +51,9 @@ import com.instabug.library.model.NetworkLog; import com.instabug.library.model.Report; import com.instabug.library.ui.onboarding.WelcomeMessage; -import com.instabug.library.util.InstabugSDKLogger; import com.instabug.reactlibrary.utils.ArrayUtil; import com.instabug.reactlibrary.utils.EventEmitterModule; import com.instabug.reactlibrary.utils.MainThreadHandler; - import com.instabug.reactlibrary.utils.RNTouchedViewExtractor; import org.json.JSONException; @@ -120,6 +116,7 @@ public void removeListeners(Integer count) { /** * Enables or disables Instabug functionality. + * * @param isEnabled A boolean to enable/disable Instabug. */ @ReactMethod @@ -1107,7 +1104,7 @@ public void invoke(@NonNull CoreFeaturesState featuresState) { params.putBoolean("isW3ExternalTraceIDEnabled", featuresState.isW3CExternalTraceIdEnabled()); params.putBoolean("isW3ExternalGeneratedHeaderEnabled", featuresState.isAttachingGeneratedHeaderEnabled()); params.putBoolean("isW3CaughtHeaderEnabled", featuresState.isAttachingCapturedHeaderEnabled()); - params.putInt("networkBodyLimit",featuresState.getNetworkLogCharLimit()); + params.putInt("networkBodyLimit", featuresState.getNetworkLogCharLimit()); sendEvent(Constants.IBG_ON_FEATURE_FLAGS_UPDATE_RECEIVED_CALLBACK, params); } @@ -1191,7 +1188,7 @@ public void run() { * Map between the exported JS constant and the arg key in {@link ArgsRegistry}. * The constant name and the arg key should match to be able to resolve the * constant with its actual value from the {@link ArgsRegistry} maps. - * + *

* This is a workaround, because RN cannot resolve enums in the constants map. */ @Override @@ -1222,23 +1219,25 @@ public void invoke() { } }); } + /** - * Enables or disables capturing network body. - * @param isEnabled A boolean to enable/disable capturing network body. - */ - @ReactMethod - public void setNetworkLogBodyEnabled(final boolean isEnabled) { - MainThreadHandler.runOnMainThread(new Runnable() { - @Override - public void run() { - try { - Instabug.setNetworkLogBodyEnabled(isEnabled); - } catch (Exception e) { - e.printStackTrace(); - } - } - }); - } + * Enables or disables capturing network body. + * + * @param isEnabled A boolean to enable/disable capturing network body. + */ + @ReactMethod + public void setNetworkLogBodyEnabled(final boolean isEnabled) { + MainThreadHandler.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + Instabug.setNetworkLogBodyEnabled(isEnabled); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } /** * Sets the auto mask screenshots types. diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java index b10058f48..c4e6860c6 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java @@ -166,5 +166,13 @@ public void testSetFlowAttribute() { APM.endUITrace(); } + @Test + public void given$setScreenRenderEnabled_whenQuery_thenShouldCallNativeApiWithEnabled() { + apmModule.setScreenRenderEnabled(true); + // then + verify(APM.class, times(1)); + APM.setScreenRenderingEnabled(true); + } + } diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 40fae6129..762f317d3 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -129,7 +129,32 @@ - (void) testEndUITrace { [self.instabugBridge endUITrace]; OCMVerify([mock endUITrace]); } +// +//- (void) testSetScreenRenderEnabled { +// id mock = OCMClassMock([IBGAPM class]); +// BOOL isEnabled = YES; +// +// OCMStub([mock enabled:isEnabled]); +// [self.instabugBridge setScreenRenderEnabled:isEnabled]; +// OCMVerify([mock setScreenRenderEnabled:isEnabled]); +//} + +- (void) testSetScreenRenderEnabled { + id mock = OCMClassMock([IBGAPM class]); + NSNumber *isEnabled = @1; + + [self.instabugBridge setScreenRenderEnabled:isEnabled]; + OCMVerify([mock setScreenRenderingEnabled:YES]); +} + +- (void) testSetScreenRenderDisabled { + id mock = OCMClassMock([IBGAPM class]); + NSNumber *isEnabled = @0; + [self.instabugBridge setScreenRenderEnabled:isEnabled]; + + OCMVerify([mock setScreenRenderingEnabled:NO]); +} @end diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index f3ebbf79b..a975191cd 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -30,6 +30,7 @@ import { HttpScreen } from '../screens/apm/HttpScreen'; import { WebViewsScreen } from '../screens/apm/webViews/WebViewsScreen'; import { FullWebViewsScreen } from '../screens/apm/webViews/FullWebViewsScreen'; import { PartialWebViewsScreen } from '../screens/apm/webViews/PartialWebViewsScreen'; +import ScreenRender from '../screens/apm/ScreenRender'; export type HomeStackParamList = { Home: undefined; @@ -60,6 +61,7 @@ export type HomeStackParamList = { WebViews: undefined; FullWebViews: undefined; PartialWebViews: undefined; + ScreenRender: undefined; }; const HomeStack = createNativeStackNavigator(); @@ -161,6 +163,12 @@ export const HomeStackNavigator: React.FC = () => { component={PartialWebViewsScreen} options={{ title: 'PartialWebViews' }} /> + + ); }; diff --git a/examples/default/src/screens/apm/APMScreen.tsx b/examples/default/src/screens/apm/APMScreen.tsx index 920451c75..4a409cfdd 100644 --- a/examples/default/src/screens/apm/APMScreen.tsx +++ b/examples/default/src/screens/apm/APMScreen.tsx @@ -37,31 +37,7 @@ export const APMScreen: React.FC navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> - - { - // Simulate slow rendering - const heavyComputation = () => { - for (let i = 0; i < 1000000; i++) { - Math.random() * Math.random(); - } - }; - heavyComputation(); - showNotification('Slow Frames', 'Heavy computation executed to simulate slow frames'); - }} - /> - { - const freezeDuration = 3000; // 3 seconds - const start = Date.now(); - while (Date.now() - start < freezeDuration) { - // Busy wait to block JS thread - } - showNotification('Frozen Frames', `UI frozen for ${freezeDuration / 1000} seconds`); - }} - /> + navigation.navigate('ScreenRender')} /> ); }; diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx new file mode 100644 index 000000000..e49e92f21 --- /dev/null +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -0,0 +1,317 @@ +import { NativeStackScreenProps } from '@react-navigation/native-stack'; +import React, { useState, useEffect, useRef } from 'react'; +import { + View, + Text, + StyleSheet, + TouchableOpacity, + ScrollView, + SafeAreaView, + Animated, +} from 'react-native'; +import { HomeStackParamList } from '../../navigation/HomeStack'; +import { APM } from 'instabug-reactnative'; + +// CustomComponents +const ScreenRenderSwitch: React.FC = () => { + const [isEnabled, setIsEnabled] = useState(false); + + return ( + + Screen Render Monitoring + { + setIsEnabled(!isEnabled); + APM.setScreenRenderEnabled(isEnabled); + }}> + + + + ); +}; + +const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { + const [counter, setCounter] = useState(0); + const animatedValue = useRef(new Animated.Value(0)).current; + const intervalRef = useRef(null); + + // Continuous animation + useEffect(() => { + const animation = Animated.loop( + Animated.sequence([ + Animated.timing(animatedValue, { + toValue: 1, + duration: 1000, + useNativeDriver: true, + }), + Animated.timing(animatedValue, { + toValue: 0, + duration: 1000, + useNativeDriver: true, + }), + ]), + ); + animation.start(); + + return () => animation.stop(); + }, []); + + // High frequency counter updates to force re-renders + useEffect(() => { + intervalRef.current = setInterval(() => { + setCounter((prev) => { + // This is where we block if isBlocking is true + if (isBlocking) { + const startTime = Date.now(); + // Block for 100ms every render cycle + while (Date.now() - startTime < 100) { + // Busy wait - this will cause visible frozen frames + } + } + return prev + 1; + }); + }, 16); // ~60fps updates + + return () => { + if (intervalRef.current) { + clearInterval(intervalRef.current); + } + }; + }, [isBlocking]); + + const translateX = animatedValue.interpolate({ + inputRange: [0, 1], + outputRange: [0, 100], + }); + + return ( + + Frame Counter: {counter} + + {isBlocking ? 'FROZEN!' : 'Smooth'} + + + ); +}; + +interface InstabugButtonProps { + text: string; + onPress: () => void; + disabled?: boolean; +} + +const InstabugButton: React.FC = ({ text, onPress, disabled }) => { + return ( + + {text} + + ); +}; + +// Main Component +const ScreenRenderPage: React.FC> = ({ + navigation, +}) => { + const [isBlocking, setIsBlocking] = useState(false); + const blockingTimeoutRef = useRef(null); + + const triggerSlowFrames = (): void => { + setIsBlocking(true); + + // Clear any existing timeout + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + + // Stop blocking after 3 seconds + blockingTimeoutRef.current = setTimeout(() => { + setIsBlocking(false); + }, 500); + }; + + const triggerFrozenFrames = (): void => { + setIsBlocking(true); + + // Clear any existing timeout + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + + // Stop blocking after 5 seconds + blockingTimeoutRef.current = setTimeout(() => { + setIsBlocking(false); + }, 3000); + }; + + const navigateToComplexPage = (): void => { + navigation.navigate('ComplexViews'); + }; + + // Cleanup timeout on unmount + useEffect(() => { + return () => { + if (blockingTimeoutRef.current) { + clearTimeout(blockingTimeoutRef.current); + } + }; + }, []); + + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: '#f5f5f5', + }, + scrollContent: { + padding: 20, + }, + title: { + fontSize: 24, + fontWeight: 'bold', + textAlign: 'center', + marginBottom: 20, + color: '#333', + }, + spacer: { + height: 16, + }, + largeSpacer: { + height: 50, + }, + buttonContainer: { + gap: 12, + }, + button: { + backgroundColor: '#007AFF', + paddingVertical: 12, + paddingHorizontal: 20, + borderRadius: 8, + alignItems: 'center', + marginVertical: 4, + }, + buttonText: { + color: 'white', + fontSize: 16, + fontWeight: '600', + }, + buttonDisabled: { + backgroundColor: '#ccc', + opacity: 0.7, + }, + buttonTextDisabled: { + color: '#888', + }, + switchContainer: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'space-between', + paddingVertical: 12, + paddingHorizontal: 16, + backgroundColor: 'white', + borderRadius: 8, + marginVertical: 8, + }, + switchLabel: { + fontSize: 16, + color: '#333', + }, + switch: { + width: 50, + height: 30, + borderRadius: 15, + backgroundColor: '#ccc', + justifyContent: 'center', + padding: 2, + }, + switchEnabled: { + backgroundColor: '#007AFF', + }, + switchThumb: { + width: 26, + height: 26, + borderRadius: 13, + backgroundColor: 'white', + alignSelf: 'flex-start', + }, + switchThumbEnabled: { + alignSelf: 'flex-end', + }, + animatedContainer: { + alignItems: 'center', + paddingVertical: 20, + backgroundColor: 'white', + borderRadius: 8, + marginVertical: 8, + }, + counterText: { + fontSize: 18, + fontWeight: 'bold', + color: '#333', + marginBottom: 15, + }, + animatedBox: { + width: 100, + height: 60, + backgroundColor: '#FF6B6B', + borderRadius: 8, + justifyContent: 'center', + alignItems: 'center', + transform: [{ scale: 1 }], + }, + animatedBoxActive: { + backgroundColor: '#4ECDC4', + transform: [{ scale: 1.1 }], + }, + animatedBoxText: { + color: 'white', + fontSize: 14, + fontWeight: '600', + textAlign: 'center', + }, +}); + +export default ScreenRenderPage; + +// Export the screen name constant for navigation +export const SCREEN_NAME = 'ScreenRender'; diff --git a/test/mocks/mockAPM.ts b/test/mocks/mockAPM.ts index 7a9c5bac9..8c75b4807 100644 --- a/test/mocks/mockAPM.ts +++ b/test/mocks/mockAPM.ts @@ -14,6 +14,7 @@ const mockAPM: ApmNativeModule = { endAppLaunch: jest.fn(), ibgSleep: jest.fn(), networkLogAndroid: jest.fn(), + setScreenRenderEnabled: jest.fn(), }; export default mockAPM; diff --git a/test/modules/APM.spec.ts b/test/modules/APM.spec.ts index ea703d3ea..8ee4fbe59 100644 --- a/test/modules/APM.spec.ts +++ b/test/modules/APM.spec.ts @@ -101,4 +101,11 @@ describe('APM Module', () => { expect(NativeAPM.ibgSleep).toBeCalledTimes(1); expect(NativeAPM.ibgSleep).toBeCalledWith(); }); + + it('should call the native method setScreenRenderEnabled', () => { + APM.setScreenRenderEnabled(true); + + expect(NativeAPM.setScreenRenderEnabled).toBeCalledTimes(1); + expect(NativeAPM.setScreenRenderEnabled).toBeCalledWith(true); + }); }); From e7c94352683ff5c97b953340e03dce1756b28f70 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 20 Jul 2025 16:38:47 +0300 Subject: [PATCH 42/62] fix format --- .../default/ios/InstabugTests/InstabugAPMTests.m | 13 ++----------- examples/default/ios/Podfile.lock | 4 ++-- examples/default/src/navigation/HomeStack.tsx | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 762f317d3..127ff50ce 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -129,19 +129,10 @@ - (void) testEndUITrace { [self.instabugBridge endUITrace]; OCMVerify([mock endUITrace]); } -// -//- (void) testSetScreenRenderEnabled { -// id mock = OCMClassMock([IBGAPM class]); -// BOOL isEnabled = YES; -// -// OCMStub([mock enabled:isEnabled]); -// [self.instabugBridge setScreenRenderEnabled:isEnabled]; -// OCMVerify([mock setScreenRenderEnabled:isEnabled]); -//} - (void) testSetScreenRenderEnabled { id mock = OCMClassMock([IBGAPM class]); - NSNumber *isEnabled = @1; + BOOL isEnabled = YES; [self.instabugBridge setScreenRenderEnabled:isEnabled]; @@ -150,7 +141,7 @@ - (void) testSetScreenRenderEnabled { - (void) testSetScreenRenderDisabled { id mock = OCMClassMock([IBGAPM class]); - NSNumber *isEnabled = @0; + BOOL isEnabled = NO; [self.instabugBridge setScreenRenderEnabled:isEnabled]; diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ddf819b04..046a940fa 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index a975191cd..cf39411ab 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -168,7 +168,6 @@ export const HomeStackNavigator: React.FC = () => { component={ScreenRender} options={{ title: 'ScreenRender' }} /> - ); }; From 3541ed56f7899b08556dbb169c77e20cd8cd6210 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 21 Jul 2025 18:00:53 +0300 Subject: [PATCH 43/62] update the sample app --- .../default/src/screens/apm/ScreenRender.tsx | 244 +++++++++++++----- 1 file changed, 186 insertions(+), 58 deletions(-) diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index e49e92f21..687143e08 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -1,18 +1,18 @@ -import { NativeStackScreenProps } from '@react-navigation/native-stack'; -import React, { useState, useEffect, useRef } from 'react'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import React, { useEffect, useRef, useState } from 'react'; import { - View, - Text, + Animated, + SafeAreaView, + ScrollView, StyleSheet, + Text, TouchableOpacity, - ScrollView, - SafeAreaView, - Animated, + View, } from 'react-native'; -import { HomeStackParamList } from '../../navigation/HomeStack'; +import type { HomeStackParamList } from '../../navigation/HomeStack'; import { APM } from 'instabug-reactnative'; -// CustomComponents +// Custom Components const ScreenRenderSwitch: React.FC = () => { const [isEnabled, setIsEnabled] = useState(false); @@ -31,46 +31,45 @@ const ScreenRenderSwitch: React.FC = () => { ); }; -const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { +const AnimatedBox: React.FC<{ isBlocking: boolean; blockingIntensity: number }> = ({ + isBlocking, + blockingIntensity, +}) => { const [counter, setCounter] = useState(0); + const [layoutThrasher, setLayoutThrasher] = useState(0); const animatedValue = useRef(new Animated.Value(0)).current; const intervalRef = useRef(null); - // Continuous animation + // Continuous animation - Use native driver for native thread work useEffect(() => { const animation = Animated.loop( Animated.sequence([ Animated.timing(animatedValue, { toValue: 1, duration: 1000, - useNativeDriver: true, + useNativeDriver: true, // Native driver for native thread }), Animated.timing(animatedValue, { toValue: 0, duration: 1000, - useNativeDriver: true, + useNativeDriver: true, // Native driver for native thread }), ]), ); animation.start(); return () => animation.stop(); - }, []); + }, [animatedValue]); - // High frequency counter updates to force re-renders + // High frequency counter updates useEffect(() => { intervalRef.current = setInterval(() => { - setCounter((prev) => { - // This is where we block if isBlocking is true - if (isBlocking) { - const startTime = Date.now(); - // Block for 100ms every render cycle - while (Date.now() - startTime < 100) { - // Busy wait - this will cause visible frozen frames - } - } - return prev + 1; - }); + setCounter((prev) => prev + 1); + + // Layout thrashing to block native thread + if (isBlocking) { + setLayoutThrasher((prev) => prev + 1); + } }, 16); // ~60fps updates return () => { @@ -85,19 +84,121 @@ const AnimatedBox: React.FC<{ isBlocking: boolean }> = ({ isBlocking }) => { outputRange: [0, 100], }); + const getStatusText = () => { + if (!isBlocking) { + return 'Running Smoothly'; + } + if (blockingIntensity === 1) { + return 'SLOW NATIVE RENDERING!'; + } + if (blockingIntensity === 2) { + return 'FROZEN NATIVE THREAD!'; + } + return 'BLOCKING NATIVE THREAD!'; + }; + + const getBoxColor = () => { + if (!isBlocking) { + return '#4ECDC4'; + } + if (blockingIntensity === 1) { + return '#FFB347'; + } // Orange for slow + if (blockingIntensity === 2) { + return '#FF6B6B'; + } // Red for frozen + return '#FF6B6B'; + }; + + // Generate many layout-heavy elements to stress native thread + const generateHeavyNativeElements = () => { + if (!isBlocking) return null; + + const elementCount = blockingIntensity === 1 ? 50 : 200; // More elements = more native work + + return Array.from({ length: elementCount }, (_, i) => ( + + )); + }; + return ( Frame Counter: {counter} - + Status: {getStatusText()} + + + {/* Native thread heavy work area */} + + - {isBlocking ? 'FROZEN!' : 'Smooth'} - + width: 60, + height: 60, + borderRadius: 30, + justifyContent: 'center', + alignItems: 'center', + }}> + + {blockingIntensity === 1 ? 'Slow!' : blockingIntensity === 2 ? 'Frozen!' : 'Smooth'} + + + + {/* Heavy native rendering elements */} + {generateHeavyNativeElements()} + + + {/* Additional native-heavy components */} + {isBlocking && ( + + {/* Multiple ScrollViews to stress native scrolling */} + + {Array.from({ length: 100 }, (_, i) => ( + + ))} + + + {/* Text that forces layout recalculation */} + + Layout Thrashing Text: {layoutThrasher} + + + )} ); }; @@ -124,24 +225,12 @@ const ScreenRenderPage: React.FC { const [isBlocking, setIsBlocking] = useState(false); + const [blockingIntensity, setBlockingIntensity] = useState(0); // 0 = none, 1 = slow, 2 = frozen const blockingTimeoutRef = useRef(null); - const triggerSlowFrames = (): void => { - setIsBlocking(true); - - // Clear any existing timeout - if (blockingTimeoutRef.current) { - clearTimeout(blockingTimeoutRef.current); - } - - // Stop blocking after 3 seconds - blockingTimeoutRef.current = setTimeout(() => { - setIsBlocking(false); - }, 500); - }; - const triggerFrozenFrames = (): void => { setIsBlocking(true); + setBlockingIntensity(2); // Frozen frames mode // Clear any existing timeout if (blockingTimeoutRef.current) { @@ -151,7 +240,8 @@ const ScreenRenderPage: React.FC { setIsBlocking(false); - }, 3000); + setBlockingIntensity(0); + }, 5000); }; const navigateToComplexPage = (): void => { @@ -174,19 +264,13 @@ const ScreenRenderPage: React.FC - + - - @@ -309,6 +393,50 @@ const styles = StyleSheet.create({ fontWeight: '600', textAlign: 'center', }, + statusText: { + fontSize: 16, + color: '#666', + marginBottom: 10, + }, + statusTextAlert: { + color: '#FF6B6B', // Red for alert + fontWeight: 'bold', + }, + additionalElements: { + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'center', + marginTop: 20, + }, + smallBox: { + width: 30, + height: 30, + margin: 5, + borderRadius: 15, + }, + nativeWorkArea: { + position: 'relative', + width: 200, + height: 200, + backgroundColor: '#f0f0f0', + borderRadius: 10, + justifyContent: 'center', + alignItems: 'center', + marginVertical: 10, + borderWidth: 1, + borderColor: '#ccc', + }, + heavyNativeSection: { + marginTop: 20, + alignItems: 'center', + }, + miniScrollView: { + width: '100%', + height: 100, + backgroundColor: '#e0e0e0', + borderRadius: 8, + marginBottom: 10, + }, }); export default ScreenRenderPage; From 7e932b5db303a916141df8edae250eb53b4309f3 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 21 Jul 2025 19:03:13 +0300 Subject: [PATCH 44/62] chore: fix lint --- examples/default/src/screens/apm/ScreenRender.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index 687143e08..397a29946 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-native/no-inline-styles */ import type { NativeStackScreenProps } from '@react-navigation/native-stack'; import React, { useEffect, useRef, useState } from 'react'; import { @@ -112,7 +113,9 @@ const AnimatedBox: React.FC<{ isBlocking: boolean; blockingIntensity: number }> // Generate many layout-heavy elements to stress native thread const generateHeavyNativeElements = () => { - if (!isBlocking) return null; + if (!isBlocking) { + return null; + } const elementCount = blockingIntensity === 1 ? 50 : 200; // More elements = more native work @@ -440,6 +443,3 @@ const styles = StyleSheet.create({ }); export default ScreenRenderPage; - -// Export the screen name constant for navigation -export const SCREEN_NAME = 'ScreenRender'; From 4b0f5a23dd3cf8b4a22b0087d6d54149ffab7288 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Tue, 22 Jul 2025 15:04:57 +0300 Subject: [PATCH 45/62] chore: first commit --- examples/default/ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 046a940fa..ddf819b04 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 From b5bde68c79c102540d617afd4aab3af02b7b5abf Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Wed, 23 Jul 2025 10:10:06 +0300 Subject: [PATCH 46/62] chore: fix Podfile.lock --- examples/default/ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ddf819b04..046a940fa 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 From a1d11d07cd11b2ef77f76e45ec012db3da1dbf22 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 27 Jul 2025 10:56:22 +0300 Subject: [PATCH 47/62] chore: refactor example app, add new screen for custom traces, update native dependencies --- android/native.gradle | 2 +- examples/default/ios/Podfile | 2 +- examples/default/src/navigation/HomeStack.tsx | 6 +- .../default/src/screens/apm/APMScreen.tsx | 1 + .../src/screens/apm/CustomUITraceScreen.tsx | 58 +++++++++++++++++++ .../src/screens/apm/ExecutionTraceScreen.tsx | 0 .../default/src/screens/apm/ScreenRender.tsx | 4 +- .../screens/user-steps/ComplexViewsScreen.tsx | 11 ++-- ios/native.rb | 2 +- 9 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 examples/default/src/screens/apm/CustomUITraceScreen.tsx create mode 100644 examples/default/src/screens/apm/ExecutionTraceScreen.tsx diff --git a/android/native.gradle b/android/native.gradle index f33c0b543..d9c7a2f5b 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.1.6985154-SNAPSHOT' + version: '15.0.2.7020723-SNAPSHOT' ] dependencies { diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index d8659054c..7b4496b80 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/src/navigation/HomeStack.tsx b/examples/default/src/navigation/HomeStack.tsx index cf39411ab..94e461ed5 100644 --- a/examples/default/src/navigation/HomeStack.tsx +++ b/examples/default/src/navigation/HomeStack.tsx @@ -22,6 +22,7 @@ import { import { GoogleMapsScreen } from '../screens/user-steps/GoogleMapsScreen'; import { LargeImageListScreen } from '../screens/user-steps/LargeImageListScreen'; import { APMScreen } from '../screens/apm/APMScreen'; +import { CustomUITraceScreen } from '../screens/apm/CustomUITraceScreen'; import { NetworkScreen } from '../screens/apm/NetworkScreen'; import { FlowsScreen } from '../screens/apm/FlowsScreen'; import { SessionReplayScreen } from '../screens/SessionReplayScreen'; @@ -43,7 +44,7 @@ export type HomeStackParamList = { BasicComponents: undefined; ScrollView: undefined; FlatList: undefined; - ComplexViews: undefined; + ComplexViews: { initialDepth?: number; initialBreadth?: number } | undefined; SectionList: undefined; Gestures: undefined; GoogleMapsScreen: undefined; @@ -56,7 +57,7 @@ export type HomeStackParamList = { // APM // APM: undefined; NetworkTraces: undefined; - ExecutionTraces: undefined; + CustomUITraces: undefined; AppFlows: undefined; WebViews: undefined; FullWebViews: undefined; @@ -141,6 +142,7 @@ export const HomeStackNavigator: React.FC = () => { + APM.endAppLaunch()} /> navigation.navigate('NetworkTraces')} /> + navigation.navigate('CustomUITraces')} /> navigation.navigate('AppFlows')} /> navigation.navigate('WebViews')} /> navigation.navigate('ComplexViews')} /> diff --git a/examples/default/src/screens/apm/CustomUITraceScreen.tsx b/examples/default/src/screens/apm/CustomUITraceScreen.tsx new file mode 100644 index 000000000..f03b13334 --- /dev/null +++ b/examples/default/src/screens/apm/CustomUITraceScreen.tsx @@ -0,0 +1,58 @@ +import React, { useState } from 'react'; +import { APM } from 'instabug-reactnative'; +import { ScrollView } from 'react-native'; +import { Section } from '../../components/Section'; +import { Screen } from '../../components/Screen'; +import { VStack } from 'native-base'; +import { InputField } from '../../components/InputField'; +import { CustomButton } from '../../components/CustomButton'; +import BackgroundTimer from 'react-native-background-timer'; + +export const CustomUITraceScreen: React.FC = () => { + const [traceName, setTraceName] = useState(''); + + function startUITrace() { + if (!traceName.trim()) { + console.log('Please enter a trace name before starting.'); + return; + } + APM.startUITrace(traceName); + + console.log(`UI trace "${traceName}" started.`); + } + + function startDelayedUITrace() { + if (!traceName.trim()) { + console.log('Please enter a trace name before starting.'); + return; + } + return BackgroundTimer.setTimeout(() => { + APM.startUITrace(traceName); + console.log(`Delayed UI trace "${traceName}" started.`); + }, 5000); + } + + function endUITrace() { + APM.endUITrace(); + console.log('UI trace ended.'); + } + + return ( + + +

+ + setTraceName(text)} + value={traceName} + /> + + + + +
+ + + ); +}; diff --git a/examples/default/src/screens/apm/ExecutionTraceScreen.tsx b/examples/default/src/screens/apm/ExecutionTraceScreen.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index 397a29946..f9113a2c8 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -248,7 +248,7 @@ const ScreenRenderPage: React.FC { - navigation.navigate('ComplexViews'); + navigation.navigate('ComplexViews', { initialDepth: 10, initialBreadth: 2 }); }; // Cleanup timeout on unmount @@ -273,7 +273,7 @@ const ScreenRenderPage: React.FC diff --git a/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx b/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx index 0035d5775..b6fc337a6 100644 --- a/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx +++ b/examples/default/src/screens/user-steps/ComplexViewsScreen.tsx @@ -1,4 +1,6 @@ import React, { useRef, useState } from 'react'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import type { HomeStackParamList } from '../../navigation/HomeStack'; import { Screen } from '../../components/Screen'; import { Section } from '../../components/Section'; @@ -7,10 +9,11 @@ import { Button } from 'react-native'; import { ScrollView, VStack } from 'native-base'; import { InputField } from '../../components/InputField'; -export const ComplexViewsScreen: React.FC = () => { - const initialDepth = 10; - const initialBreadth = 2; - +export const ComplexViewsScreen: React.FC< + NativeStackScreenProps +> = ({ route }) => { + const initialDepth = route.params?.initialDepth ?? 10; + const initialBreadth = route.params?.initialBreadth ?? 2; const depthRef = useRef(initialDepth); const breadthRef = useRef(initialBreadth); diff --git a/ios/native.rb b/ios/native.rb index 08e43fdae..a62fd4577 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.15' } +$instabug = { :version => '15.1.16' } def use_instabug! (spec = nil) version = $instabug[:version] From 497bf82a949bf018b91adc6f5b3e6a86d3467b28 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 27 Jul 2025 11:01:34 +0300 Subject: [PATCH 48/62] chore: push Podfile.lock --- examples/default/ios/Podfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 046a940fa..6795679c7 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.15) + - Instabug (15.1.16) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.15) + - Instabug (= 15.1.16) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.15/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2024,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: ed81d3e95f406f0e6d808e91a42dae929dfd4908 + Instabug: 9fcae5627558e1832a0f49c81bb26c20aaf8af7f instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2092,7 +2092,7 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: fc1585dd6ede766139ab908b103d43efdcc8899a + RNInstabug: 62ac32fd0a0ecb7720aa115fec391e74b8bd5a27 RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d @@ -2100,6 +2100,6 @@ SPEC CHECKSUMS: SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 -PODFILE CHECKSUM: 6bf2de63356e1cc43b55c746d85bc4d29167a520 +PODFILE CHECKSUM: 06ff71958843b5a526fbd11ecc1aad124421d74f COCOAPODS: 1.14.0 From f19093ccf6343680788f179d71136aa3af1d1b31 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:14:31 +0300 Subject: [PATCH 49/62] chore: update the iOS pods --- examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 18 +++++----- examples/default/src/App.tsx | 57 +++++++++++++++++-------------- ios/native.rb | 2 +- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index 7b4496b80..5c34c2892 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 6795679c7..0bdb702a9 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.16) + - Instabug (15.1.24) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.16) + - Instabug (= 15.1.24) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.16/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2024,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 9fcae5627558e1832a0f49c81bb26c20aaf8af7f + Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2092,14 +2092,14 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: 62ac32fd0a0ecb7720aa115fec391e74b8bd5a27 + RNInstabug: c1334b03231d29e6abb93b93de52190cd325ce65 RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 06ff71958843b5a526fbd11ecc1aad124421d74f +PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 2fc62edbe..330d0d250 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -3,8 +3,8 @@ import { ActivityIndicator, StyleSheet } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; -import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { + APM, CrashReporting, InvocationEvent, LaunchType, @@ -12,6 +12,7 @@ import Instabug, { NetworkInterceptionMode, NetworkLogger, ReproStepsMode, + type SessionMetadata, SessionReplay, } from 'instabug-reactnative'; import { NativeBaseProvider } from 'native-base'; @@ -42,36 +43,42 @@ export const App: React.FC = () => { const [isInstabugInitialized, setIsInstabugInitialized] = useState(false); - const initializeInstabug = async () => { - try { - SessionReplay.setSyncCallback((data) => shouldSyncSession(data)); - - await Instabug.init({ - token: 'deb1910a7342814af4e4c9210c786f35', - invocationEvents: [InvocationEvent.floatingButton], - debugLogsLevel: LogLevel.verbose, - networkInterceptionMode: NetworkInterceptionMode.javascript, + const initializeInstabug = () => { + // Synchronous setup + SessionReplay.setSyncCallback((data) => shouldSyncSession(data)); + + // Start async initialization but don't block rendering + Instabug.init({ + token: 'deb1910a7342814af4e4c9210c786f35', + invocationEvents: [InvocationEvent.floatingButton], + debugLogsLevel: LogLevel.verbose, + networkInterceptionMode: NetworkInterceptionMode.javascript, + }) + .then(() => { + // Post-initialization setup + NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { + networkData.url = `${networkData.url}/JS/Obfuscated`; + return networkData; }); - - CrashReporting.setNDKCrashesEnabled(true); - Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); - - setIsInstabugInitialized(true); // Set to true after initialization - } catch (error) { + APM.setScreenRenderEnabled(true); + setIsInstabugInitialized(true); + }) + .catch((error) => { console.error('Instabug initialization failed:', error); setIsInstabugInitialized(true); // Proceed even if initialization fails - } + }); + + // Synchronous configuration that doesn't depend on init completion + CrashReporting.setNDKCrashesEnabled(true); + Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); + + // Set initialized immediately to show UI - initialization continues in background + setIsInstabugInitialized(true); }; useEffect(() => { - initializeInstabug().then(() => { - NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { - networkData.url = `${networkData.url}/JS/Obfuscated`; - return networkData; - }); - // APM.setScreenRenderEnabled(true); - }); - }); + initializeInstabug(); + }, []); useEffect(() => { // @ts-ignore diff --git a/ios/native.rb b/ios/native.rb index a62fd4577..1ca2aded7 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.16' } +$instabug = { :version => '15.1.24' } def use_instabug! (spec = nil) version = $instabug[:version] From 4532dcc1d5de80a094ff16020d8f60b23aeed3cb Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:25:57 +0300 Subject: [PATCH 50/62] fix format --- examples/default/ios/Podfile.lock | 4 ++-- examples/default/src/App.tsx | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 0bdb702a9..ebaada4cc 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 330d0d250..13482f397 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -54,24 +54,24 @@ export const App: React.FC = () => { debugLogsLevel: LogLevel.verbose, networkInterceptionMode: NetworkInterceptionMode.javascript, }) - .then(() => { - // Post-initialization setup - NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { - networkData.url = `${networkData.url}/JS/Obfuscated`; - return networkData; + .then(() => { + // Post-initialization setup + NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { + networkData.url = `${networkData.url}/JS/Obfuscated`; + return networkData; + }); + APM.setScreenRenderEnabled(true); + setIsInstabugInitialized(true); + }) + .catch((error) => { + console.error('Instabug initialization failed:', error); + setIsInstabugInitialized(true); // Proceed even if initialization fails }); - APM.setScreenRenderEnabled(true); - setIsInstabugInitialized(true); - }) - .catch((error) => { - console.error('Instabug initialization failed:', error); - setIsInstabugInitialized(true); // Proceed even if initialization fails - }); // Synchronous configuration that doesn't depend on init completion CrashReporting.setNDKCrashesEnabled(true); Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled }); - + // Set initialized immediately to show UI - initialization continues in background setIsInstabugInitialized(true); }; From cec34af0f00f0baa1af750628ec38cc1081f3550 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Mon, 4 Aug 2025 12:31:11 +0300 Subject: [PATCH 51/62] fix lint --- examples/default/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 13482f397..703932594 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -78,7 +78,7 @@ export const App: React.FC = () => { useEffect(() => { initializeInstabug(); - }, []); + }); useEffect(() => { // @ts-ignore From 790a10feb79a017c0a778a7862eda4326f31a010 Mon Sep 17 00:00:00 2001 From: Eyad Heikal Date: Thu, 7 Aug 2025 01:21:05 +0300 Subject: [PATCH 52/62] Remove Links override --- .../InstabugExample.xcodeproj/project.pbxproj | 36 ++++-- .../ios/InstabugExample/Instabug.plist | Bin 157 -> 0 bytes examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 120 +++++++++--------- ios/native.rb | 2 +- 5 files changed, 85 insertions(+), 75 deletions(-) delete mode 100644 examples/default/ios/InstabugExample/Instabug.plist diff --git a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj index fb1253b31..6cbf4e3b0 100644 --- a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj +++ b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ CC3DF8932A1DFC9A003E9914 /* InstabugSurveysTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */; }; CC3DF8942A1DFC9A003E9914 /* InstabugAPMTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */; }; CC3DF8952A1DFC9A003E9914 /* IBGConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */; }; - CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */ = {isa = PBXBuildFile; fileRef = CC487A9B2C71FCFC0021F680 /* Instabug.plist */; }; CCF1E4092B022CF20024802D /* RNInstabugTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF1E4082B022CF20024802D /* RNInstabugTests.m */; }; CD36F4707EA1F435D2CC7A15 /* libPods-InstabugExample-InstabugTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AF7A6E02D40E0CEEA833CC4 /* libPods-InstabugExample-InstabugTests.a */; }; F7BF47401EF3A435254C97BB /* libPods-InstabugExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BAED0D0441A708AE2390E153 /* libPods-InstabugExample.a */; }; @@ -57,7 +56,7 @@ BE3328762BDACE030078249A /* IBGCrashReporting+CP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IBGCrashReporting+CP.h"; sourceTree = ""; }; C3C8C24386310A3120006604 /* CrashReportingExampleModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CrashReportingExampleModule.m; sourceTree = ""; }; C3C8C784EADC037C5A752B94 /* CrashReportingExampleModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReportingExampleModule.h; sourceTree = ""; }; - C4E7796400B3B360DD0B6E73 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = InstabugExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + C4E7796400B3B360DD0B6E73 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = InstabugExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; CC3DF8852A1DFC99003E9914 /* InstabugCrashReportingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugCrashReportingTests.m; sourceTree = ""; }; CC3DF8862A1DFC99003E9914 /* InstabugBugReportingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugBugReportingTests.m; sourceTree = ""; }; CC3DF8872A1DFC99003E9914 /* InstabugSampleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugSampleTests.m; sourceTree = ""; }; @@ -67,7 +66,6 @@ CC3DF88B2A1DFC99003E9914 /* InstabugSurveysTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugSurveysTests.m; sourceTree = ""; }; CC3DF88C2A1DFC99003E9914 /* InstabugAPMTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstabugAPMTests.m; sourceTree = ""; }; CC3DF88D2A1DFC9A003E9914 /* IBGConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IBGConstants.m; sourceTree = ""; }; - CC487A9B2C71FCFC0021F680 /* Instabug.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = Instabug.plist; path = InstabugExample/Instabug.plist; sourceTree = ""; }; CCF1E4082B022CF20024802D /* RNInstabugTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNInstabugTests.m; sourceTree = ""; }; DBCB1B1D023646D84146C91E /* Pods-InstabugExample-InstabugTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugExample-InstabugTests.release.xcconfig"; path = "Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -124,7 +122,6 @@ 13B07FAE1A68108700A75B9A /* InstabugExample */ = { isa = PBXGroup; children = ( - CC487A9B2C71FCFC0021F680 /* Instabug.plist */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB51A68108700A75B9A /* Images.xcassets */, @@ -302,7 +299,6 @@ buildActionMask = 2147483647; files = ( 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, - CC487A9C2C71FCFC0021F680 /* Instabug.plist in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, AF8A18C6FA80B2BFE6006C9E /* PrivacyInfo.xcprivacy in Resources */, ); @@ -335,10 +331,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources.sh\"\n"; @@ -396,10 +396,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources.sh\"\n"; @@ -413,10 +417,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks.sh\"\n"; @@ -427,7 +435,11 @@ buildActionMask = 2147483647; files = ( ); + inputPaths = ( + ); name = "[CP-User] [instabug-reactnative] Upload Sourcemap"; + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "#!/bin/sh\n\nmain() {\n # Read environment variables from ios/.xcode.env if it exists\n env_path=\"$PODS_ROOT/../.xcode.env\"\n if [ -f \"$env_path\" ]; then\n source \"$env_path\"\n fi\n\n # Read environment variables from ios/.xcode.env.local if it exists\n local_env_path=\"${ENV_PATH}.local\"\n if [ -f \"$local_env_path\" ]; then\n source \"$local_env_path\"\n fi\n\n if [[ \"$INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\" = true ]]; then\n echo \"[Info] \\`INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\\` was set to true, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ \"$CONFIGURATION\" = \"Debug\" ]]; then\n echo \"[Info] Building in debug mode, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ -z \"$INFOPLIST_FILE\" ]] || [[ -z \"$PROJECT_DIR\" ]]; then\n echo \"[Error] Instabug sourcemaps script must be invoked by Xcode\"\n exit 0\n fi\n\n local source_map_file=$(generate_sourcemaps | tail -n 1)\n\n local js_project_dir=\"$PROJECT_DIR/..\"\n local instabug_dir=$(dirname $(node -p \"require.resolve('instabug-reactnative/package.json')\"))\n local inferred_token=$(cd $js_project_dir && source $instabug_dir/scripts/find-token.sh)\n local app_token=$(resolve_var \"App Token\" \"INSTABUG_APP_TOKEN\" \"$inferred_token\" | tail -n 1)\n\n local inferred_name=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_name=$(resolve_var \"Version Name\" \"INSTABUG_APP_VERSION_NAME\" \"$inferred_name\" | tail -n 1)\n\n local inferred_code=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_code=$(resolve_var \"Version Code\" \"INSTABUG_APP_VERSION_CODE\" \"$inferred_code\" | tail -n 1)\n\n node $instabug_dir/bin/index.js upload-sourcemaps \\\n --platform ios \\\n --file $source_map_file \\\n --token $app_token \\\n --name $version_name \\\n --code $version_code\n}\n\ngenerate_sourcemaps() {\n local react_native_dir=$(dirname $(node -p \"require.resolve('react-native/package.json')\"))\n\n # Fixes an issue with react-native prior to v0.67.0\n # For more info: https://github.com/facebook/react-native/issues/32168\n export RN_DIR=$react_native_dir\n\n # Used withing `react-native-xcode.sh` to generate sourcemap file\n export SOURCEMAP_FILE=\"$(pwd)/main.jsbundle.map\";\n\n source \"$react_native_dir/scripts/react-native-xcode.sh\"\n\n if [[ ! -f \"$SOURCEMAP_FILE\" ]]; then\n echo \"[Error] Unable to find source map file at: $SOURCEMAP_FILE\"\n exit 0\n fi\n\n echo $SOURCEMAP_FILE\n}\n\nresolve_var() {\n local name=$1\n local env_key=$2\n local default_value=$3\n\n local env_value=\"${!env_key}\"\n\n if [[ -n \"$env_value\" ]] && [[ -n \"$default_value\" ]] && [[ \"$env_value\" != default_value ]]; then\n echo \"[Warning] Environment variable \\`$env_key\\` might have incorrect value, make sure this was intentional:\"\n echo \" Environment Value: $env_value\"\n echo \" Default Value: $default_value\"\n fi\n\n local value=\"${env_value:-$default_value}\"\n\n if [[ -z \"$value\" ]]; then\n echo \"[Error] Unable to find $name! Set the environment variable \\`$env_key\\` and try again.\"\n exit 0\n fi\n\n echo $value\n}\n\nmain \"$@\"; exit\n"; @@ -440,10 +452,14 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); + inputPaths = ( + ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); + outputPaths = ( + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks.sh\"\n"; @@ -684,10 +700,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -759,10 +772,7 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/examples/default/ios/InstabugExample/Instabug.plist b/examples/default/ios/InstabugExample/Instabug.plist deleted file mode 100644 index 24d035f427616a1490762b3e7c6b8861c863c4a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 157 zcmYc)$jK}&F)+Bq$i&PN=b2Yrl9*JQ?ik=38srlV;{w_70_qthB?ZM+`ud3lnYxJu vxq6vU#d^v4xgbIP;*@OtGUIpwWh9ljRB`aiXaq5U0V5-XW?+TVFscFo;^Zpb diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index 5c34c2892..0d3e454c6 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index ebaada4cc..42a84fa71 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2017,15 +2017,15 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 4cb898d0bf20404aab1850c656dcea009429d6c1 - DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 + DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: 69ef571f3de08433d766d614c73a9838a06bf7eb + glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 - instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 + instabug-reactnative-ndk: e6f3fd45d6426aa7d37f479f153b5c2bdc1f5eb9 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1 @@ -2033,73 +2033,73 @@ SPEC CHECKSUMS: RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205 React: c2830fa483b0334bda284e46a8579ebbe0c5447e React-callinvoker: 4aecde929540c26b841a4493f70ebf6016691eb8 - React-Core: 9c059899f00d46b5cec3ed79251f77d9c469553d - React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5 - React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494 + React-Core: 32a581847d74ce9b5f51d9d11a4e4d132ad61553 + React-CoreModules: f53e0674e1747fa41c83bc970e82add97b14ad87 + React-cxxreact: 86f3b1692081fd954a0cb27cc90d14674645b64b React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5 - React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae - React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df - React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8 - React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364 - React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1 + React-defaultsnativemodule: 2ed121c5a1edeab09cff382b8d9b538260f07848 + React-domnativemodule: 4393dd5dd7e13dbe42e69ebc791064a616990f91 + React-Fabric: cbf38ceefb1ac6236897abdb538130228e126695 + React-FabricComponents: dd4b01c4a60920d8dc15f3b5594c6fe9e7648a38 + React-FabricImage: 8b13aedfbd20f349b9b3314baf993c71c02995d9 React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5 - React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803 - React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96 - React-hermes: 2069b08e965e48b7f8aa2c0ca0a2f383349ed55d - React-idlecallbacksnativemodule: e211b2099b6dced97959cb58257bab2b2de4d7ef - React-ImageManager: ab7a7d17dd0ff1ef1d4e1e88197d1119da9957ce - React-jserrorhandler: d9e867bb83b868472f3f7601883f0403b3e3942d - React-jsi: d68f1d516e5120a510afe356647a6a1e1f98f2db - React-jsiexecutor: 6366a08a0fc01c9b65736f8deacd47c4a397912a - React-jsinspector: 0ac947411f0c73b34908800cc7a6a31d8f93e1a8 - React-jsitracing: 0e8c0aadb1fcec6b1e4f2a66ee3b0da80f0f8615 - React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b - React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3 - React-microtasksnativemodule: 2b73e68f0462f3175f98782db08896f8501afd20 - react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe - react-native-config: 8f7283449bbb048902f4e764affbbf24504454af - react-native-google-maps: 1bcc1f9f13f798fcf230db7fe476f3566d0bc0a3 - react-native-maps: 72a8a903f8a1b53e2c777ba79102078ab502e0bf - react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac - react-native-safe-area-context: 142fade490cbebbe428640b8cbdb09daf17e8191 - react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4 - react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9 + React-featureflagsnativemodule: 87b58caf3cd8eca1e53179453789def019af2a65 + React-graphics: f5c4cf3abc5aa083e28fe7a866bd95fb3bbbc1e0 + React-hermes: cad69ee9a53870cc38e5386889aa7ea81c75b6a1 + React-idlecallbacksnativemodule: 445390be0f533797ace18c419eb57110dbfe90d6 + React-ImageManager: cb78d7a24f45f8f9a5a1640b52fce4c9f637f98d + React-jserrorhandler: dfe9b96e99a93d4f4858bad66d5bc4813a87a21a + React-jsi: bc1f6073e203fb540edd6d26f926ad041809b443 + React-jsiexecutor: 1e8fc70dd9614c3e9d5c3c876b2ea3cd1d931ee4 + React-jsinspector: 7544a20e9beac390f1b65d9f0040d97cd55dc198 + React-jsitracing: cac972ccc097db399df8044e49add8e5b25cb34a + React-logger: 80d87daf2f98bf95ab668b79062c1e0c3f0c2f8a + React-Mapbuffer: acffb35a53a5f474ede09f082ac609b41aafab2e + React-microtasksnativemodule: 71ca9282bce93b319218d75362c0d646b376eb43 + react-native-background-timer: 4638ae3bee00320753647900b21260b10587b6f7 + react-native-config: ea75335a7cca1d3326de1da384227e580a7c082e + react-native-google-maps: 98754480fbb4fd5ccd016d0f75a2168a6c84ebc5 + react-native-maps: 6f92b1fd37f9421b171c977a42785270703875dc + react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 + react-native-safe-area-context: 8b8404e70b0cbf2a56428a17017c14c1dcc16448 + react-native-slider: fc7f35c082abec47e341dfe43657a1c26f38db2f + react-native-webview: 042b9dfd509d23e7ebc07da06c38a8bcc4679d46 React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794 - React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614 + React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5 React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914 - React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed + React-performancetimeline: 3e3f5c5576fe1cc2dd5fcfb1ae2046d5dceda3d7 React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc - React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc - React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631 - React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9 - React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689 - React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465 - React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d - React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91 - React-RCTSettings: e10b8e42b0fce8a70fbf169de32a2ae03243ef6b - React-RCTText: e7bf9f4997a1a0b45c052d4ad9a0fe653061cf29 - React-RCTVibration: 5b70b7f11e48d1c57e0d4832c2097478adbabe93 + React-RCTAnimation: 051f0781709c5ed80ba8aa2b421dfb1d72a03162 + React-RCTAppDelegate: 106d225d076988b06aa4834e68d1ab754f40cacf + React-RCTBlob: 895eaf8bca2e76ee1c95b479235c6ccebe586fc6 + React-RCTFabric: 8d01df202ee9e933f9b5dd44b72ec89a7ac6ee01 + React-RCTImage: b73149c0cd54b641dba2d6250aaf168fee784d9f + React-RCTLinking: 23e519712285427e50372fbc6e0265d422abf462 + React-RCTNetwork: a5d06d122588031989115f293654b13353753630 + React-RCTSettings: 87d03b5d94e6eadd1e8c1d16a62f790751aafb55 + React-RCTText: 75e9dd39684f4bcd1836134ac2348efaca7437b3 + React-RCTVibration: 033c161fe875e6fa096d0d9733c2e2501682e3d4 React-rendererconsistency: f620c6e003e3c4593e6349d8242b8aeb3d4633f0 - React-rendererdebug: e697680f4dd117becc5daf9ea9800067abcee91c + React-rendererdebug: 5be7b834677b2a7a263f4d2545f0d4966cafad82 React-rncore: c22bd84cc2f38947f0414fab6646db22ff4f80cd - React-RuntimeApple: de0976836b90b484305638616898cbc665c67c13 - React-RuntimeCore: 3c4a5aa63d9e7a3c17b7fb23f32a72a8bcfccf57 + React-RuntimeApple: 71160e6c02efa07d198b84ef5c3a52a7d9d0399d + React-RuntimeCore: f88f79ec995c12af56a265d7505c7630733d9d82 React-runtimeexecutor: ea90d8e3a9e0f4326939858dafc6ab17c031a5d3 - React-RuntimeHermes: c6b0afdf1f493621214eeb6517fb859ce7b21b81 - React-runtimescheduler: 84f0d876d254bce6917a277b3930eb9bc29df6c7 - React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0 - ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1 - ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad - RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb - RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: c1334b03231d29e6abb93b93de52190cd325ce65 - RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb - RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 - RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d - RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 + React-RuntimeHermes: 49f86328914021f50fd5a5b9756685f5f6d8b4da + React-runtimescheduler: fed70991b942c6df752a59a22081e45fc811b11c + React-utils: 02526ea15628a768b8db9517b6017a1785c734d2 + ReactCodegen: 8b5341ecb61898b8bd40a73ebc443c6bf2d14423 + ReactCommon: 36d48f542b4010786d6b2bcee615fe5f906b7105 + RNCClipboard: 7c3e3b5f71d84ef61690ad377b6c50cf27864ff5 + RNGestureHandler: 27a63f2218affdf1a426d56682f9b174904838b3 + RNInstabug: 1eed7d7d7bd3557bd62789d531753fcb608ebb28 + RNReanimated: 8bf536bd3964d10a9bacabf179897e79f6bea34f + RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 + RNSVG: 8542aa11770b27563714bbd8494a8436385fc85f + RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 -COCOAPODS: 1.14.0 +COCOAPODS: 1.16.2 diff --git a/ios/native.rb b/ios/native.rb index 1ca2aded7..8296dbcdb 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.24' } +$instabug = { :version => '15.1.26' } def use_instabug! (spec = nil) version = $instabug[:version] From fa4c16f78226d6a8f699c664299cff6f7735b89c Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Thu, 7 Aug 2025 10:41:01 +0300 Subject: [PATCH 53/62] chore: remove properties override from iOS --- .../InstabugExample.xcodeproj/project.pbxproj | 30 ++-- examples/default/ios/Podfile.lock | 134 +++++++++--------- 2 files changed, 75 insertions(+), 89 deletions(-) diff --git a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj index 6cbf4e3b0..9424acb7e 100644 --- a/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj +++ b/examples/default/ios/InstabugExample.xcodeproj/project.pbxproj @@ -331,14 +331,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-resources.sh\"\n"; @@ -396,14 +392,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Copy Pods Resources"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-resources.sh\"\n"; @@ -417,14 +409,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample/Pods-InstabugExample-frameworks.sh\"\n"; @@ -435,11 +423,7 @@ buildActionMask = 2147483647; files = ( ); - inputPaths = ( - ); name = "[CP-User] [instabug-reactnative] Upload Sourcemap"; - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "#!/bin/sh\n\nmain() {\n # Read environment variables from ios/.xcode.env if it exists\n env_path=\"$PODS_ROOT/../.xcode.env\"\n if [ -f \"$env_path\" ]; then\n source \"$env_path\"\n fi\n\n # Read environment variables from ios/.xcode.env.local if it exists\n local_env_path=\"${ENV_PATH}.local\"\n if [ -f \"$local_env_path\" ]; then\n source \"$local_env_path\"\n fi\n\n if [[ \"$INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\" = true ]]; then\n echo \"[Info] \\`INSTABUG_SOURCEMAPS_UPLOAD_DISABLE\\` was set to true, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ \"$CONFIGURATION\" = \"Debug\" ]]; then\n echo \"[Info] Building in debug mode, skipping sourcemaps upload...\"\n exit 0\n fi\n\n if [[ -z \"$INFOPLIST_FILE\" ]] || [[ -z \"$PROJECT_DIR\" ]]; then\n echo \"[Error] Instabug sourcemaps script must be invoked by Xcode\"\n exit 0\n fi\n\n local source_map_file=$(generate_sourcemaps | tail -n 1)\n\n local js_project_dir=\"$PROJECT_DIR/..\"\n local instabug_dir=$(dirname $(node -p \"require.resolve('instabug-reactnative/package.json')\"))\n local inferred_token=$(cd $js_project_dir && source $instabug_dir/scripts/find-token.sh)\n local app_token=$(resolve_var \"App Token\" \"INSTABUG_APP_TOKEN\" \"$inferred_token\" | tail -n 1)\n\n local inferred_name=$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_name=$(resolve_var \"Version Name\" \"INSTABUG_APP_VERSION_NAME\" \"$inferred_name\" | tail -n 1)\n\n local inferred_code=$(/usr/libexec/PlistBuddy -c 'print CFBundleVersion' \"$PROJECT_DIR/$INFOPLIST_FILE\")\n local version_code=$(resolve_var \"Version Code\" \"INSTABUG_APP_VERSION_CODE\" \"$inferred_code\" | tail -n 1)\n\n node $instabug_dir/bin/index.js upload-sourcemaps \\\n --platform ios \\\n --file $source_map_file \\\n --token $app_token \\\n --name $version_name \\\n --code $version_code\n}\n\ngenerate_sourcemaps() {\n local react_native_dir=$(dirname $(node -p \"require.resolve('react-native/package.json')\"))\n\n # Fixes an issue with react-native prior to v0.67.0\n # For more info: https://github.com/facebook/react-native/issues/32168\n export RN_DIR=$react_native_dir\n\n # Used withing `react-native-xcode.sh` to generate sourcemap file\n export SOURCEMAP_FILE=\"$(pwd)/main.jsbundle.map\";\n\n source \"$react_native_dir/scripts/react-native-xcode.sh\"\n\n if [[ ! -f \"$SOURCEMAP_FILE\" ]]; then\n echo \"[Error] Unable to find source map file at: $SOURCEMAP_FILE\"\n exit 0\n fi\n\n echo $SOURCEMAP_FILE\n}\n\nresolve_var() {\n local name=$1\n local env_key=$2\n local default_value=$3\n\n local env_value=\"${!env_key}\"\n\n if [[ -n \"$env_value\" ]] && [[ -n \"$default_value\" ]] && [[ \"$env_value\" != default_value ]]; then\n echo \"[Warning] Environment variable \\`$env_key\\` might have incorrect value, make sure this was intentional:\"\n echo \" Environment Value: $env_value\"\n echo \" Default Value: $default_value\"\n fi\n\n local value=\"${env_value:-$default_value}\"\n\n if [[ -z \"$value\" ]]; then\n echo \"[Error] Unable to find $name! Set the environment variable \\`$env_key\\` and try again.\"\n exit 0\n fi\n\n echo $value\n}\n\nmain \"$@\"; exit\n"; @@ -452,14 +436,10 @@ inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-InstabugExample-InstabugTests/Pods-InstabugExample-InstabugTests-frameworks.sh\"\n"; @@ -700,7 +680,10 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -772,7 +755,10 @@ "-DFOLLY_MOBILE=1", "-DFOLLY_USE_LIBCPP=1", ); - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 42a84fa71..eab18a2da 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.24) + - Instabug (15.1.26) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.1): - - Instabug (= 15.1.24) + - Instabug (= 15.1.26) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.24/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2017,15 +2017,15 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 4cb898d0bf20404aab1850c656dcea009429d6c1 - DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 + DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 FBLazyVector: 430e10366de01d1e3d57374500b1b150fe482e6d fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b + glog: 69ef571f3de08433d766d614c73a9838a06bf7eb Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 81ff406348f7a9784ad2c681c94279a0ad3fcab7 - instabug-reactnative-ndk: e6f3fd45d6426aa7d37f479f153b5c2bdc1f5eb9 + Instabug: c47bd604b5212496da79b19b368eb5de73833d69 + instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1 @@ -2033,73 +2033,73 @@ SPEC CHECKSUMS: RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205 React: c2830fa483b0334bda284e46a8579ebbe0c5447e React-callinvoker: 4aecde929540c26b841a4493f70ebf6016691eb8 - React-Core: 32a581847d74ce9b5f51d9d11a4e4d132ad61553 - React-CoreModules: f53e0674e1747fa41c83bc970e82add97b14ad87 - React-cxxreact: 86f3b1692081fd954a0cb27cc90d14674645b64b + React-Core: 9c059899f00d46b5cec3ed79251f77d9c469553d + React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5 + React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494 React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5 - React-defaultsnativemodule: 2ed121c5a1edeab09cff382b8d9b538260f07848 - React-domnativemodule: 4393dd5dd7e13dbe42e69ebc791064a616990f91 - React-Fabric: cbf38ceefb1ac6236897abdb538130228e126695 - React-FabricComponents: dd4b01c4a60920d8dc15f3b5594c6fe9e7648a38 - React-FabricImage: 8b13aedfbd20f349b9b3314baf993c71c02995d9 + React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae + React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df + React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8 + React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364 + React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1 React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5 - React-featureflagsnativemodule: 87b58caf3cd8eca1e53179453789def019af2a65 - React-graphics: f5c4cf3abc5aa083e28fe7a866bd95fb3bbbc1e0 - React-hermes: cad69ee9a53870cc38e5386889aa7ea81c75b6a1 - React-idlecallbacksnativemodule: 445390be0f533797ace18c419eb57110dbfe90d6 - React-ImageManager: cb78d7a24f45f8f9a5a1640b52fce4c9f637f98d - React-jserrorhandler: dfe9b96e99a93d4f4858bad66d5bc4813a87a21a - React-jsi: bc1f6073e203fb540edd6d26f926ad041809b443 - React-jsiexecutor: 1e8fc70dd9614c3e9d5c3c876b2ea3cd1d931ee4 - React-jsinspector: 7544a20e9beac390f1b65d9f0040d97cd55dc198 - React-jsitracing: cac972ccc097db399df8044e49add8e5b25cb34a - React-logger: 80d87daf2f98bf95ab668b79062c1e0c3f0c2f8a - React-Mapbuffer: acffb35a53a5f474ede09f082ac609b41aafab2e - React-microtasksnativemodule: 71ca9282bce93b319218d75362c0d646b376eb43 - react-native-background-timer: 4638ae3bee00320753647900b21260b10587b6f7 - react-native-config: ea75335a7cca1d3326de1da384227e580a7c082e - react-native-google-maps: 98754480fbb4fd5ccd016d0f75a2168a6c84ebc5 - react-native-maps: 6f92b1fd37f9421b171c977a42785270703875dc - react-native-netinfo: cec9c4e86083cb5b6aba0e0711f563e2fbbff187 - react-native-safe-area-context: 8b8404e70b0cbf2a56428a17017c14c1dcc16448 - react-native-slider: fc7f35c082abec47e341dfe43657a1c26f38db2f - react-native-webview: 042b9dfd509d23e7ebc07da06c38a8bcc4679d46 + React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803 + React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96 + React-hermes: 2069b08e965e48b7f8aa2c0ca0a2f383349ed55d + React-idlecallbacksnativemodule: e211b2099b6dced97959cb58257bab2b2de4d7ef + React-ImageManager: ab7a7d17dd0ff1ef1d4e1e88197d1119da9957ce + React-jserrorhandler: d9e867bb83b868472f3f7601883f0403b3e3942d + React-jsi: d68f1d516e5120a510afe356647a6a1e1f98f2db + React-jsiexecutor: 6366a08a0fc01c9b65736f8deacd47c4a397912a + React-jsinspector: 0ac947411f0c73b34908800cc7a6a31d8f93e1a8 + React-jsitracing: 0e8c0aadb1fcec6b1e4f2a66ee3b0da80f0f8615 + React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b + React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3 + React-microtasksnativemodule: 2b73e68f0462f3175f98782db08896f8501afd20 + react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe + react-native-config: 8f7283449bbb048902f4e764affbbf24504454af + react-native-google-maps: 1bcc1f9f13f798fcf230db7fe476f3566d0bc0a3 + react-native-maps: 72a8a903f8a1b53e2c777ba79102078ab502e0bf + react-native-netinfo: f0a9899081c185db1de5bb2fdc1c88c202a059ac + react-native-safe-area-context: 142fade490cbebbe428640b8cbdb09daf17e8191 + react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4 + react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9 React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794 - React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5 + React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614 React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914 - React-performancetimeline: 3e3f5c5576fe1cc2dd5fcfb1ae2046d5dceda3d7 + React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc - React-RCTAnimation: 051f0781709c5ed80ba8aa2b421dfb1d72a03162 - React-RCTAppDelegate: 106d225d076988b06aa4834e68d1ab754f40cacf - React-RCTBlob: 895eaf8bca2e76ee1c95b479235c6ccebe586fc6 - React-RCTFabric: 8d01df202ee9e933f9b5dd44b72ec89a7ac6ee01 - React-RCTImage: b73149c0cd54b641dba2d6250aaf168fee784d9f - React-RCTLinking: 23e519712285427e50372fbc6e0265d422abf462 - React-RCTNetwork: a5d06d122588031989115f293654b13353753630 - React-RCTSettings: 87d03b5d94e6eadd1e8c1d16a62f790751aafb55 - React-RCTText: 75e9dd39684f4bcd1836134ac2348efaca7437b3 - React-RCTVibration: 033c161fe875e6fa096d0d9733c2e2501682e3d4 + React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc + React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631 + React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9 + React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689 + React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465 + React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d + React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91 + React-RCTSettings: e10b8e42b0fce8a70fbf169de32a2ae03243ef6b + React-RCTText: e7bf9f4997a1a0b45c052d4ad9a0fe653061cf29 + React-RCTVibration: 5b70b7f11e48d1c57e0d4832c2097478adbabe93 React-rendererconsistency: f620c6e003e3c4593e6349d8242b8aeb3d4633f0 - React-rendererdebug: 5be7b834677b2a7a263f4d2545f0d4966cafad82 + React-rendererdebug: e697680f4dd117becc5daf9ea9800067abcee91c React-rncore: c22bd84cc2f38947f0414fab6646db22ff4f80cd - React-RuntimeApple: 71160e6c02efa07d198b84ef5c3a52a7d9d0399d - React-RuntimeCore: f88f79ec995c12af56a265d7505c7630733d9d82 + React-RuntimeApple: de0976836b90b484305638616898cbc665c67c13 + React-RuntimeCore: 3c4a5aa63d9e7a3c17b7fb23f32a72a8bcfccf57 React-runtimeexecutor: ea90d8e3a9e0f4326939858dafc6ab17c031a5d3 - React-RuntimeHermes: 49f86328914021f50fd5a5b9756685f5f6d8b4da - React-runtimescheduler: fed70991b942c6df752a59a22081e45fc811b11c - React-utils: 02526ea15628a768b8db9517b6017a1785c734d2 - ReactCodegen: 8b5341ecb61898b8bd40a73ebc443c6bf2d14423 - ReactCommon: 36d48f542b4010786d6b2bcee615fe5f906b7105 - RNCClipboard: 7c3e3b5f71d84ef61690ad377b6c50cf27864ff5 - RNGestureHandler: 27a63f2218affdf1a426d56682f9b174904838b3 - RNInstabug: 1eed7d7d7bd3557bd62789d531753fcb608ebb28 - RNReanimated: 8bf536bd3964d10a9bacabf179897e79f6bea34f - RNScreens: 35bb8e81aeccf111baa0ea01a54231390dbbcfd9 - RNSVG: 8542aa11770b27563714bbd8494a8436385fc85f - RNVectorIcons: 182892e7d1a2f27b52d3c627eca5d2665a22ee28 + React-RuntimeHermes: c6b0afdf1f493621214eeb6517fb859ce7b21b81 + React-runtimescheduler: 84f0d876d254bce6917a277b3930eb9bc29df6c7 + React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0 + ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1 + ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad + RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb + RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 + RNInstabug: 35bf420d77731598fae13c33ceecf0343fd8dd99 + RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb + RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 + RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d + RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 29f363f85c01e13c559723cad266922d16c81bc5 +PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 -COCOAPODS: 1.16.2 +COCOAPODS: 1.15.2 From 980318715bec65ebe3629ed433012c769b0f5eff Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 10 Aug 2025 12:19:20 +0300 Subject: [PATCH 54/62] chore: update android dependency --- android/native.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/native.gradle b/android/native.gradle index d9c7a2f5b..aecda1bed 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.2.7020723-SNAPSHOT' + version: '15.0.2.7085666-SNAPSHOT' ] dependencies { From e22f31eac02238ae5234309c406d8f6f64113a62 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 10 Aug 2025 17:59:56 +0300 Subject: [PATCH 55/62] chore: update android dependency --- android/native.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/native.gradle b/android/native.gradle index aecda1bed..70b9807e7 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.2.7085666-SNAPSHOT' + version: '15.0.2.7085294-SNAPSHOT' ] dependencies { From 241cc27b6648bdecc59b5e913bc96044feb78fa4 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Thu, 14 Aug 2025 15:21:21 +0300 Subject: [PATCH 56/62] chore: update SR public api name --- examples/default/ios/Podfile.lock | 4 ++-- examples/default/src/App.tsx | 2 +- examples/default/src/screens/apm/ScreenRender.tsx | 2 +- src/modules/APM.ts | 2 +- test/modules/APM.spec.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index eab18a2da..67becbc47 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index 703932594..00d054764 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -60,7 +60,7 @@ export const App: React.FC = () => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; }); - APM.setScreenRenderEnabled(true); + APM.setScreenRenderingEnabled(true); setIsInstabugInitialized(true); }) .catch((error) => { diff --git a/examples/default/src/screens/apm/ScreenRender.tsx b/examples/default/src/screens/apm/ScreenRender.tsx index f9113a2c8..d42aea04a 100644 --- a/examples/default/src/screens/apm/ScreenRender.tsx +++ b/examples/default/src/screens/apm/ScreenRender.tsx @@ -24,7 +24,7 @@ const ScreenRenderSwitch: React.FC = () => { style={[styles.switch, isEnabled && styles.switchEnabled]} onPress={() => { setIsEnabled(!isEnabled); - APM.setScreenRenderEnabled(isEnabled); + APM.setScreenRenderingEnabled(isEnabled); }}> diff --git a/src/modules/APM.ts b/src/modules/APM.ts index bc6de2fb9..87f682770 100644 --- a/src/modules/APM.ts +++ b/src/modules/APM.ts @@ -120,6 +120,6 @@ export const _ibgSleep = () => { * Enables or disables Screen Render feature * @param isEnabled */ -export const setScreenRenderEnabled = (isEnabled: boolean) => { +export const setScreenRenderingEnabled = (isEnabled: boolean) => { NativeAPM.setScreenRenderEnabled(isEnabled); }; diff --git a/test/modules/APM.spec.ts b/test/modules/APM.spec.ts index 8ee4fbe59..d8e37d429 100644 --- a/test/modules/APM.spec.ts +++ b/test/modules/APM.spec.ts @@ -103,7 +103,7 @@ describe('APM Module', () => { }); it('should call the native method setScreenRenderEnabled', () => { - APM.setScreenRenderEnabled(true); + APM.setScreenRenderingEnabled(true); expect(NativeAPM.setScreenRenderEnabled).toBeCalledTimes(1); expect(NativeAPM.setScreenRenderEnabled).toBeCalledWith(true); From f23803489f2579f76a27cc086e745e041c45daed Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 17 Aug 2025 15:00:53 +0300 Subject: [PATCH 57/62] chore: update CHANGELOG.md, rename setScreenRenderingEnabled api on native SDKs for consistency --- CHANGELOG.md | 2 ++ .../reactlibrary/RNInstabugAPMModule.java | 2 +- examples/default/ios/Podfile.lock | 18 ++++++++++-------- examples/default/src/App.tsx | 4 +++- ios/RNInstabug/InstabugAPMBridge.h | 2 +- ios/RNInstabug/InstabugAPMBridge.m | 2 +- src/modules/APM.ts | 2 +- src/native/NativeAPM.ts | 2 +- test/mocks/mockAPM.ts | 2 +- test/modules/APM.spec.ts | 4 ++-- 10 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c04e83d..347fc17f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - Add support Advanced UI customization. ([#1411](https://github.com/Instabug/Instabug-React-Native/pull/1411)) +- Add screen rendering monitoring functionality within the APM product. ([#1416](https://github.com/Instabug/Instabug-React-Native/pull/1416)) + ## [15.0.2](https://github.com/Instabug/Instabug-React-Native/compare/v15.2.0...dev) ### Added diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java index e1960b7cd..533ad95e0 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugAPMModule.java @@ -396,7 +396,7 @@ private void networkLogAndroid(final double requestStartTime, * @param isEnabled boolean indicating enabled or disabled. */ @ReactMethod - public void setScreenRenderEnabled(boolean isEnabled) { + public void setScreenRenderingEnabled(boolean isEnabled) { MainThreadHandler.runOnMainThread(new Runnable() { @Override public void run() { diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 274dbfc09..07e02cb01 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.1) + - Instabug (15.1.26) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.2): - - Instabug (= 15.1.1) + - Instabug (= 15.1.26) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,6 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1850,7 +1851,6 @@ SPEC REPOS: trunk: - Google-Maps-iOS-Utils - GoogleMaps - - Instabug - OCMock - SocketRocket @@ -1868,6 +1868,8 @@ EXTERNAL SOURCES: hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b + Instabug: + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2022,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: 3e7af445c14d7823fcdecba223f09b5f7c0c6ce1 + Instabug: c47bd604b5212496da79b19b368eb5de73833d69 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2090,14 +2092,14 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: c4d26c830b40c474422012d1a216d8ea37c88151 + RNInstabug: 22cc867a673c42a5f293542222efb20fcdf9a352 RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 + Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 -PODFILE CHECKSUM: 837b933596e1616ff02cc206bb17dee4f611fdbc +PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 -COCOAPODS: 1.14.0 +COCOAPODS: 1.15.2 diff --git a/examples/default/src/App.tsx b/examples/default/src/App.tsx index ad1c32579..af84d5983 100644 --- a/examples/default/src/App.tsx +++ b/examples/default/src/App.tsx @@ -3,8 +3,8 @@ import { StyleSheet } from 'react-native'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { NavigationContainer, useNavigationContainerRef } from '@react-navigation/native'; -import type { SessionMetadata } from 'instabug-reactnative'; import Instabug, { + APM, CrashReporting, InvocationEvent, LaunchType, @@ -12,6 +12,7 @@ import Instabug, { NetworkInterceptionMode, NetworkLogger, ReproStepsMode, + type SessionMetadata, SessionReplay, } from 'instabug-reactnative'; import { NativeBaseProvider } from 'native-base'; @@ -60,6 +61,7 @@ export const App: React.FC = () => { useEffect(() => { initializeInstabug(); + APM.setScreenRenderingEnabled(true); NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => { networkData.url = `${networkData.url}/JS/Obfuscated`; return networkData; diff --git a/ios/RNInstabug/InstabugAPMBridge.h b/ios/RNInstabug/InstabugAPMBridge.h index 894fc5ed1..849451991 100644 --- a/ios/RNInstabug/InstabugAPMBridge.h +++ b/ios/RNInstabug/InstabugAPMBridge.h @@ -21,7 +21,7 @@ - (void)startUITrace:(NSString *)name; - (void)endUITrace; -- (void)setScreenRenderEnabled:(BOOL)isEnabled; +- (void)setScreenRenderingEnabled:(BOOL)isEnabled; extern NSMutableDictionary *traces; diff --git a/ios/RNInstabug/InstabugAPMBridge.m b/ios/RNInstabug/InstabugAPMBridge.m index fec8f150f..a363b80fd 100644 --- a/ios/RNInstabug/InstabugAPMBridge.m +++ b/ios/RNInstabug/InstabugAPMBridge.m @@ -90,7 +90,7 @@ - (id) init } // Enables or disables screen render. -RCT_EXPORT_METHOD(setScreenRenderEnabled:(BOOL)isEnabled) { +RCT_EXPORT_METHOD(setScreenRenderingEnabled:(BOOL)isEnabled) { IBGAPM.screenRenderingEnabled = isEnabled; } diff --git a/src/modules/APM.ts b/src/modules/APM.ts index 87f682770..bbb0b1b83 100644 --- a/src/modules/APM.ts +++ b/src/modules/APM.ts @@ -121,5 +121,5 @@ export const _ibgSleep = () => { * @param isEnabled */ export const setScreenRenderingEnabled = (isEnabled: boolean) => { - NativeAPM.setScreenRenderEnabled(isEnabled); + NativeAPM.setScreenRenderingEnabled(isEnabled); }; diff --git a/src/native/NativeAPM.ts b/src/native/NativeAPM.ts index 2e7594fd5..33c986ea8 100644 --- a/src/native/NativeAPM.ts +++ b/src/native/NativeAPM.ts @@ -46,7 +46,7 @@ export interface ApmNativeModule extends NativeModule { ibgSleep(): void; // Screen Rendering // - setScreenRenderEnabled(isEnabled: boolean): void; + setScreenRenderingEnabled(isEnabled: boolean): void; } export const NativeAPM = NativeModules.IBGAPM; diff --git a/test/mocks/mockAPM.ts b/test/mocks/mockAPM.ts index 8c75b4807..623e654fd 100644 --- a/test/mocks/mockAPM.ts +++ b/test/mocks/mockAPM.ts @@ -14,7 +14,7 @@ const mockAPM: ApmNativeModule = { endAppLaunch: jest.fn(), ibgSleep: jest.fn(), networkLogAndroid: jest.fn(), - setScreenRenderEnabled: jest.fn(), + setScreenRenderingEnabled: jest.fn(), }; export default mockAPM; diff --git a/test/modules/APM.spec.ts b/test/modules/APM.spec.ts index d8e37d429..fbdde4497 100644 --- a/test/modules/APM.spec.ts +++ b/test/modules/APM.spec.ts @@ -105,7 +105,7 @@ describe('APM Module', () => { it('should call the native method setScreenRenderEnabled', () => { APM.setScreenRenderingEnabled(true); - expect(NativeAPM.setScreenRenderEnabled).toBeCalledTimes(1); - expect(NativeAPM.setScreenRenderEnabled).toBeCalledWith(true); + expect(NativeAPM.setScreenRenderingEnabled).toBeCalledTimes(1); + expect(NativeAPM.setScreenRenderingEnabled).toBeCalledWith(true); }); }); From 9686c611fbf013063b942d077780581263d02587 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 17 Aug 2025 15:13:44 +0300 Subject: [PATCH 58/62] chore: fix SR api name in native unit tests --- .../com/instabug/reactlibrary/RNInstabugAPMModuleTest.java | 2 +- examples/default/ios/InstabugTests/InstabugAPMTests.m | 2 +- examples/default/ios/Podfile.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java index c4e6860c6..1f4852081 100644 --- a/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java +++ b/android/src/test/java/com/instabug/reactlibrary/RNInstabugAPMModuleTest.java @@ -168,7 +168,7 @@ public void testSetFlowAttribute() { @Test public void given$setScreenRenderEnabled_whenQuery_thenShouldCallNativeApiWithEnabled() { - apmModule.setScreenRenderEnabled(true); + apmModule.setScreenRenderingEnabled(true); // then verify(APM.class, times(1)); APM.setScreenRenderingEnabled(true); diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 127ff50ce..4b8e3b5fb 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -143,7 +143,7 @@ - (void) testSetScreenRenderDisabled { id mock = OCMClassMock([IBGAPM class]); BOOL isEnabled = NO; - [self.instabugBridge setScreenRenderEnabled:isEnabled]; + [self.instabugBridge setScreenRenderingEnabled:isEnabled]; OCMVerify([mock setScreenRenderingEnabled:NO]); } diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 07e02cb01..4211cb63e 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -2098,8 +2098,8 @@ SPEC CHECKSUMS: RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08 + Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 -COCOAPODS: 1.15.2 +COCOAPODS: 1.14.0 From cdb52ff218dfb55802b7befe188deff095eea898 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Sun, 17 Aug 2025 18:12:11 +0300 Subject: [PATCH 59/62] chore: fix SR api name in native unit tests --- examples/default/ios/InstabugTests/InstabugAPMTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/default/ios/InstabugTests/InstabugAPMTests.m b/examples/default/ios/InstabugTests/InstabugAPMTests.m index 4b8e3b5fb..6960be2d5 100644 --- a/examples/default/ios/InstabugTests/InstabugAPMTests.m +++ b/examples/default/ios/InstabugTests/InstabugAPMTests.m @@ -134,7 +134,7 @@ - (void) testSetScreenRenderEnabled { id mock = OCMClassMock([IBGAPM class]); BOOL isEnabled = YES; - [self.instabugBridge setScreenRenderEnabled:isEnabled]; + [self.instabugBridge setScreenRenderingEnabled:isEnabled]; OCMVerify([mock setScreenRenderingEnabled:YES]); } From fda6580d9992af2079f04323e70f57727983a10e Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Wed, 20 Aug 2025 12:36:00 +0300 Subject: [PATCH 60/62] chore: update iOS pods --- examples/default/ios/Podfile | 2 +- examples/default/ios/Podfile.lock | 14 +++++++------- ios/native.rb | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/default/ios/Podfile b/examples/default/ios/Podfile index 0d3e454c6..154cc210f 100644 --- a/examples/default/ios/Podfile +++ b/examples/default/ios/Podfile @@ -15,7 +15,7 @@ target 'InstabugExample' do config = use_native_modules! rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path - pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec' + pod 'Instabug', :podspec => 'https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.31/Instabug.podspec' # Flags change depending on the env values. flags = get_default_flags() diff --git a/examples/default/ios/Podfile.lock b/examples/default/ios/Podfile.lock index 4211cb63e..79340aafa 100644 --- a/examples/default/ios/Podfile.lock +++ b/examples/default/ios/Podfile.lock @@ -31,7 +31,7 @@ PODS: - hermes-engine (0.75.4): - hermes-engine/Pre-built (= 0.75.4) - hermes-engine/Pre-built (0.75.4) - - Instabug (15.1.26) + - Instabug (15.1.31) - instabug-reactnative-ndk (0.1.0): - DoubleConversion - glog @@ -1626,7 +1626,7 @@ PODS: - ReactCommon/turbomodule/core - Yoga - RNInstabug (15.0.2): - - Instabug (= 15.1.26) + - Instabug (= 15.1.31) - React-Core - RNReanimated (3.16.1): - DoubleConversion @@ -1770,7 +1770,7 @@ DEPENDENCIES: - fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec`) + - Instabug (from `https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.31/Instabug.podspec`) - instabug-reactnative-ndk (from `../node_modules/instabug-reactnative-ndk`) - OCMock - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) @@ -1869,7 +1869,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :tag: hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b Instabug: - :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.26/Instabug.podspec + :podspec: https://ios-releases.instabug.com/custom/faeture-screen_rendering-release/15.1.31/Instabug.podspec instabug-reactnative-ndk: :path: "../node_modules/instabug-reactnative-ndk" RCT-Folly: @@ -2024,7 +2024,7 @@ SPEC CHECKSUMS: Google-Maps-iOS-Utils: f77eab4c4326d7e6a277f8e23a0232402731913a GoogleMaps: 032f676450ba0779bd8ce16840690915f84e57ac hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Instabug: c47bd604b5212496da79b19b368eb5de73833d69 + Instabug: 447d3f5a9f1c83120235437e08c9a51aaa8f8605 instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641 OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 @@ -2092,7 +2092,7 @@ SPEC CHECKSUMS: ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad RNCClipboard: 2821ac938ef46f736a8de0c8814845dde2dcbdfb RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8 - RNInstabug: 22cc867a673c42a5f293542222efb20fcdf9a352 + RNInstabug: cdd10d22a6950eeb3426f748895b1c1597fcab6b RNReanimated: f42a5044d121d68e91680caacb0293f4274228eb RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958 RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d @@ -2100,6 +2100,6 @@ SPEC CHECKSUMS: SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: 055f92ad73f8c8600a93f0e25ac0b2344c3b07e6 -PODFILE CHECKSUM: 4e2ae668f4fb59c72dfd359d3d9c86ec6d4967e5 +PODFILE CHECKSUM: 3f4c318b317eb96e022a39eb0a81a414f5d95205 COCOAPODS: 1.14.0 diff --git a/ios/native.rb b/ios/native.rb index 8296dbcdb..fc994abba 100644 --- a/ios/native.rb +++ b/ios/native.rb @@ -1,4 +1,4 @@ -$instabug = { :version => '15.1.26' } +$instabug = { :version => '15.1.31' } def use_instabug! (spec = nil) version = $instabug[:version] From 6e0f694598f7cd2c739c624d515ac4cbcc0f3ea2 Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Wed, 20 Aug 2025 15:27:47 +0300 Subject: [PATCH 61/62] chore: remove native iOS deprecated api --- ios/RNInstabug/InstabugAPMBridge.m | 2 +- ios/RNInstabug/InstabugReactBridge.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/RNInstabug/InstabugAPMBridge.m b/ios/RNInstabug/InstabugAPMBridge.m index a363b80fd..b053a0fb3 100644 --- a/ios/RNInstabug/InstabugAPMBridge.m +++ b/ios/RNInstabug/InstabugAPMBridge.m @@ -2,7 +2,7 @@ #import "InstabugAPMBridge.h" #import -#import +//#import #import #import #import diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index 52d5917fc..627ff3d3e 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -172,7 +172,7 @@ - (dispatch_queue_t)methodQueue { } RCT_EXPORT_METHOD(setPrimaryColor:(UIColor *)color) { - Instabug.tintColor = color; +// Instabug.tintColor = color; } RCT_EXPORT_METHOD(setTheme:(NSDictionary *)themeConfig) { From f54d3b86922fba291e1949598b1b8501de0c1ecb Mon Sep 17 00:00:00 2001 From: Andrew Amin Date: Thu, 21 Aug 2025 12:39:11 +0300 Subject: [PATCH 62/62] chore: update android dependency --- android/native.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/native.gradle b/android/native.gradle index 70b9807e7..23f9c00b4 100644 --- a/android/native.gradle +++ b/android/native.gradle @@ -1,5 +1,5 @@ project.ext.instabug = [ - version: '15.0.2.7085294-SNAPSHOT' + version: '16.0.0.6893868-SNAPSHOT' ] dependencies {