What is DevMateKit?
DevMateKit is a core component for communication between your application and DevMate. It provides the following capabilities:
- Application launch tracking
- Activation and trial period management
- Crash and feedback reporting
- Updates management
You get application launch tracking out-of-the-box, but other features must be set up. Ensure your Xcode version is 4.0 or higher before you start integration and configuration process.
NOTE
If you are going to distribute your app on the Mac App Store, you'll have to disable DevMate's activation and update functionality. Follow the instructions below to configure DevMateKit correctly and make your app work properly within the Mac App Store environment.
Download DevMateKit
- Download a ZIP archive containing the latest version of the DevMateKit framework from either the Add Application wizard or GitHub.
- Extract
DevMateKit.framework
from the downloaded archive.
Installation from CocoaPods
You can integrate DevMateKit into your project using CocoaPods. Here is a podfile:
platform :osx, '10.7'
pod 'DevMateKit'
Add Framework to your project
- Open your application project in Xcode.
- Drop the DevMateKit folder to your project and apply the following settings in the dialogue that appears:
- Select the 'Copy items if needed' checkbox
- Choose the 'Create groups for any added folders' option
- Select the checkbox next to your project target in the 'Add to targets' list.
- Select your project in the Project Navigator and then select your application target.
- Go to the Build Phases tab.
- Copy DevMateKit.framework from the Project Navigator to the Link Binary With Libraries build phase list (if it isn't set).
- Choose Editor > Add Build Phase > Add Copy Files Build Phase.
- Disclose the Copy Files section and choose the Frameworks option from the Destination list.
- Copy DevMateKit.framework from the Project Navigator to the Copy Files section.
- Go to the Build Settings tab and switch to 'All' settings.
- Set the Runpath Search Paths value to the following string:
@executable_path/../Frameworks
- Set the Framework Search Paths value to the following string:
- If the DevMateKit folder is located in the project root folder:
"$(PROJECT_DIR)/DevMateKit/DevMateKit.framework/Frameworks"
- If the DevMateKit folder is located in other location:
"$(PROJECT_DIR)/<Path_to_DevMateKit_folder>/DevMateKit.framework/Frameworks"
- For the Swift project, create a bridging header and add its path to the Objective-C Bridging Header build setting of your target (if it isn't set).
NOTE
If you need examples, check the following links:
Test Integration
- Add the following string to the import section of your app's Objective-C delegate class file or to the special bridging header of your Swift target:
#import <DevMateKit/DevMateKit.h>
- Copy and paste the following code to the
applicationDidFinishLaunching
method of your application delegate class:
[DevMateKit sendTrackingReport:nil delegate:nil];
DevMateKit.sendTrackingReport(nil, delegate: nil)
Now, your application will send launch reports to DevMate so that you could start collecting your software usage statistics.
NOTE
If you need an example, check https://github.com/DevMate/DevMateKit/tree/master/Examples/TrackingExample.
Debug Logs Listening (optional)
DevMateKit has a lot of debug logs that can be helpful during the integration of DevMate's new features. You can turn them on by adding the DM_ENABLE_DEBUG_LOGGING_ALL
variable to your scheme (choose the Edit Scheme menu item).
Customization
DevMateKit sends application launch reports that contain information about the activation state provided by the DevMate activation system.
If you want to use your own activation system, initialize the DMTrackingReporter
object with infoProvider that conforms to the DMTrackingReporterInfoProvider
protocol.
@protocol DMTrackingReporterInfoProvider <NSObject>
@optional
- (NSUInteger)applicationLaunchCount:(DMTrackingReporter *)reporter;
- (BOOL)isApplicationFirstInstall:(DMTrackingReporter *)reporter;
- (DMAppActivationStatus)applicationActivationStatus:(DMTrackingReporter *)reporter;
- (DMAppTrialValue)applicationTrialValue:(DMTrackingReporter *)reporter;
@end
More information about parameters is available in <DevMateKit/DMTrackingBase.h>
.
Also, if you want to know whether the report was sent, you can provide a reporter delegate that must conform to the DMTrackingReporterDelegate
protocol:
@protocol DMTrackingReporterDelegate <NSObject>
@optional
- (void)trackingReporter:(DMTrackingReporter *)reporter didFinishSendingReportWithSuccess:(BOOL)success;
@end
DevMateKit for Mac App Store
If you want to distribute your app via Mac App Store, you must disable activations and updates via DevMateKit. However, you still can use DevMate for gathering app usage stats, collecting issue reports and feedback messages.
NOTE
This feature is supported for DevMateKit v.1.3 and above. If you are using an older version, you need to update it.
- Download a specific version of DevMateKit for MAS from GitHub (DevMateKit_MAS.zip)
- Follow the instructions above.
- Add new ‘Run Script’ phase and add there the following string:
"${PROJECT_DIR}/DevMateKit/update_reporter_id.sh"
The last step is necessary because DevMateKit contains the special application ‘Problem Reporter Sandboxed.app’ with its unique bundle ID. When you try to submit your app to Mac App Store, an error may occur, because the other app with DevMateKit is already published on MAS. The script changes the bundle ID of ‘Problem Reporter Sandboxed.app’ by appending your app’s name to the original ID like this: com.devmate.Problem-Reporter-Sandboxed.MyApp
and resigns all necessary components with your code sign identity.