diff --git a/Repro.embeddedframework/Repro.framework/Headers/Repro.h b/Repro.embeddedframework/Repro.framework/Headers/Repro.h index 67be1a2..46e15f3 100644 --- a/Repro.embeddedframework/Repro.framework/Headers/Repro.h +++ b/Repro.embeddedframework/Repro.framework/Headers/Repro.h @@ -29,6 +29,8 @@ typedef NS_ENUM(NSInteger, RPRLogLevel) { // User profile + (void)setUserID:(NSString *)userID; ++ (NSString *)getUserID; ++ (NSString *)getDeviceID; + (void)setUserProfile:(NSString *)value forKey:(NSString *)key; + (void)setUserProfile:(NSDictionary *)profile; @@ -49,7 +51,7 @@ typedef NS_ENUM(NSInteger, RPRLogLevel) { + (void)unmaskForKey:(NSString*)key; // Crash reporting -+ (void)enableCrashReporting; ++ (void)enableCrashReporting __attribute__ ((deprecated)); // Log + (void)setLogLevel:(RPRLogLevel)level; diff --git a/Repro.embeddedframework/Repro.framework/Info.plist b/Repro.embeddedframework/Repro.framework/Info.plist index 1085dd3..b1107fc 100644 Binary files a/Repro.embeddedframework/Repro.framework/Info.plist and b/Repro.embeddedframework/Repro.framework/Info.plist differ diff --git a/Repro.embeddedframework/Repro.framework/Repro b/Repro.embeddedframework/Repro.framework/Repro index 3ef45a4..0613004 100644 Binary files a/Repro.embeddedframework/Repro.framework/Repro and b/Repro.embeddedframework/Repro.framework/Repro differ diff --git a/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/Info.plist b/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/Info.plist index 298dd62..b04499d 100644 Binary files a/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/Info.plist and b/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/Info.plist differ diff --git a/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/repro.js b/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/repro.js deleted file mode 100644 index 6357f24..0000000 --- a/Repro.embeddedframework/Repro.framework/ReproSDKResources.bundle/repro.js +++ /dev/null @@ -1,166 +0,0 @@ -(function() { - var getAbsoluteOffsetFromBody, getOS, mask, prevSensitiveElementData, repro, sendMessageToSDK, sensitiveElements, timerForMasking, track, unmask, watch, scalesPageToFit, parseMetaContent; - - sensitiveElements = {}; - - prevSensitiveElementData = {}; - - timerForMasking = null; - - track = function(name, _props) { - var data; - if (typeof name !== 'string' || name === '' || ((typeof _props !== 'object') && _props !== undefined)) { - return; - } - if (_props === null || _props === undefined) { - _props = {}; - } - data = { - name: name, - properties: _props - }; - return sendMessageToSDK('repro://track?data=' + JSON.stringify(data)); - }; - - watch = function() { - var _e, _k, cur, data, offset, prev, fit; - if (Object.keys(sensitiveElements).length === 0) { - return; - } - data = []; - fit = scalesPageToFit(); - for (_k in sensitiveElements) { - _e = sensitiveElements[_k]; - offset = getAbsoluteOffsetFromBody(_e); - cur = { - x: offset.left, - y: offset.top, - w: _e.offsetWidth, - h: _e.offsetHeight, - key: _k, - ww: document.documentElement.clientWidth, - wh: document.documentElement.clientHeight, - fixed: (window.getComputedStyle(_e, null).position === "fixed"), - fit: fit - }; - prev = prevSensitiveElementData[_k]; - if (prev !== void 0 && prev !== null) { - if (cur.x === prev.x && cur.y === prev.y && cur.w === prev.w && cur.h === prev.h) { - continue; - } - } - data.push(cur); - prevSensitiveElementData[_k] = cur; - } - if (Object.keys(data).length > 0) { - return sendMessageToSDK('repro://mask?data=' + JSON.stringify(data)); - } - }; - - mask = function(key, el) { - if (timerForMasking === null) { - timerForMasking = setInterval(watch, 50); - } - if (typeof key !== 'string' || key === '' || el === null) { - return; - } - return sensitiveElements[key] = el; - }; - - unmask = function(key) { - var data; - if (typeof key !== 'string' || key === '') { - return; - } - delete sensitiveElements[key]; - delete prevSensitiveElementData[key]; - data = { - key: key - }; - return sendMessageToSDK('repro://unmask?data=' + JSON.stringify(data)); - }; - - getAbsoluteOffsetFromBody = function(el) { - var _x, _y; - _x = 0; - _y = 0; - while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) { - _x += el.offsetLeft + el.clientLeft; - _y += el.offsetTop + el.clientTop; - el = el.offsetParent; - } - return { - top: _y, - left: _x - }; - }; - - getOS = function() { - var userAgent; - userAgent = void 0; - userAgent = navigator.userAgent || navigator.vendor || window.opera; - if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i) || userAgent.match(/iPod/i)) { - return "iOS"; - } else if (userAgent.match(/Android/i)) { - return "Android"; - } else { - return "unknown"; - } - }; - - sendMessageToSDK = function(url) { - var bridge; - bridge = document.createElement('iframe'); - bridge.setAttribute('style', 'display:none;'); - bridge.setAttribute('height', '0px'); - bridge.setAttribute('width', '0px'); - bridge.setAttribute('frameborder', '0'); - bridge.setAttribute('id', 'repro-sdk-bridge'); - bridge.setAttribute('src', url); - document.documentElement.appendChild(bridge); - bridge.parentNode.removeChild(bridge); - return bridge = null; - }; - - scalesPageToFit = function() { - var metas, parsed; - metas = document.getElementsByTagName("meta"); - for (var i = 0; i < metas.length; i++) { - if (metas[i].name === "viewport") { - parsed = parseMetaContent(metas[i].content); - } - } - if (parsed['width'] === 'device-width' && - parsed['height'] === 'device-height' && - parsed['initial-scale'] === '1.0' && - parsed['maximum-scale'] === '1.0') { - return false; - } - return true; - } - - parseMetaContent = function(str) { - var contents, parsed; - if (typeof str !== 'string') { - return null; - } - contents = str.split(','); - parsed = {}; - for (var i = 0; i < contents.length; i++) { - var s = contents[i].trim().split("="); - if (s.length === 2) { - parsed[s[0]] = s[1]; - } - } - return parsed; - } - - repro = { - track: track, - mask: mask, - unmask: unmask - }; - - window.repro = repro; - -}).call(this); diff --git a/Repro.embeddedframework/Resources/ReproSDKResources.bundle/Info.plist b/Repro.embeddedframework/Resources/ReproSDKResources.bundle/Info.plist index 298dd62..b04499d 100644 Binary files a/Repro.embeddedframework/Resources/ReproSDKResources.bundle/Info.plist and b/Repro.embeddedframework/Resources/ReproSDKResources.bundle/Info.plist differ diff --git a/Repro.embeddedframework/Resources/ReproSDKResources.bundle/repro.js b/Repro.embeddedframework/Resources/ReproSDKResources.bundle/repro.js deleted file mode 100644 index 6357f24..0000000 --- a/Repro.embeddedframework/Resources/ReproSDKResources.bundle/repro.js +++ /dev/null @@ -1,166 +0,0 @@ -(function() { - var getAbsoluteOffsetFromBody, getOS, mask, prevSensitiveElementData, repro, sendMessageToSDK, sensitiveElements, timerForMasking, track, unmask, watch, scalesPageToFit, parseMetaContent; - - sensitiveElements = {}; - - prevSensitiveElementData = {}; - - timerForMasking = null; - - track = function(name, _props) { - var data; - if (typeof name !== 'string' || name === '' || ((typeof _props !== 'object') && _props !== undefined)) { - return; - } - if (_props === null || _props === undefined) { - _props = {}; - } - data = { - name: name, - properties: _props - }; - return sendMessageToSDK('repro://track?data=' + JSON.stringify(data)); - }; - - watch = function() { - var _e, _k, cur, data, offset, prev, fit; - if (Object.keys(sensitiveElements).length === 0) { - return; - } - data = []; - fit = scalesPageToFit(); - for (_k in sensitiveElements) { - _e = sensitiveElements[_k]; - offset = getAbsoluteOffsetFromBody(_e); - cur = { - x: offset.left, - y: offset.top, - w: _e.offsetWidth, - h: _e.offsetHeight, - key: _k, - ww: document.documentElement.clientWidth, - wh: document.documentElement.clientHeight, - fixed: (window.getComputedStyle(_e, null).position === "fixed"), - fit: fit - }; - prev = prevSensitiveElementData[_k]; - if (prev !== void 0 && prev !== null) { - if (cur.x === prev.x && cur.y === prev.y && cur.w === prev.w && cur.h === prev.h) { - continue; - } - } - data.push(cur); - prevSensitiveElementData[_k] = cur; - } - if (Object.keys(data).length > 0) { - return sendMessageToSDK('repro://mask?data=' + JSON.stringify(data)); - } - }; - - mask = function(key, el) { - if (timerForMasking === null) { - timerForMasking = setInterval(watch, 50); - } - if (typeof key !== 'string' || key === '' || el === null) { - return; - } - return sensitiveElements[key] = el; - }; - - unmask = function(key) { - var data; - if (typeof key !== 'string' || key === '') { - return; - } - delete sensitiveElements[key]; - delete prevSensitiveElementData[key]; - data = { - key: key - }; - return sendMessageToSDK('repro://unmask?data=' + JSON.stringify(data)); - }; - - getAbsoluteOffsetFromBody = function(el) { - var _x, _y; - _x = 0; - _y = 0; - while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) { - _x += el.offsetLeft + el.clientLeft; - _y += el.offsetTop + el.clientTop; - el = el.offsetParent; - } - return { - top: _y, - left: _x - }; - }; - - getOS = function() { - var userAgent; - userAgent = void 0; - userAgent = navigator.userAgent || navigator.vendor || window.opera; - if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i) || userAgent.match(/iPod/i)) { - return "iOS"; - } else if (userAgent.match(/Android/i)) { - return "Android"; - } else { - return "unknown"; - } - }; - - sendMessageToSDK = function(url) { - var bridge; - bridge = document.createElement('iframe'); - bridge.setAttribute('style', 'display:none;'); - bridge.setAttribute('height', '0px'); - bridge.setAttribute('width', '0px'); - bridge.setAttribute('frameborder', '0'); - bridge.setAttribute('id', 'repro-sdk-bridge'); - bridge.setAttribute('src', url); - document.documentElement.appendChild(bridge); - bridge.parentNode.removeChild(bridge); - return bridge = null; - }; - - scalesPageToFit = function() { - var metas, parsed; - metas = document.getElementsByTagName("meta"); - for (var i = 0; i < metas.length; i++) { - if (metas[i].name === "viewport") { - parsed = parseMetaContent(metas[i].content); - } - } - if (parsed['width'] === 'device-width' && - parsed['height'] === 'device-height' && - parsed['initial-scale'] === '1.0' && - parsed['maximum-scale'] === '1.0') { - return false; - } - return true; - } - - parseMetaContent = function(str) { - var contents, parsed; - if (typeof str !== 'string') { - return null; - } - contents = str.split(','); - parsed = {}; - for (var i = 0; i < contents.length; i++) { - var s = contents[i].trim().split("="); - if (s.length === 2) { - parsed[s[0]] = s[1]; - } - } - return parsed; - } - - repro = { - track: track, - mask: mask, - unmask: unmask - }; - - window.repro = repro; - -}).call(this); diff --git a/cpp/ReproCpp.h b/cpp/ReproCpp.h index c07fcee..1322ee0 100644 --- a/cpp/ReproCpp.h +++ b/cpp/ReproCpp.h @@ -43,9 +43,6 @@ class ReproCpp { static void track(const char*eventName); static void trackWithProperties(const char* eventName, const char* jsonDictionary); - // Crash Reporting - static void enableCrashReporting(); - // In App Message static void disableInAppMessageOnActive(); static void showInAppMessage(); diff --git a/cpp/ReproCpp.mm b/cpp/ReproCpp.mm index 8b60375..9d42011 100644 --- a/cpp/ReproCpp.mm +++ b/cpp/ReproCpp.mm @@ -95,10 +95,6 @@ [Repro track:convertCStringToNSString(eventName) properties:convertCStringJSONToNSDictionary(jsonDictionary)]; } -void ReproCpp::enableCrashReporting() { - [Repro enableCrashReporting]; -} - // In App Message void ReproCpp::disableInAppMessageOnActive() { [Repro disableInAppMessageOnActive];