├── src └── ios │ ├── Appsee.framework │ └── Versions │ │ └── A │ │ ├── Appsee │ │ └── Headers │ │ └── Appsee.h │ ├── CDVAppsee.h │ └── CDVAppsee.m ├── README.md ├── plugin.xml └── www └── Appsee.js /src/ios/Appsee.framework/Versions/A/Appsee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/poetic/cordova-appsee/master/src/ios/Appsee.framework/Versions/A/Appsee -------------------------------------------------------------------------------- /src/ios/CDVAppsee.h: -------------------------------------------------------------------------------- 1 | // 2 | // CDVAppsee.h 3 | // 4 | // Copyright (c) 2014 Shift 6 LTD. All rights reserved. 5 | 6 | #import 7 | 8 | @interface CDVAppsee : CDVPlugin 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cordova-appsee 2 | ============== 3 | 4 | Cordova plugin for Appsee Analytics. 5 | 6 | credits 7 | ======= 8 | 9 | Thanks to Yoni Douek from [Appsee](http://www.appsee.com/) for writing the plugin. 10 | 11 | about 12 | ===== 13 | 14 | - When using Cordova 3.+ you can fetch the plugin from the Cordova plugin registry with: `cordova plugin add com.appsee.plugin`. 15 | - This repository was made so a third party service such as [Appgyver Steroids](http://www.appgyver.com/steroids/) can use the plugin. (Steroids needs a repo for the plugin in order to use it.) 16 | -------------------------------------------------------------------------------- /plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | Appsee 5 | Appsee Mobile Analytics 6 | Commercial 7 | analytics,appsee 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/ios/CDVAppsee.m: -------------------------------------------------------------------------------- 1 | // 2 | // CDVAppsee.m 3 | // 4 | // Copyright (c) 2014 Shift 6 LTD. All rights reserved. 5 | // 6 | 7 | #import "CDVAppsee.h" 8 | #import "Appsee.h" 9 | #import 10 | 11 | @implementation CDVAppsee 12 | 13 | -(void)start:(CDVInvokedUrlCommand *)command 14 | { 15 | NSString *key = [command.arguments objectAtIndex:0]; 16 | 17 | [Appsee start:key]; 18 | [Appsee setDebugToNSLog:YES]; 19 | } 20 | 21 | -(void)stop:(CDVInvokedUrlCommand *)command 22 | { 23 | [Appsee stop]; 24 | } 25 | 26 | -(void)stopAndUpload:(CDVInvokedUrlCommand *)command 27 | { 28 | [Appsee stopAndUpload]; 29 | } 30 | 31 | -(void)pause:(CDVInvokedUrlCommand *)command 32 | { 33 | [Appsee pause]; 34 | } 35 | 36 | -(void)resume:(CDVInvokedUrlCommand *)command 37 | { 38 | [Appsee resume]; 39 | } 40 | 41 | -(void)addEvent:(CDVInvokedUrlCommand *)command 42 | { 43 | NSString *eventName = [command.arguments objectAtIndex:0]; 44 | 45 | [Appsee addEvent:eventName]; 46 | } 47 | 48 | -(void)addEventWithProperties:(CDVInvokedUrlCommand *)command 49 | { 50 | NSString *eventName = [command.arguments objectAtIndex:0]; 51 | NSDictionary *props = [command.arguments objectAtIndex:1]; 52 | 53 | [Appsee addEvent:eventName withProperties:props]; 54 | } 55 | 56 | -(void)startScreen:(CDVInvokedUrlCommand *)command 57 | { 58 | NSString *screenName = [command.arguments objectAtIndex:0]; 59 | 60 | [Appsee startScreen:screenName]; 61 | } 62 | 63 | -(void)setUserId:(CDVInvokedUrlCommand *)command 64 | { 65 | NSString *userId = [command.arguments objectAtIndex:0]; 66 | 67 | [Appsee setUserID:userId]; 68 | } 69 | 70 | -(void)setLocation:(CDVInvokedUrlCommand *)command 71 | { 72 | double lat = [[command.arguments objectAtIndex:0]doubleValue]; 73 | double lng = [[command.arguments objectAtIndex:1]doubleValue]; 74 | float hAcc = [[command.arguments objectAtIndex:2]floatValue]; 75 | float vAcc = [[command.arguments objectAtIndex:3]floatValue]; 76 | 77 | [Appsee setLocation:lat longitude:lng horizontalAccuracy:hAcc verticalAccuracy:vAcc]; 78 | } 79 | -(void)setLocationDescription:(CDVInvokedUrlCommand *)command 80 | { 81 | NSString *desc = [command.arguments objectAtIndex:0]; 82 | 83 | [Appsee setLocationDescription:desc]; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /www/Appsee.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Appsee.js 3 | * 4 | * Cordova Appsee plugin. 5 | * 6 | * Author: Yoni Douek 7 | */ 8 | 9 | var exec = require('cordova/exec'); 10 | 11 | var Appsee = function() {}; 12 | 13 | Appsee.start = function(key, successCallback, errorCallback) 14 | { 15 | return exec(successCallback, errorCallback, "Appsee", "start", [key]); 16 | }; 17 | 18 | Appsee.stop = function(successCallback, errorCallback) 19 | { 20 | return exec(successCallback, errorCallback, "Appsee", "stop", []); 21 | }; 22 | 23 | Appsee.stopAndUpload = function(successCallback, errorCallback) 24 | { 25 | return exec(successCallback, errorCallback, "Appsee", "stopAndUpload", []); 26 | }; 27 | 28 | Appsee.pause = function(successCallback, errorCallback) 29 | { 30 | return exec(successCallback, errorCallback, "Appsee", "pause", []); 31 | }; 32 | 33 | Appsee.resume = function(successCallback, errorCallback) 34 | { 35 | return exec(successCallback, errorCallback, "Appsee", "resume", []); 36 | }; 37 | 38 | Appsee.addEvent = function(eventName, successCallback, errorCallback) 39 | { 40 | return exec(successCallback, errorCallback, "Appsee", "addEvent", [eventName]); 41 | }; 42 | 43 | // Properties should be json: { id:"123", price: 200, location: "Jeruslem"} 44 | Appsee.addEventWithProperties = function(eventName, properties, successCallback, errorCallback) 45 | { 46 | return exec(successCallback, errorCallback, "Appsee", "addEventWithProperties", [eventName, properties]); 47 | }; 48 | 49 | Appsee.startScreen = function(screenName, successCallback, errorCallback) 50 | { 51 | return exec(successCallback, errorCallback, "Appsee", "startScreen", [screenName]); 52 | }; 53 | 54 | Appsee.setUserId = function(userId, successCallback, errorCallback) 55 | { 56 | return exec(successCallback, errorCallback, "Appsee", "setUserId", [userId]); 57 | }; 58 | 59 | Appsee.setLocation = function(latitude, longitude, horizontalAccuracy, verticalAccuracy, successCallback, errorCallback) 60 | { 61 | return exec(successCallback, errorCallback, "Appsee", "setLocation", [latitude, longitude, horizontalAccuracy, verticalAccuracy]); 62 | }; 63 | 64 | Appsee.setLocationDescription = function(locationDescription, successCallback, errorCallback) 65 | { 66 | return exec(successCallback, errorCallback, "Appsee", "setLocationDescription", [locationDescription]); 67 | }; 68 | 69 | 70 | module.exports = Appsee; 71 | -------------------------------------------------------------------------------- /src/ios/Appsee.framework/Versions/A/Headers/Appsee.h: -------------------------------------------------------------------------------- 1 | // 2 | // Appsee.h 3 | // Appsee 4 | // 5 | // Copyright (c) 2014 Shift 6 Ltd. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | /******************************************************************************************** 12 | Appsee SDK. 13 | To use, simply call 'start:' in your 'applicationDidFinishLaunching:withOptions:' method. 14 | *******************************************************************************************/ 15 | 16 | @interface Appsee: NSObject 17 | 18 | /*************** 19 | General Control 20 | **************/ 21 | 22 | /** Starts recording screen and user gestures. This method should only be called once. 23 | Recording will stop (and video will be uploaded) when app is in the background. 24 | A new session will start when the app is returned from background. 25 | @param apiKey The application-specific API key from (available in your Appsee dashboard). 26 | */ 27 | +(void)start:(NSString*) apiKey; 28 | 29 | /** Stops the current session. Usually, this method shouldn't be called unless you explictly want to stop recording. 30 | */ 31 | +(void)stop; 32 | 33 | /** Stops the current session and uploads it immediately (in the background). Usually, this method shouldn't be called unless you explictly want 34 | to stop recording and force uploading at some point in your app, before the user minimizes it. 35 | */ 36 | +(void)stopAndUpload; 37 | 38 | /** Pause recording of the video. To resume, call 'resume'. 39 | */ 40 | +(void)pause; 41 | 42 | /** Resume recording of the video. 43 | */ 44 | +(void)resume; 45 | 46 | /** Enable Appsee event-logging to NSLog. 47 | @param log YES to turn on debug logging, NO to turn them off. 48 | */ 49 | +(void)setDebugToNSLog:(BOOL)log; 50 | 51 | /**************************** 52 | Application Events & Screens 53 | ***************************/ 54 | 55 | /** Add a timed application event (such as: user reached a specific level or screen). 56 | @param eventName The name of the event (ie: "WelcomeScreen"). 57 | */ 58 | +(void)addEvent:(NSString*)eventName; 59 | 60 | /** Add a timed application event (such as: user reached a specific level or screen) along with custom properties. 61 | @param eventName The name of the event (ie: "Level"). 62 | @param properties Key-value pairs with custom properties for the event. Properties must be NSNumbers, NSStrings, NSDates, NSURL, or NSNull. Keys must be NSStrings. 63 | */ 64 | +(void)addEvent:(NSString*)eventName withProperties:(NSDictionary *)properties; 65 | 66 | /** Mark the appearance starting time of a screen. 67 | This method should be usually called from the viewDidAppear: method. 68 | @param screenName The name of the screen (ie: "WelcomeScreen"). 69 | */ 70 | +(void)startScreen:(NSString*)screenName; 71 | 72 | /** Overlay an image on top of the next video frame. 73 | @param image The image to overlay. Can be 'nil' to stop overlaying any image. 74 | @param rect The image's location in the screen. 75 | */ 76 | +(void)overlayImage:(UIImage*)image inRect:(CGRect)rect; 77 | 78 | /************************ 79 | Setting User Information 80 | ************************/ 81 | 82 | /** Set the app's user ID. 83 | @param userID The application-specific user identifier. 84 | */ 85 | +(void)setUserID:(NSString*)userID; 86 | 87 | /** Set the user's location. 88 | @param latitude Latitude. 89 | @param longitude Longitude. 90 | @param horizontalAccuracy Horizontal Accuracy. 91 | @param verticalAccuracy Vertical Accuracy. 92 | */ 93 | +(void)setLocation:(double)latitude longitude:(double)longitude horizontalAccuracy:(float)horizontalAccuracy verticalAccuracy:(float)verticalAccuracy; 94 | 95 | /** Set the user's location. 96 | @param description The location's description. 97 | */ 98 | +(void)setLocationDescription:(NSString*)description; 99 | 100 | /**************** 101 | Privacy Control 102 | ****************/ 103 | 104 | /** Mark a view as sensitive, to ensure it is not displayed in videos. 105 | * Note that password fields are marked as sensitive by default. 106 | @param view A UIView that contains sensitive information. 107 | */ 108 | +(void)markViewAsSensitive:(UIView*)view; 109 | 110 | /** Unmark a view as sensitive, so it will be displayed in videos. 111 | @param view A UIView that no longer contains sensitive information. 112 | */ 113 | +(void)unmarkViewAsSensitive:(UIView*)view; 114 | 115 | /****** 116 | OpenGL 117 | ******/ 118 | 119 | /** Mark the starting of the render loop. This method is optional and should be called only if calling appendGLFrame: alone results in empty videos. 120 | This should be called right after binding a render buffer, and before drawing object onto it. After drawing the objects, call presentRenderBuffer:. 121 | */ 122 | +(void)startRenderLoop; 123 | 124 | /** Append the GL render buffer to the video. Should be called right before calling 'presentRenderbuffer:'. 125 | If you have more than one render buffer, bind it first using glBindRenderbufferOES. 126 | @param glView The GL view. 127 | @param includeUIKit Whether to include UIKit elements to the video, on top of the OpenGL elements. Default = YES. 128 | */ 129 | +(void)appendGLFrame:(UIView*)glView; 130 | +(void)appendGLFrame:(UIView*)glView includeUIKitElements:(BOOL)includeUIKit; 131 | 132 | 133 | @end 134 | --------------------------------------------------------------------------------