Incase, your development language is swift, please use the SWIFT documentation for integration.
You need to add cocoa pods to your project. You can find more information here
Incase, your development language is swift, please use the SWIFT documentation for integration.
To leverage the capabilities of both FinotesWatchosCore and FinotesWatchosDebug,
pod 'FinotesWatchosCore', '4.2.1', :configuration => ['Release']
pod 'FinotesWatchosDebug', '4.2.1', :configuration => ['Debug']
FinotesDebug framework contains all features in FinotesWatchosCore and: 1. Ability to track framerate issues.
The –repo-update option should be used the first time pod install is run from terminal.
Then install the same by executing the following command from terminal where your Podfile resides.
Here the —repo-update is added incase your local cocoa pods repository is not up to date.
pod install --repo-update
You can import the FinotesWatchosCore to your code using the import statement below.
#import <FinotesWatch/Fn.h>
You need to call the [Fn initialize:self] function in your ExtensionDelegate applicationDidFinishLaunching
#import <FinotesWatch/Fn.h>
- (void)applicationDidFinishLaunching {
[Fn initialize:self];
}
Now that the basic integration of Finotes framework is complete,
Let us make sure that the dashboard and framework are in sync.
Add [Fn test]; after [Fn initialize:self];
#import <FinotesWatch/Fn.h>
#import <FinotesWatch/Severity.h>
- (void)applicationDidFinishLaunching {
[Fn initialize:self];
[Fn test];
}
Now run the application in a simulator or real watchOS device (with active network connection).
Once the application opens up, open Finotes dash.
The test issue that we raised should be reported.
In-case the issue is not listed, make sure the right app and platform is selected at the top of the dashboard.
If the issue is still not synced in Finotes dashboard, Click Here.
Remember to remove the [Fn test]; call, else every time the app is run, a test issue will be reported.
Now, Finotes is all set to report any memory related issues or any uncaught NSException based crashes.
Once you are ready to release the application, you need to back up the dSYM file to symbolicate the crashes as they are reported. Locating dSYM file.
Finotes framework automatically collects multiple data points inorder to help developers get indepth information on the issues reported. Head over to watchOS Data Points page to explore more on the type of data points collected by the framework.
Finotes Framework can detect all WKInterfaceController level leaks automatically with basic integration. Incase the basic integration is not complete, head over to How To Integrate section.
With the auto tracking capabilities of Finotes framework, the need to extend WKInterfaceController from ObservableInterfaceController is eliminated. We have deprecated the API ObservableInterfaceController and will be removed in a future version.
@interface HealthInsightsInterfaceController : ObservableInterfaceController //Deprecated
@end
Finotes is capable of reporting HTTP(s) based network errors automatically with just the basic integration. Incase the basic integration is not complete, head over to How To Integrate section.
With the auto tracking capabilities of Finotes framework, the need to call the following APIs are eliminated. We have deprecated these APIs and will be removed in a future version.
[Fn registerDefaultProtocolMonitor]; //deprecated
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration
defaultSessionConfiguration];
[Fn getProtocols:[configuration.protocolClasses mutableCopy] ]; //deprecated
As Finotes reports API call issues, each issue is tagged with corresponding request response headers, request body and associated parameters.
If header fields contain any sensitive data, Finotes provides a global and easy mechanism to mask such header fields using maskHeaders in info.plist file as shown in code snippet.
You may provide 1 or more header keys in the 'maskHeaders' field.
Open info.plist as Source Code, then add the below snippet
<key>MaskHeaders</key>
<array>
<string>Header-Key</string>
<string>Another-Header-Key</string>
</array>
Let us say API calls from the app has header field 'X-Key' which contains the authentication token.
It can be masked by providing the 'X-Key' in the field as shown above, masked header fields are filtered out from the app itself as is not sent to the Finotes dashboard, if any issues are raised.
The maskHeaders field is case insensitive and is optional.
When API call issues are reported, different urls are created as separate ticket.
This can cause large number of tickets generated for the same API incase the url contains an id or any other dynamic path component.
Use URLPatterns key in info.plist to specify the urls that contains dynamic path component.
Wrap the corresponding dynamic path component or id inside '{}'.
Using the ObservableDomains key in Info.plist file, domains can be whitelisted. Once set only HTTP(s) calls made to the whitelisted domains will be tracked by the Framework.
Setting domain timeout is an extension of whitelisting domains. Developers can set timeout to whitelisted domains using the ObservableDomains key as comma separated value.
The timeout value should be in milliseconds. Once the value is set if any of the HTTP(s) calls to the domain takes more than the set amount of time, an issue report will be raised.
With basic integration, Finotes will track and report fatal uncaught exceptions to Finotes dashboard automatically in release flavour of the framework.
With basic integration, Finotes will track and report screen loading delays to Finotes dashboard automatically. By default, if a screen takes more than 4 seconds to load then it will be raised as a bug report. Incase the basic integration is not complete, head over to How To Integrate section.
Developers can set custom time to track screen loading delays using ScreenLoadDelayInSeconds key in the info.plist file. Once set, if any of the app screen takes more than the set amount of time to load, it will be raised as a bug report.
With the auto tracking capabilities of Finotes framework, the need to extend WKInterfaceController from ObservableInterfaceController is eliminated. We have deprecated the API ObservableInterfaceController and will be removed in a future version.
@interface HealthInsightsInterfaceController : ObservableInterfaceController //deprecated
@end
Starting from version 4.1.0 all NSExceptions that may have already been caught using @try{}@catch{} are now automatically reported.
API call reportExceptionAt is now deprecated and will be removed in a future version.[Fn reportExceptionAt:self withException:exception withSeverity:FATAL]; //Deprecated
Starting from version 4.1.0 all NSErrors that are generated are now automatically reported with the basic integration. Incase the basic integration is not complete, head over to How To Integrate section.
You can report custom issues using the [Fn reportIssueAt:] API.
//Payment gateway delegate methods.
-(void) paymentCompleted:(NSString *) userIdentifier forType:(NSInteger) type{
}
-(void) paymentFailed:(NSString *) userIdentifier forReason:(NSString *) reason{
[Fn setActivityMarkerAt:self marker:[NSString stringWithFormat:@"User id %@", userIdentifier]];
[Fn reportIssueAt:self withShortDescription:@"Payment failed" withDescription:reason];
}
In cases where the fail situations can be anticipated, they may be reported using [Fn reportIssueAt].
You may pass a string as parameter to the anticipated issue.
As in custom exceptions, you will be able to make use of activity markers to aid reproducing the issue when reported.
Finotes will report all return value issues, exceptions and execution delays that may arise during function execution using [Fn call].
[self getUserNameFromDb:@"123-sd-12"]
}
-(NSString *) getUserNameFromDb:(NSString *) userId {
NSString *userName = [[User findById:userId] name];
return userName;
}
#import <FinotesWatch/Observer.h>
#import <FinotesWatch/Fn.h>
[Fn call:@selector(getUserNameFromDb:) target:self withParameters:@"123-sd-12"];
}
-(NSString *) getUserNameFromDb:(NSString *) userId {
NSString *userName = [[User findById:userId] name];
return userName;
}
You can make use of expectedExecutionTime, severity, expectNull fields in Observer parameter of
Incase, we have a function that may take more than 1000 milliseconds(default value) for execution then use this field in Observer to provide an ideal execution time.
Supplying proper values in Observer parameter will help Finotes raise better issue reports.
#import <FinotesWatch/Observer.h>
#import <FinotesWatch/Fn.h>
Observer *observer = [[Fn observe] expectedExecutionTime:1400];
NSString *userName = [Fn call:@selector(getUserNameFromDb:) target:self
observer:observer withParameters:@"123-sd-12"];
}
-(NSString *) getUserNameFromDb:(NSString *) userId {
NSString *userName = [[User findById:userId] name];
return userName;
}
If function returns an object and return value could be NULL, then set this field to true to prevent Finotes from raising an issue when function returns NULL.
By default field is false, and issue will be raised if function returns NULL.
Sets severity level of issues reported from a function using this field.
All issues raised from a function will have the same severity level, set to it using Observer parameter.
By default severity is MAJOR.
Finotes has the ability to invoke code level functions and report any issues that may arise from it.
Feature tracking allows developers to track a particular feature in watchOS app by chaining 2 or more functions invoked by Finotes.
Let us take the example of Chat feature in a typical watchOS application.
The function at the time of clicking the send button 'sendChat' and 'onChatSent' success function after the items as been added to the cart needs to be invoked using Finotes.
The Finotes looks for 'onChatSent' function execution after the execution of 'sendChat', if the 'onChatSent' is not executed within in 10000 milliseconds then a corresponding issue will be raised.
#import <FinotesWatch/Observer.h>
#import <FinotesWatch/Fn.h>
- (void) sendChatClicked:(UITapGestureRecognizer *)recognizer {
// Here function 'onChatSent:' is
// expected to be called in under '10000' milliseconds.
Observer *observer = [[[Fn observe] expectedChainedExecutionTime:10000]
nextFunctionSignature:
@selector(onChatSent:)
inClass:[self class]];
[Fn call:@selector(sendChat:) target:self observer:observer withParameters:chatMessage];
}
- (Boolean) sendChat:(NSString *) message {
if([self isValid:message]){
[self syncMessage:message];
}
return false;
}
- (void) onChatSent:(NSString *)chatMessageId {
[self chatSyncConfirmed:chatMessageId];
}
You can make use of nextFunctionSignature, inClass, expectedChainedExecutionTime fields in Observer parameter to chain 2 or more functions.
Overrides time needed to execute second function after execution of first function.
By default the time between function executions is set to 2000 milliseconds.
Signature of the second function that is to be chained with the current function.
Class where second function is defined that is to be chained with the current function.
This feature is automatically activated. An issue report will be sent to the dashboard when a UI thread block is detected by the framework. The issue report will have the stack trace of the main thread to aid developers to pin point the exact line causing the issue.
Developers can set custom frame rate threshold with the API setFrameRateThreshold before [Fn initialize:] API.
#import <FinotesWatch/Fn.h>
- (void)applicationDidFinishLaunching {
[Fn setFrameRateThreshold:2.0];
[Fn initialize:application];
}
Once a custom threshold value (in seconds) is set and if the UI thread gets blocked for more than the threshold value, a corresponding issue report will be sent to the Finotes dashboard. Supported threshold values are between 0.016 seconds (16 milliseconds) to 5 seconds (5000 milliseconds) in FinotesDebug (debug flavour) and between 0.25 seconds (250 milliseconds) to 5 seconds (5000 milliseconds) in FinotesCore (release flavour). Default frame rate threshold is 0.25 seconds (250 milliseconds) in debug flavour and 1 second (1000 milliseconds) in release flavour.
The deprecated API enableFrameRateDetection will be removed in future version of the framework.
[Fn enableFrameRateDetection]; //deprecated
Activity markers are events that occur in an application during runtime.
You can set custom activity markers in the project using [Fn setActivityMarkerAt]. These markers will be shown as the activity trail when an issue is reported.
Markers are displayed in their chronological order.
Only when an issue is raised, the activity markers are sent to the server.
[Fn setActivityMarkerAt:self marker:@"clicked on payment_package_two"];
You can set debug level custom activity markers in the project using [Fn setActivityMarkerForDebugAt]. These markers will be shown along with the activity trail when an issue is reported in the debug builds of the app.
[Fn setActivityMarkerForDebugAt:self marker:@"logout tapped"]
ExtensionDelegate:app loaded 11:19:24:469 45.79% FREE MEMORY
Controller:user loaded 11:19:24:708 44.39%
Controller:user authenticated 11:19:27:012 45.19%
Controller:clicked on payment_package_two 11:20:24:235 55.20%
Once the user login is complete, you can set any custom user identifier with finotes,
This identifier will be tagged with all issue reports raised in Finotes dashboard.
If this API is invoked multiple times, the latest identifier will be used with each issue report.
[Fn setCustomId:userId];
[Fn updateUserDataWithUniqueIdentifier:userId]; //deprecated
Finotes do not access user location data automatically. Framework provides a single line API that allows developers to update location data manually. Once this API is called, every issue reported by Finotes will have location data tagged.
[Fn updateLocation:clLocationCoordinates];
You can listen for and access every issue in realtime using the Fn.listenForIssue() API.
You need to add the listener in your ExtensionDelegate class.
[Fn listenForIssues:@selector(issueFound:) atTarget:self];
}
(void) issueFound:(Issue *) issue {
}
You will be provided with an Issue object that contains all the issue properties that are being synced to the server, making the whole process transparent.
This callback is triggered right after an issue occurrence.
Developers can whitelist crash reporting by adding WhitelistCrashes key in info.plist file. Once whitelisted, only exceptions that are listed in info.plist will be reported by Finotes.
You can activate internal Finotes logging using log() API.
Activating log() API will print all logs generated by the Framework in LogCat including error and warning logs.
- (void)applicationDidFinishLaunching {
[Fn log];
[Fn initialize:self];
}