-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetworkLogger.setNetworkDataObfuscationHandler not working as expected in iOS (React Native) #1003
Comments
Hi @Sergirsanchez! Thanks for reporting this issue. Can you please provide the initialization code and the code for sending the network request? |
Hi @a7medev! I upgrade the SDK to Instabug service file:
Call from App file: |
@Sergirsanchez Can you also provide me with the snippet where you make the network call? |
Sorry for not replying, but I'm a bit busy these days. During today or tomorrow I'll send you the snippet 😄 |
@Sergirsanchez No problem. To keep you updated, we were able to reproduce it and are looking into possible solutions to this problem, we will update you once we have something to share. |
@a7medev Sorry for the delay, I attach some code snippets about how we do the queries. If you need anything else feel free to ask for it, and thanks for the update!
|
Hi @Sergirsanchez! Another update on this issue, we will be handling this issue in an upcoming cycle not in support so it might take some time. Until then you can add an obfuscation handler on the native iOS side in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
// You will need to start the SDK natively as well (don't remove the Instabug.init call on the JS side)
[Instabug startWithToken:@"YOUR_APP_TOKEN" invocationEvents:IBGInvocationEventFloatingButton | IBGInvocationEventShake];
// Add your obfuscation handler here
[IBGNetworkLogger setRequestObfuscationHandler:^NSURLRequest * _Nonnull(NSURLRequest * _Nonnull request) {
NSMutableURLRequest *myRequest = [request mutableCopy];
NSMutableDictionary<NSString *, NSString *> *headers = [myRequest.allHTTPHeaderFields mutableCopy];
headers[@"Authorization"] = @"SECRET_IOS";
myRequest.allHTTPHeaderFields = headers;
return myRequest;
}];
...
} Please note that this is a temporary solution until a fix comes out in our production SDK. |
@a7medev Thanks for the temporary solution! I'll keep an eye on future versions |
Is there any update on the progress of this request. The bug is also a hinderance in our development right now. |
Hello @SanderNiesten! Can you please share more details on the issue you're facing? Also, do you use a native solution for data fetching (not using |
Steps to Reproduce the Problem
Call
init
method and the try to obfuscate some data in requests headers withNetworkLogger.setNetworkDataObfuscationHandler
Expected Behavior
Some headers should have their data obfuscated in reports
Actual Behavior
For Android works as expected, but for iOS seems that the method is not trigger when we send requests against our own API, with third party services seems to works. We are using
redux-saga
to do queries against our own API.Instabug integration code
...
SDK Version
v11.9.1, but I'm seeing the error from v10.13.0 . Didn't check in previous versions
React Native, iOS and Android Versions
buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33
Device Model
The text was updated successfully, but these errors were encountered: