Working iOS example
This commit is contained in:
parent
c9410286d9
commit
ce470454cd
3
example/.eslintignore
Normal file
3
example/.eslintignore
Normal file
@ -0,0 +1,3 @@
|
||||
android/
|
||||
ios/
|
||||
node_modules/
|
5
example/.eslintrc.json
Normal file
5
example/.eslintrc.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"globals": {
|
||||
"appNavigator": false
|
||||
}
|
||||
}
|
5
example/__tests__/.eslintrc
Normal file
5
example/__tests__/.eslintrc
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ import Index from '../index.android.js';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(
|
||||
<Index />
|
||||
);
|
||||
renderer.create(
|
||||
<Index/>
|
||||
);
|
||||
});
|
||||
|
@ -6,7 +6,7 @@ import Index from '../index.ios.js';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(
|
||||
<Index />
|
||||
);
|
||||
renderer.create(
|
||||
<Index/>
|
||||
);
|
||||
});
|
||||
|
@ -1,56 +1,16 @@
|
||||
/**
|
||||
* Sample React Native App
|
||||
* https://github.com/facebook/react-native
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
AppRegistry,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
AppRegistry,
|
||||
} from 'react-native';
|
||||
|
||||
import Navigation from './Navigation';
|
||||
import Navigation from './src/Navigation';
|
||||
|
||||
export default class RNAppMetrika extends Component {
|
||||
render() {
|
||||
return <Navigation/>;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>
|
||||
Welcome to React Native! 111
|
||||
</Text>
|
||||
<Text style={styles.instructions}>
|
||||
To get started, edit index.android.js
|
||||
</Text>
|
||||
<Text style={styles.instructions}>
|
||||
Double tap R on your keyboard to reload,{'\n'}
|
||||
Shake or press menu button for dev menu
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
export default class RNAppMetrika extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<Navigation/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
});
|
||||
|
||||
AppRegistry.registerComponent('RNAppMetrika', () => RNAppMetrika);
|
||||
|
@ -1,53 +1,17 @@
|
||||
/**
|
||||
* Sample React Native App
|
||||
* https://github.com/facebook/react-native
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
AppRegistry,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
AppRegistry,
|
||||
} from 'react-native';
|
||||
|
||||
export default class RNAppMetrika extends Component {
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>
|
||||
Welcome to React Native!
|
||||
</Text>
|
||||
<Text style={styles.instructions}>
|
||||
To get started, edit index.ios.js
|
||||
</Text>
|
||||
<Text style={styles.instructions}>
|
||||
Press Cmd+R to reload,{'\n'}
|
||||
Cmd+D or shake for dev menu
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
import Navigation from './src/Navigation';
|
||||
import './src/appmetrica';
|
||||
|
||||
export default class RNAppMetrika extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<Navigation/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
});
|
||||
|
||||
AppRegistry.registerComponent('RNAppMetrika', () => RNAppMetrika);
|
||||
|
@ -5,6 +5,7 @@
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
|
||||
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
|
||||
@ -24,15 +25,29 @@
|
||||
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */; };
|
||||
2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
||||
2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */; };
|
||||
2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */; };
|
||||
2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */; };
|
||||
2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */; };
|
||||
2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };
|
||||
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
|
||||
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
|
||||
2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */; };
|
||||
2DCD954D1E0B4F2C00145EB5 /* RNAppMetrikaTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* RNAppMetrikaTests.m */; };
|
||||
594077BF1F7FBBC300032B32 /* libRCTAppMetrica.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077A11F7FB81700032B32 /* libRCTAppMetrica.a */; };
|
||||
594077C21F7FBC4C00032B32 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077C11F7FBC4C00032B32 /* SystemConfiguration.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077C41F7FBC5800032B32 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077C31F7FBC5800032B32 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077C61F7FBC6100032B32 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077C51F7FBC6000032B32 /* Foundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077C81F7FBC6900032B32 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077C71F7FBC6900032B32 /* CoreTelephony.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077CA1F7FBC8A00032B32 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077C91F7FBC8A00032B32 /* CoreLocation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077CC1F7FBC9000032B32 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077CB1F7FBC9000032B32 /* CoreGraphics.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077CE1F7FBC9800032B32 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077CD1F7FBC9700032B32 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D01F7FBCAE00032B32 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077CF1F7FBCAE00032B32 /* libz.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D21F7FBCBA00032B32 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077D11F7FBCB900032B32 /* libsqlite3.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D41F7FBCC300032B32 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077D31F7FBCC300032B32 /* Security.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D61F7FBCCD00032B32 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077D51F7FBCCD00032B32 /* libc++.tbd */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D81F7FBCD600032B32 /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077D71F7FBCD500032B32 /* SafariServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
594077D91F7FBD1D00032B32 /* YandexMobileMetrica.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 594077A31F7FB89A00032B32 /* YandexMobileMetrica.framework */; };
|
||||
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
|
||||
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
|
||||
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
|
||||
@ -200,6 +215,20 @@
|
||||
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
|
||||
remoteInfo = "jschelpers-tvOS";
|
||||
};
|
||||
5940778D1F7FB81700032B32 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = ADD01A681E09402E00F6D226;
|
||||
remoteInfo = "RCTBlob-tvOS";
|
||||
};
|
||||
594077A01F7FB81700032B32 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = E4F8D4F4AABD4D1294D3E542 /* RCTAppMetrica.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 59FB35C21F6FA64700A6608F;
|
||||
remoteInfo = RCTAppMetrica;
|
||||
};
|
||||
5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
|
||||
@ -259,10 +288,25 @@
|
||||
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
|
||||
2D02E47B1E0B4A5D006451C7 /* RNAppMetrika-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RNAppMetrika-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2D02E4901E0B4A5D006451C7 /* RNAppMetrika-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RNAppMetrika-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
594077A31F7FB89A00032B32 /* YandexMobileMetrica.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = YandexMobileMetrica.framework; sourceTree = SOURCE_ROOT; };
|
||||
594077C11F7FBC4C00032B32 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||
594077C31F7FBC5800032B32 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
594077C51F7FBC6000032B32 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
594077C71F7FBC6900032B32 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
|
||||
594077C91F7FBC8A00032B32 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
594077CB1F7FBC9000032B32 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
594077CD1F7FBC9700032B32 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
|
||||
594077CF1F7FBCAE00032B32 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
|
||||
594077D11F7FBCB900032B32 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
|
||||
594077D31F7FBCC300032B32 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
|
||||
594077D51F7FBCCD00032B32 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
||||
594077D71F7FBCD500032B32 /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; };
|
||||
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
|
||||
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
|
||||
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
|
||||
9B04986D6A1F416392D1AA68 /* libRCTAppMetrica.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTAppMetrica.a; sourceTree = "<group>"; };
|
||||
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
|
||||
E4F8D4F4AABD4D1294D3E542 /* RCTAppMetrica.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTAppMetrica.xcodeproj; path = "../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica.xcodeproj"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -278,6 +322,20 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
594077D81F7FBCD600032B32 /* SafariServices.framework in Frameworks */,
|
||||
594077D61F7FBCCD00032B32 /* libc++.tbd in Frameworks */,
|
||||
594077D41F7FBCC300032B32 /* Security.framework in Frameworks */,
|
||||
594077D21F7FBCBA00032B32 /* libsqlite3.tbd in Frameworks */,
|
||||
594077D01F7FBCAE00032B32 /* libz.tbd in Frameworks */,
|
||||
594077CE1F7FBC9800032B32 /* AdSupport.framework in Frameworks */,
|
||||
594077CC1F7FBC9000032B32 /* CoreGraphics.framework in Frameworks */,
|
||||
594077CA1F7FBC8A00032B32 /* CoreLocation.framework in Frameworks */,
|
||||
594077C81F7FBC6900032B32 /* CoreTelephony.framework in Frameworks */,
|
||||
594077C61F7FBC6100032B32 /* Foundation.framework in Frameworks */,
|
||||
594077C41F7FBC5800032B32 /* UIKit.framework in Frameworks */,
|
||||
594077C21F7FBC4C00032B32 /* SystemConfiguration.framework in Frameworks */,
|
||||
594077D91F7FBD1D00032B32 /* YandexMobileMetrica.framework in Frameworks */,
|
||||
594077BF1F7FBBC300032B32 /* libRCTAppMetrica.a in Frameworks */,
|
||||
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */,
|
||||
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */,
|
||||
146834051AC3E58100842450 /* libReact.a in Frameworks */,
|
||||
@ -298,8 +356,8 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D02E4C91E0B4AEC006451C7 /* libReact.a in Frameworks */,
|
||||
2D02E4C21E0B4AEC006451C7 /* libRCTAnimation-tvOS.a in Frameworks */,
|
||||
2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */,
|
||||
2D02E4C21E0B4AEC006451C7 /* libRCTAnimation.a in Frameworks */,
|
||||
2D02E4C31E0B4AEC006451C7 /* libRCTImage-tvOS.a in Frameworks */,
|
||||
2D02E4C41E0B4AEC006451C7 /* libRCTLinking-tvOS.a in Frameworks */,
|
||||
2D02E4C51E0B4AEC006451C7 /* libRCTNetwork-tvOS.a in Frameworks */,
|
||||
@ -414,7 +472,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
146834041AC3E56700842450 /* libReact.a */,
|
||||
3DAD3EA31DF850E9000B6D8A /* libReact.a */,
|
||||
3DAD3EA51DF850E9000B6D8A /* libyoga.a */,
|
||||
3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
|
||||
3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
|
||||
@ -426,11 +483,47 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
594077871F7FB81300032B32 /* Recovered References */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9B04986D6A1F416392D1AA68 /* libRCTAppMetrica.a */,
|
||||
);
|
||||
name = "Recovered References";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5940779D1F7FB81700032B32 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
594077A11F7FB81700032B32 /* libRCTAppMetrica.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
594077A21F7FB87E00032B32 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
594077D71F7FBCD500032B32 /* SafariServices.framework */,
|
||||
594077D51F7FBCCD00032B32 /* libc++.tbd */,
|
||||
594077D31F7FBCC300032B32 /* Security.framework */,
|
||||
594077D11F7FBCB900032B32 /* libsqlite3.tbd */,
|
||||
594077CF1F7FBCAE00032B32 /* libz.tbd */,
|
||||
594077CD1F7FBC9700032B32 /* AdSupport.framework */,
|
||||
594077CB1F7FBC9000032B32 /* CoreGraphics.framework */,
|
||||
594077C91F7FBC8A00032B32 /* CoreLocation.framework */,
|
||||
594077C71F7FBC6900032B32 /* CoreTelephony.framework */,
|
||||
594077C51F7FBC6000032B32 /* Foundation.framework */,
|
||||
594077C31F7FBC5800032B32 /* UIKit.framework */,
|
||||
594077C11F7FBC4C00032B32 /* SystemConfiguration.framework */,
|
||||
594077A31F7FB89A00032B32 /* YandexMobileMetrica.framework */,
|
||||
);
|
||||
path = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E91572E1DD0AC6500FF2AA8 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */,
|
||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */,
|
||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -459,6 +552,7 @@
|
||||
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
|
||||
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
|
||||
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
|
||||
E4F8D4F4AABD4D1294D3E542 /* RCTAppMetrica.xcodeproj */,
|
||||
);
|
||||
name = Libraries;
|
||||
sourceTree = "<group>";
|
||||
@ -475,10 +569,12 @@
|
||||
83CBB9F61A601CBA00E9B192 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
594077A21F7FB87E00032B32 /* Frameworks */,
|
||||
13B07FAE1A68108700A75B9A /* RNAppMetrika */,
|
||||
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
||||
00E356EF1AD99517003FC87E /* RNAppMetrikaTests */,
|
||||
83CBBA001A601CBA00E9B192 /* Products */,
|
||||
594077871F7FB81300032B32 /* Recovered References */,
|
||||
);
|
||||
indentWidth = 2;
|
||||
sourceTree = "<group>";
|
||||
@ -500,6 +596,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */,
|
||||
5940778E1F7FB81700032B32 /* libRCTBlob-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -623,6 +720,10 @@
|
||||
ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */;
|
||||
ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = 5940779D1F7FB81700032B32 /* Products */;
|
||||
ProjectRef = E4F8D4F4AABD4D1294D3E542 /* RCTAppMetrica.xcodeproj */;
|
||||
},
|
||||
{
|
||||
ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */;
|
||||
ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
|
||||
@ -822,6 +923,20 @@
|
||||
remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5940778E1F7FB81700032B32 /* libRCTBlob-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTBlob-tvOS.a";
|
||||
remoteRef = 5940778D1F7FB81700032B32 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
594077A11F7FB81700032B32 /* libRCTAppMetrica.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = libRCTAppMetrica.a;
|
||||
remoteRef = 594077A01F7FB81700032B32 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@ -829,10 +944,10 @@
|
||||
remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = {
|
||||
5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTAnimation-tvOS.a";
|
||||
path = libRCTAnimation.a;
|
||||
remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
@ -995,21 +1110,23 @@
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = RNAppMetrikaTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNAppMetrika.app/RNAppMetrika";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -1018,21 +1135,23 @@
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = RNAppMetrikaTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
);
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNAppMetrika.app/RNAppMetrika";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@ -1042,7 +1161,13 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = RNAppMetrika/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
@ -1051,9 +1176,6 @@
|
||||
);
|
||||
PRODUCT_NAME = RNAppMetrika;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -1062,7 +1184,13 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = RNAppMetrika/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
@ -1071,9 +1199,6 @@
|
||||
);
|
||||
PRODUCT_NAME = RNAppMetrika;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@ -1089,8 +1214,16 @@
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = "RNAppMetrika-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
@ -1100,12 +1233,6 @@
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -1121,8 +1248,16 @@
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(SRCROOT)/../node_modules/react-native-appmetrica/ios/RCTAppMetrica/RCTAppMetrica",
|
||||
);
|
||||
INFOPLIST_FILE = "RNAppMetrika-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
OTHER_LDFLAGS = (
|
||||
"-ObjC",
|
||||
"-lc++",
|
||||
@ -1132,12 +1267,6 @@
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@ -1154,14 +1283,15 @@
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "RNAppMetrika-tvOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNAppMetrika-tvOSTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNAppMetrika-tvOS.app/RNAppMetrika-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 10.1;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@ -1178,14 +1308,15 @@
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "RNAppMetrika-tvOSTests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/$(TARGET_NAME)\"",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNAppMetrika-tvOSTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNAppMetrika-tvOS.app/RNAppMetrika-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 10.1;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
@ -24,24 +24,7 @@
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
|
||||
<dict>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
@ -52,5 +35,19 @@
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string></string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* YMMVersion.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#ifndef __YMM_VERSION_H__
|
||||
#define __YMM_VERSION_H__
|
||||
|
||||
#define YMM_VERSION_MAJOR 2
|
||||
#define YMM_VERSION_MINOR 9
|
||||
#define YMM_VERSION_PATCH 1
|
||||
|
||||
#define YMM_BUILD_NUMBER 8517
|
||||
|
||||
#endif // __YMM_VERSION_H__
|
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* YMMYandexMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaConfiguration;
|
||||
@protocol YMMYandexMetricaReporting;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const kYMMYandexMetricaErrorDomain;
|
||||
|
||||
typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
|
||||
YMMYandexMetricaEventErrorCodeInitializationError = 1000,
|
||||
YMMYandexMetricaEventErrorCodeInvalidName = 1001,
|
||||
YMMYandexMetricaEventErrorCodeJsonSerializationError = 1002,
|
||||
};
|
||||
|
||||
@interface YMMYandexMetrica : NSObject
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithApiKey:(NSString *)apiKey;
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param configuration Configuration combines all AppMetrica settings in one place.
|
||||
Configuration initialized with unique application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithConfiguration:(YMMYandexMetricaConfiguration *)configuration;
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that should be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param message Short name or description of the error
|
||||
@param exception Exception contains an NSException object that must be passed to the server. It can take the nil value.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportError:(NSString *)message
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
@param enabled Flag indicating if reporting location to AppMetrica enabled
|
||||
Enabled by default.
|
||||
*/
|
||||
+ (void)setTrackLocationEnabled:(BOOL)enabled;
|
||||
|
||||
/** Set location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
@param location Custom device location to be reported.
|
||||
*/
|
||||
+ (void)setLocation:(nullable CLLocation *)location;
|
||||
|
||||
/** Setting session timeout (in seconds).
|
||||
|
||||
@param sessionTimeoutSeconds Time limit before the application is considered inactive.
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
*/
|
||||
+ (void)setSessionTimeout:(NSUInteger)sessionTimeoutSeconds;
|
||||
|
||||
/** Tracking app crashes.
|
||||
|
||||
@param enabled Boolean value to enable or disable collecting and sending crash reports.
|
||||
By default, reports on application crashes are sent, meaning enabled=true.
|
||||
To disable crash tracking, set the parameter value to enabled=false.
|
||||
*/
|
||||
+ (void)setReportCrashesEnabled:(BOOL)enabled;
|
||||
|
||||
/** Setting the arbitrary application version.
|
||||
|
||||
@param appVersion Application version to be reported.
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
+ (void)setCustomAppVersion:(NSString *)appVersion;
|
||||
|
||||
/** Enable or disable logging.
|
||||
|
||||
@param isEnabled Boolean value to enable or disable logging. By default logging is disabled.
|
||||
*/
|
||||
+ (void)setLoggingEnabled:(BOOL)isEnabled;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with future unhandled exception.
|
||||
If value is nil, previously set key-value is removed. Does nothing if key hasn't been added.
|
||||
|
||||
@param value The error environment value.
|
||||
@param key The error environment key.
|
||||
*/
|
||||
+ (void)setEnvironmentValue:(nullable NSString *)value forKey:(NSString *)key;
|
||||
|
||||
/** Retrieves current version of library.
|
||||
*/
|
||||
+ (NSString *)libraryVersion;
|
||||
|
||||
/** Enables AppMetrica's tracking mechanism by providing application's url scheme.
|
||||
|
||||
@param urlScheme Application's deep link scheme. Scheme should be registered in CFBundleURLTypes Info.plist section.
|
||||
*/
|
||||
+ (BOOL)enableTrackingWithURLScheme:(NSURL *)urlScheme NS_EXTENSION_UNAVAILABLE_IOS("") NS_AVAILABLE_IOS(9_0);
|
||||
|
||||
/** Handles the URL that has opened the application.
|
||||
Reports the URL for deep links tracking.
|
||||
URL scheme should be registered beforehand via `enableTrackingWithUrlScheme:` method for tracking to work correctly.
|
||||
|
||||
@param url URL that has opened the application.
|
||||
*/
|
||||
+ (BOOL)handleOpenURL:(NSURL *)url;
|
||||
|
||||
/** Returns id<YMMYandexMetricaReporting> that can send events to specific API key.
|
||||
|
||||
@param apiKey Api key to send events to.
|
||||
@return id<YMMYandexMetricaReporting> that conforms to YMMYandexMetricaReporting and handles
|
||||
sending events to specified apikey
|
||||
*/
|
||||
+ (nullable id<YMMYandexMetricaReporting>)reporterForApiKey:(NSString *)apiKey;
|
||||
|
||||
/**
|
||||
* Sets referral URL for this installation. This might be required to track some specific traffic sources like Facebook.
|
||||
* @param url referral URL value.
|
||||
*/
|
||||
+ (void)reportReferralUrl:(NSURL *)url;
|
||||
|
||||
@end
|
||||
|
||||
@interface YMMYandexMetrica (YMMYandexMetricaDeprecatedOrUnavailable)
|
||||
|
||||
+ (void)startWithAPIKey:(NSString *)apiKey
|
||||
__attribute__((unavailable("WARNING: apiKey used in startWithAPIKey isn't compatible with activateWithApiKey:. "
|
||||
"Use activateWithApiKey: with updated key. More info in activateWithApiKey:'s description")));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* YMMYandexMetricaConfiguration.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaPreloadInfo;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaConfiguration : NSObject
|
||||
|
||||
/** Initialize configuration with specified Application key.
|
||||
For invalid Application initialization returns nil in release and raises an exception in debug.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
- (nullable instancetype)initWithApiKey:(NSString *)apiKey;
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithApiKey: must be used instead.")));
|
||||
|
||||
/** Get Application key used to initialize the configuration.
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *apiKey;
|
||||
|
||||
/** Whether first activation of AppMetrica should be considered as app update or new app install.
|
||||
If this option is enabled the first call of +[YMMYandexMetrica activateWithApiKey:] or
|
||||
+[YMMYandexMetrica activateWithConfiguration:] will be considered as an application update.
|
||||
|
||||
By default this option is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL handleFirstActivationAsUpdateEnabled;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
Enabled by default.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL trackLocationEnabled;
|
||||
|
||||
/** Set/get location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
By default is nil
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) CLLocation *location;
|
||||
|
||||
/** Set/get session timeout (in seconds).
|
||||
Time limit before the application is considered inactive.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger sessionTimeout;
|
||||
|
||||
/** Enable/disable tracking app crashes.
|
||||
|
||||
Enabled by default.
|
||||
To disable crash tracking, set the parameter value to false.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL reportCrashesEnabled;
|
||||
|
||||
/** Set/get the arbitrary application version for AppMetrica to report.
|
||||
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *customAppVersion;
|
||||
|
||||
/** Enable/disable logging.
|
||||
|
||||
By default logging is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL loggingEnabled;
|
||||
|
||||
/** Set/get preload info, which is used for tracking preload installs.
|
||||
Additional info could be https://appmetrica.yandex.com
|
||||
|
||||
By default is nil.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) YMMYandexMetricaPreloadInfo *preloadInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* YMMYandexMetricaPreloadInfo.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaPreloadInfo : NSObject <NSCopying>
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithTrackingIdentifier: must be used instead.")));
|
||||
|
||||
/** Initialize Preload info with specific publisher and tracking identifiers.
|
||||
If case of invalid identifiers constructor returns nil in release and raises an exception in debug
|
||||
|
||||
@param trackingID Tracking identifier
|
||||
*/
|
||||
- (nullable instancetype)initWithTrackingIdentifier:(NSString *)trackingID;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with preload info.
|
||||
|
||||
@param info Additional preload info.
|
||||
@param key Additional preload key.
|
||||
*/
|
||||
- (void)setAdditionalInfo:(NSString *)info forKey:(NSString *)key;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* YMMYandexMetricaReporting.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** YMMYandexMetricaReporting protocol groups methods that are used by custom reporting objects.
|
||||
*/
|
||||
@protocol YMMYandexMetricaReporting <NSObject>
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param name Short name or description of the error.
|
||||
@param exception NSException object that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportError:(NSString *)name
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Resumes last session or creates a new one if it has been expired.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)resumeSession;
|
||||
|
||||
/** Pause current session.
|
||||
All events reported after calling this method and till the session timeout will still join this session.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)pauseSession;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* YandexMobileMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#if __has_include("YMMYandexMetrica.h")
|
||||
#import "YMMYandexMetrica.h"
|
||||
#import "YMMVersion.h"
|
||||
#import "YMMYandexMetricaConfiguration.h"
|
||||
#import "YMMYandexMetricaReporting.h"
|
||||
#import "YMMYandexMetricaPreloadInfo.h"
|
||||
#else
|
||||
#import <YandexMobileMetrica/YMMYandexMetrica.h>
|
||||
#import <YandexMobileMetrica/YMMVersion.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaConfiguration.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaReporting.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaPreloadInfo.h>
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
framework module YandexMobileMetrica {
|
||||
umbrella header "YandexMobileMetrica.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* YMMVersion.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#ifndef __YMM_VERSION_H__
|
||||
#define __YMM_VERSION_H__
|
||||
|
||||
#define YMM_VERSION_MAJOR 2
|
||||
#define YMM_VERSION_MINOR 9
|
||||
#define YMM_VERSION_PATCH 1
|
||||
|
||||
#define YMM_BUILD_NUMBER 8517
|
||||
|
||||
#endif // __YMM_VERSION_H__
|
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* YMMYandexMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaConfiguration;
|
||||
@protocol YMMYandexMetricaReporting;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const kYMMYandexMetricaErrorDomain;
|
||||
|
||||
typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
|
||||
YMMYandexMetricaEventErrorCodeInitializationError = 1000,
|
||||
YMMYandexMetricaEventErrorCodeInvalidName = 1001,
|
||||
YMMYandexMetricaEventErrorCodeJsonSerializationError = 1002,
|
||||
};
|
||||
|
||||
@interface YMMYandexMetrica : NSObject
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithApiKey:(NSString *)apiKey;
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param configuration Configuration combines all AppMetrica settings in one place.
|
||||
Configuration initialized with unique application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithConfiguration:(YMMYandexMetricaConfiguration *)configuration;
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that should be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param message Short name or description of the error
|
||||
@param exception Exception contains an NSException object that must be passed to the server. It can take the nil value.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportError:(NSString *)message
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
@param enabled Flag indicating if reporting location to AppMetrica enabled
|
||||
Enabled by default.
|
||||
*/
|
||||
+ (void)setTrackLocationEnabled:(BOOL)enabled;
|
||||
|
||||
/** Set location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
@param location Custom device location to be reported.
|
||||
*/
|
||||
+ (void)setLocation:(nullable CLLocation *)location;
|
||||
|
||||
/** Setting session timeout (in seconds).
|
||||
|
||||
@param sessionTimeoutSeconds Time limit before the application is considered inactive.
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
*/
|
||||
+ (void)setSessionTimeout:(NSUInteger)sessionTimeoutSeconds;
|
||||
|
||||
/** Tracking app crashes.
|
||||
|
||||
@param enabled Boolean value to enable or disable collecting and sending crash reports.
|
||||
By default, reports on application crashes are sent, meaning enabled=true.
|
||||
To disable crash tracking, set the parameter value to enabled=false.
|
||||
*/
|
||||
+ (void)setReportCrashesEnabled:(BOOL)enabled;
|
||||
|
||||
/** Setting the arbitrary application version.
|
||||
|
||||
@param appVersion Application version to be reported.
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
+ (void)setCustomAppVersion:(NSString *)appVersion;
|
||||
|
||||
/** Enable or disable logging.
|
||||
|
||||
@param isEnabled Boolean value to enable or disable logging. By default logging is disabled.
|
||||
*/
|
||||
+ (void)setLoggingEnabled:(BOOL)isEnabled;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with future unhandled exception.
|
||||
If value is nil, previously set key-value is removed. Does nothing if key hasn't been added.
|
||||
|
||||
@param value The error environment value.
|
||||
@param key The error environment key.
|
||||
*/
|
||||
+ (void)setEnvironmentValue:(nullable NSString *)value forKey:(NSString *)key;
|
||||
|
||||
/** Retrieves current version of library.
|
||||
*/
|
||||
+ (NSString *)libraryVersion;
|
||||
|
||||
/** Enables AppMetrica's tracking mechanism by providing application's url scheme.
|
||||
|
||||
@param urlScheme Application's deep link scheme. Scheme should be registered in CFBundleURLTypes Info.plist section.
|
||||
*/
|
||||
+ (BOOL)enableTrackingWithURLScheme:(NSURL *)urlScheme NS_EXTENSION_UNAVAILABLE_IOS("") NS_AVAILABLE_IOS(9_0);
|
||||
|
||||
/** Handles the URL that has opened the application.
|
||||
Reports the URL for deep links tracking.
|
||||
URL scheme should be registered beforehand via `enableTrackingWithUrlScheme:` method for tracking to work correctly.
|
||||
|
||||
@param url URL that has opened the application.
|
||||
*/
|
||||
+ (BOOL)handleOpenURL:(NSURL *)url;
|
||||
|
||||
/** Returns id<YMMYandexMetricaReporting> that can send events to specific API key.
|
||||
|
||||
@param apiKey Api key to send events to.
|
||||
@return id<YMMYandexMetricaReporting> that conforms to YMMYandexMetricaReporting and handles
|
||||
sending events to specified apikey
|
||||
*/
|
||||
+ (nullable id<YMMYandexMetricaReporting>)reporterForApiKey:(NSString *)apiKey;
|
||||
|
||||
/**
|
||||
* Sets referral URL for this installation. This might be required to track some specific traffic sources like Facebook.
|
||||
* @param url referral URL value.
|
||||
*/
|
||||
+ (void)reportReferralUrl:(NSURL *)url;
|
||||
|
||||
@end
|
||||
|
||||
@interface YMMYandexMetrica (YMMYandexMetricaDeprecatedOrUnavailable)
|
||||
|
||||
+ (void)startWithAPIKey:(NSString *)apiKey
|
||||
__attribute__((unavailable("WARNING: apiKey used in startWithAPIKey isn't compatible with activateWithApiKey:. "
|
||||
"Use activateWithApiKey: with updated key. More info in activateWithApiKey:'s description")));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* YMMYandexMetricaConfiguration.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaPreloadInfo;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaConfiguration : NSObject
|
||||
|
||||
/** Initialize configuration with specified Application key.
|
||||
For invalid Application initialization returns nil in release and raises an exception in debug.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
- (nullable instancetype)initWithApiKey:(NSString *)apiKey;
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithApiKey: must be used instead.")));
|
||||
|
||||
/** Get Application key used to initialize the configuration.
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *apiKey;
|
||||
|
||||
/** Whether first activation of AppMetrica should be considered as app update or new app install.
|
||||
If this option is enabled the first call of +[YMMYandexMetrica activateWithApiKey:] or
|
||||
+[YMMYandexMetrica activateWithConfiguration:] will be considered as an application update.
|
||||
|
||||
By default this option is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL handleFirstActivationAsUpdateEnabled;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
Enabled by default.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL trackLocationEnabled;
|
||||
|
||||
/** Set/get location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
By default is nil
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) CLLocation *location;
|
||||
|
||||
/** Set/get session timeout (in seconds).
|
||||
Time limit before the application is considered inactive.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger sessionTimeout;
|
||||
|
||||
/** Enable/disable tracking app crashes.
|
||||
|
||||
Enabled by default.
|
||||
To disable crash tracking, set the parameter value to false.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL reportCrashesEnabled;
|
||||
|
||||
/** Set/get the arbitrary application version for AppMetrica to report.
|
||||
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *customAppVersion;
|
||||
|
||||
/** Enable/disable logging.
|
||||
|
||||
By default logging is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL loggingEnabled;
|
||||
|
||||
/** Set/get preload info, which is used for tracking preload installs.
|
||||
Additional info could be https://appmetrica.yandex.com
|
||||
|
||||
By default is nil.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) YMMYandexMetricaPreloadInfo *preloadInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* YMMYandexMetricaPreloadInfo.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaPreloadInfo : NSObject <NSCopying>
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithTrackingIdentifier: must be used instead.")));
|
||||
|
||||
/** Initialize Preload info with specific publisher and tracking identifiers.
|
||||
If case of invalid identifiers constructor returns nil in release and raises an exception in debug
|
||||
|
||||
@param trackingID Tracking identifier
|
||||
*/
|
||||
- (nullable instancetype)initWithTrackingIdentifier:(NSString *)trackingID;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with preload info.
|
||||
|
||||
@param info Additional preload info.
|
||||
@param key Additional preload key.
|
||||
*/
|
||||
- (void)setAdditionalInfo:(NSString *)info forKey:(NSString *)key;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* YMMYandexMetricaReporting.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** YMMYandexMetricaReporting protocol groups methods that are used by custom reporting objects.
|
||||
*/
|
||||
@protocol YMMYandexMetricaReporting <NSObject>
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param name Short name or description of the error.
|
||||
@param exception NSException object that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportError:(NSString *)name
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Resumes last session or creates a new one if it has been expired.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)resumeSession;
|
||||
|
||||
/** Pause current session.
|
||||
All events reported after calling this method and till the session timeout will still join this session.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)pauseSession;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* YandexMobileMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#if __has_include("YMMYandexMetrica.h")
|
||||
#import "YMMYandexMetrica.h"
|
||||
#import "YMMVersion.h"
|
||||
#import "YMMYandexMetricaConfiguration.h"
|
||||
#import "YMMYandexMetricaReporting.h"
|
||||
#import "YMMYandexMetricaPreloadInfo.h"
|
||||
#else
|
||||
#import <YandexMobileMetrica/YMMYandexMetrica.h>
|
||||
#import <YandexMobileMetrica/YMMVersion.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaConfiguration.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaReporting.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaPreloadInfo.h>
|
||||
#endif
|
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* YMMVersion.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#ifndef __YMM_VERSION_H__
|
||||
#define __YMM_VERSION_H__
|
||||
|
||||
#define YMM_VERSION_MAJOR 2
|
||||
#define YMM_VERSION_MINOR 9
|
||||
#define YMM_VERSION_PATCH 1
|
||||
|
||||
#define YMM_BUILD_NUMBER 8517
|
||||
|
||||
#endif // __YMM_VERSION_H__
|
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* YMMYandexMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaConfiguration;
|
||||
@protocol YMMYandexMetricaReporting;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
extern NSString *const kYMMYandexMetricaErrorDomain;
|
||||
|
||||
typedef NS_ENUM(NSInteger, YMMYandexMetricaEventErrorCode) {
|
||||
YMMYandexMetricaEventErrorCodeInitializationError = 1000,
|
||||
YMMYandexMetricaEventErrorCodeInvalidName = 1001,
|
||||
YMMYandexMetricaEventErrorCodeJsonSerializationError = 1002,
|
||||
};
|
||||
|
||||
@interface YMMYandexMetrica : NSObject
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithApiKey:(NSString *)apiKey;
|
||||
|
||||
/** Starting the statistics collection process.
|
||||
|
||||
@param configuration Configuration combines all AppMetrica settings in one place.
|
||||
Configuration initialized with unique application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
+ (void)activateWithConfiguration:(YMMYandexMetricaConfiguration *)configuration;
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param message Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that should be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportEvent:(NSString *)message
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param message Short name or description of the error
|
||||
@param exception Exception contains an NSException object that must be passed to the server. It can take the nil value.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
+ (void)reportError:(NSString *)message
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
@param enabled Flag indicating if reporting location to AppMetrica enabled
|
||||
Enabled by default.
|
||||
*/
|
||||
+ (void)setTrackLocationEnabled:(BOOL)enabled;
|
||||
|
||||
/** Set location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
@param location Custom device location to be reported.
|
||||
*/
|
||||
+ (void)setLocation:(nullable CLLocation *)location;
|
||||
|
||||
/** Setting session timeout (in seconds).
|
||||
|
||||
@param sessionTimeoutSeconds Time limit before the application is considered inactive.
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
*/
|
||||
+ (void)setSessionTimeout:(NSUInteger)sessionTimeoutSeconds;
|
||||
|
||||
/** Tracking app crashes.
|
||||
|
||||
@param enabled Boolean value to enable or disable collecting and sending crash reports.
|
||||
By default, reports on application crashes are sent, meaning enabled=true.
|
||||
To disable crash tracking, set the parameter value to enabled=false.
|
||||
*/
|
||||
+ (void)setReportCrashesEnabled:(BOOL)enabled;
|
||||
|
||||
/** Setting the arbitrary application version.
|
||||
|
||||
@param appVersion Application version to be reported.
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
+ (void)setCustomAppVersion:(NSString *)appVersion;
|
||||
|
||||
/** Enable or disable logging.
|
||||
|
||||
@param isEnabled Boolean value to enable or disable logging. By default logging is disabled.
|
||||
*/
|
||||
+ (void)setLoggingEnabled:(BOOL)isEnabled;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with future unhandled exception.
|
||||
If value is nil, previously set key-value is removed. Does nothing if key hasn't been added.
|
||||
|
||||
@param value The error environment value.
|
||||
@param key The error environment key.
|
||||
*/
|
||||
+ (void)setEnvironmentValue:(nullable NSString *)value forKey:(NSString *)key;
|
||||
|
||||
/** Retrieves current version of library.
|
||||
*/
|
||||
+ (NSString *)libraryVersion;
|
||||
|
||||
/** Enables AppMetrica's tracking mechanism by providing application's url scheme.
|
||||
|
||||
@param urlScheme Application's deep link scheme. Scheme should be registered in CFBundleURLTypes Info.plist section.
|
||||
*/
|
||||
+ (BOOL)enableTrackingWithURLScheme:(NSURL *)urlScheme NS_EXTENSION_UNAVAILABLE_IOS("") NS_AVAILABLE_IOS(9_0);
|
||||
|
||||
/** Handles the URL that has opened the application.
|
||||
Reports the URL for deep links tracking.
|
||||
URL scheme should be registered beforehand via `enableTrackingWithUrlScheme:` method for tracking to work correctly.
|
||||
|
||||
@param url URL that has opened the application.
|
||||
*/
|
||||
+ (BOOL)handleOpenURL:(NSURL *)url;
|
||||
|
||||
/** Returns id<YMMYandexMetricaReporting> that can send events to specific API key.
|
||||
|
||||
@param apiKey Api key to send events to.
|
||||
@return id<YMMYandexMetricaReporting> that conforms to YMMYandexMetricaReporting and handles
|
||||
sending events to specified apikey
|
||||
*/
|
||||
+ (nullable id<YMMYandexMetricaReporting>)reporterForApiKey:(NSString *)apiKey;
|
||||
|
||||
/**
|
||||
* Sets referral URL for this installation. This might be required to track some specific traffic sources like Facebook.
|
||||
* @param url referral URL value.
|
||||
*/
|
||||
+ (void)reportReferralUrl:(NSURL *)url;
|
||||
|
||||
@end
|
||||
|
||||
@interface YMMYandexMetrica (YMMYandexMetricaDeprecatedOrUnavailable)
|
||||
|
||||
+ (void)startWithAPIKey:(NSString *)apiKey
|
||||
__attribute__((unavailable("WARNING: apiKey used in startWithAPIKey isn't compatible with activateWithApiKey:. "
|
||||
"Use activateWithApiKey: with updated key. More info in activateWithApiKey:'s description")));
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* YMMYandexMetricaConfiguration.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class CLLocation;
|
||||
@class YMMYandexMetricaPreloadInfo;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaConfiguration : NSObject
|
||||
|
||||
/** Initialize configuration with specified Application key.
|
||||
For invalid Application initialization returns nil in release and raises an exception in debug.
|
||||
|
||||
@param apiKey Application key that is issued during application registration in AppMetrica.
|
||||
Application key must be a hexadecimal string in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
|
||||
The key can be requested or checked at https://appmetrica.yandex.com
|
||||
*/
|
||||
- (nullable instancetype)initWithApiKey:(NSString *)apiKey;
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithApiKey: must be used instead.")));
|
||||
|
||||
/** Get Application key used to initialize the configuration.
|
||||
*/
|
||||
@property (nonatomic, copy, readonly) NSString *apiKey;
|
||||
|
||||
/** Whether first activation of AppMetrica should be considered as app update or new app install.
|
||||
If this option is enabled the first call of +[YMMYandexMetrica activateWithApiKey:] or
|
||||
+[YMMYandexMetrica activateWithConfiguration:] will be considered as an application update.
|
||||
|
||||
By default this option is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL handleFirstActivationAsUpdateEnabled;
|
||||
|
||||
/** Enable/disable location reporting to AppMetrica.
|
||||
If enabled and location set via setLocation: method - that location would be used.
|
||||
If enabled and location is not set via setLocation,
|
||||
but application has appropriate permission - CLLocationManager would be used to acquire location data.
|
||||
|
||||
Enabled by default.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL trackLocationEnabled;
|
||||
|
||||
/** Set/get location to AppMetrica
|
||||
To enable AppMetrica to use this location trackLocationEnabled should be 'YES'
|
||||
|
||||
By default is nil
|
||||
*/
|
||||
@property (nonatomic, strong, nullable) CLLocation *location;
|
||||
|
||||
/** Set/get session timeout (in seconds).
|
||||
Time limit before the application is considered inactive.
|
||||
Minimum accepted value is 10 seconds. All passed values below 10 seconds automatically become 10 seconds.
|
||||
|
||||
By default, the session times out if the application is in background for 10 seconds.
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger sessionTimeout;
|
||||
|
||||
/** Enable/disable tracking app crashes.
|
||||
|
||||
Enabled by default.
|
||||
To disable crash tracking, set the parameter value to false.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL reportCrashesEnabled;
|
||||
|
||||
/** Set/get the arbitrary application version for AppMetrica to report.
|
||||
|
||||
By default, the application version is set in the app configuration file Info.plist (CFBundleShortVersionString).
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) NSString *customAppVersion;
|
||||
|
||||
/** Enable/disable logging.
|
||||
|
||||
By default logging is disabled.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL loggingEnabled;
|
||||
|
||||
/** Set/get preload info, which is used for tracking preload installs.
|
||||
Additional info could be https://appmetrica.yandex.com
|
||||
|
||||
By default is nil.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable) YMMYandexMetricaPreloadInfo *preloadInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* YMMYandexMetricaPreloadInfo.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface YMMYandexMetricaPreloadInfo : NSObject <NSCopying>
|
||||
|
||||
- (instancetype)init __attribute__((unavailable("initWithTrackingIdentifier: must be used instead.")));
|
||||
|
||||
/** Initialize Preload info with specific publisher and tracking identifiers.
|
||||
If case of invalid identifiers constructor returns nil in release and raises an exception in debug
|
||||
|
||||
@param trackingID Tracking identifier
|
||||
*/
|
||||
- (nullable instancetype)initWithTrackingIdentifier:(NSString *)trackingID;
|
||||
|
||||
/** Setting key - value data to be used as additional information, associated with preload info.
|
||||
|
||||
@param info Additional preload info.
|
||||
@param key Additional preload key.
|
||||
*/
|
||||
- (void)setAdditionalInfo:(NSString *)info forKey:(NSString *)key;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* YMMYandexMetricaReporting.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** YMMYandexMetricaReporting protocol groups methods that are used by custom reporting objects.
|
||||
*/
|
||||
@protocol YMMYandexMetricaReporting <NSObject>
|
||||
|
||||
/** Reporting custom event.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom event with additional parameters.
|
||||
|
||||
@param name Short name or description of the event.
|
||||
@param params Dictionary of name/value pairs that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportEvent:(NSString *)name
|
||||
parameters:(nullable NSDictionary *)params
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Reporting custom error messages.
|
||||
|
||||
@param name Short name or description of the error.
|
||||
@param exception NSException object that must be sent to the server.
|
||||
@param onFailure Block to be executed if an error occurres while reporting, the error is passed as block argument.
|
||||
*/
|
||||
- (void)reportError:(NSString *)name
|
||||
exception:(nullable NSException *)exception
|
||||
onFailure:(nullable void (^)(NSError *error))onFailure;
|
||||
|
||||
/** Resumes last session or creates a new one if it has been expired.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)resumeSession;
|
||||
|
||||
/** Pause current session.
|
||||
All events reported after calling this method and till the session timeout will still join this session.
|
||||
Should be used when auto tracking of application state is unavailable or is different.
|
||||
*/
|
||||
- (void)pauseSession;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* YandexMobileMetrica.h
|
||||
*
|
||||
* This file is a part of the AppMetrica
|
||||
*
|
||||
* Version for iOS © 2017 YANDEX
|
||||
*
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://legal.yandex.com/metrica_termsofuse/
|
||||
*/
|
||||
|
||||
#if __has_include("YMMYandexMetrica.h")
|
||||
#import "YMMYandexMetrica.h"
|
||||
#import "YMMVersion.h"
|
||||
#import "YMMYandexMetricaConfiguration.h"
|
||||
#import "YMMYandexMetricaReporting.h"
|
||||
#import "YMMYandexMetricaPreloadInfo.h"
|
||||
#else
|
||||
#import <YandexMobileMetrica/YMMYandexMetrica.h>
|
||||
#import <YandexMobileMetrica/YMMVersion.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaConfiguration.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaReporting.h>
|
||||
#import <YandexMobileMetrica/YMMYandexMetricaPreloadInfo.h>
|
||||
#endif
|
Binary file not shown.
BIN
example/ios/YandexMobileMetrica.framework/YandexMobileMetrica
Normal file
BIN
example/ios/YandexMobileMetrica.framework/YandexMobileMetrica
Normal file
Binary file not shown.
@ -22,11 +22,10 @@ class Navigation extends React.PureComponent {
|
||||
renderScene={ this.renderScene }
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
renderScene(route) {
|
||||
console.log('renderScene', route);
|
||||
switch (route.id) {
|
||||
case 'page1': return <Page1/>;
|
||||
case 'page2': return <Page2/>;
|
@ -1,22 +1,37 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Alert,
|
||||
StyleSheet,
|
||||
TouchableOpacity,
|
||||
Text,
|
||||
View,
|
||||
} from 'react-native';
|
||||
|
||||
import AppMetrica from './appmetrica';
|
||||
|
||||
class Page1 extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.main}>
|
||||
<Text>page1</Text>
|
||||
<TouchableOpacity onPress={ () => appNavigator.push({ id: 'page2' }) }>
|
||||
<TouchableOpacity onPress={ this.handlePress }>
|
||||
<Text>go to page2</Text>
|
||||
</TouchableOpacity>
|
||||
<TouchableOpacity onPress={ this.reportEventToAppMetrica }>
|
||||
<Text>report event to AppMetrica</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
handlePress() {
|
||||
appNavigator.push({ id: 'page2' });
|
||||
}
|
||||
|
||||
reportEventToAppMetrica() {
|
||||
AppMetrica.reportEvent('event from page1');
|
||||
Alert.alert('OK!');
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,15 @@ class Page2 extends React.PureComponent {
|
||||
return (
|
||||
<View style={styles.main}>
|
||||
<Text>page2</Text>
|
||||
<TouchableOpacity onPress={ () => appNavigator.pop() }>
|
||||
<TouchableOpacity onPress={ this.handlePress }>
|
||||
<Text>go back</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
handlePress() {
|
||||
appNavigator.push({ id: 'page2' });
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ class Page2 extends React.PureComponent {
|
||||
<View style={styles.main}>
|
||||
<Text>Unknown page</Text>
|
||||
</View>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
5
example/src/appmetrica.js
Normal file
5
example/src/appmetrica.js
Normal file
@ -0,0 +1,5 @@
|
||||
import AppMetrica from 'react-native-appmetrica';
|
||||
|
||||
AppMetrica.activateWithApiKey('2dee16d2-1143-4cd3-a904-39ce10ac2755');
|
||||
|
||||
export default AppMetrica;
|
Loading…
Reference in New Issue
Block a user