Automatic HTTP network traffic monitoring add-on for AMRSDK.
AMRNetworkSDK auto-captures every HTTP(S) request made by the host app — including third-party SDKs — and forwards them to AMRSDK for event reporting. No integration code required: drop it in, and AMRSDK starts the monitor automatically when network tracking is enabled in your dashboard.
- iOS 13.0+
- Xcode 14+
- AMRSDK 1.5.91 or later
- Registers a global
NSURLProtocolto interceptURLSessiontraffic. - Swizzles
NSURLSession.session(configuration:)(and the delegate variant) to inject the protocol into ephemeral / custom configurations. - Forwards each captured request — URL, method, status code, duration, request/response payload sizes, error — to
AMRSDK.trackHTTPRequest(...). - Filters out AMRSDK's own outbound traffic (
admost.comand subdomains) to avoid recursion.
Background URLSessions are not intercepted — iOS does not honor NSURLProtocol for background sessions.
pod 'AMRNetworkSDK'In Xcode: File → Add Packages… and enter:
https://github.com/admost/AMR-IOS-NETWORK-SDK
Or in Package.swift:
dependencies: [
.package(url: "https://github.com/admost/AMR-IOS-NETWORK-SDK", from: "1.0.0")
]No code changes required. After AMRSDK.start(...), the monitor starts automatically when both EventsActive and AutoNetworkTrackerEnabled are enabled in your Admost dashboard.
To check whether it's running:
#import <AMRNetworkSDK/AMRNetworkSDK.h>
if ([AMRNetworkMonitor isRunning]) {
NSLog(@"Network monitor v%@ is active", [AMRNetworkMonitor SDKVersion]);
}Network tracking can be toggled remotely without an app release — flip the AutoNetworkTrackerEnabled flag in the Admost dashboard. Disabling EventsActive also stops the monitor.
To stop in code:
[AMRNetworkMonitor stop];[AMRNetworkMonitor addIgnoredHostSuffix:@"example.com"];Matches example.com and any subdomain (api.example.com, cdn.example.com).
MIT — see LICENSE.