将所有您的 URL 转换为 Runscope URL 的一个怪异技巧
在您的 AppDelegate 中 - 尽早地 - 使用您的 Runscope Bucket Key 调用 startTrackingRequestsWithBucketKey
。
[[RSCPRunscopeManager sharedManager] startTrackingRequestsWithBucketKey:@"YOUR_KEY_HERE"];
如果您想阻止某些 URL 被发送到 Runscope,实现 RSCPRunscopeManagerDelegate
协议的 runscopeManager:shouldTrackURL:
方法,并返回 NO,对于不应跟踪的 URL。
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[[RSCPRunscopeManager sharedManager] startTrackingRequestsWithBucketKey:@"YOUR_KEY_HERE"];
[RSCPRunscopeManager sharedManager] setDelegate:self];
}
- (BOOL)runscopeManager:(RSCPRunscopeManager *)manager shouldTrackURL:(NSURL *)URL
{
// Only track URLs that do not have the password component set
return (URL.password == nil);
}
我推荐使用 CocoaPods
pod 'RSCPRunscopeManager'