-
Notifications
You must be signed in to change notification settings - Fork 0
/
MAdSDK-LICENSE.txt
183 lines (125 loc) · 5.11 KB
/
MAdSDK-LICENSE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Flurry SDK
[![pod](https://img.shields.io/cocoapods/v/Flurry-iOS-SDK)](https://cocoapods.org/pods/Flurry-iOS-SDK)
[![platform](https://img.shields.io/cocoapods/p/Flurry-iOS-SDK)](https://cocoapods.org/pods/Flurry-iOS-SDK)
[![license](https://img.shields.io/github/license/flurry/flurry-ios-sdk)](https://github.com/flurry/Flurry-iOS-SDK)
## Table of Contents
- [Installation](#installation)
- [iOS](#ios)
- [watchOS](#watchos)
- [tvOS](#tvos)
- [Requirements](#requirements)
- [Examples](#examples)
- [Suppport](#support)
- [License](#license)
## Installation
To install FlurrySDK from CocoaPods, please follow the instructions below. Remember to include `use_frameworks!` if your app target is in Swift.
### iOS
To enable Flurry Analytics:
```ruby
pod 'Flurry-iOS-SDK/FlurrySDK'
```
To enable Flurry Ad serving:
```ruby
pod 'Flurry-iOS-SDK/FlurrySDK'
pod 'Flurry-iOS-SDK/FlurryAds'
```
To enable Flurry Config:
```ruby
pod 'Flurry-iOS-SDK/FlurryConfig'
```
To enable Flurry Messaging:
```ruby
pod 'Flurry-iOS-SDK/FlurryMessaging'
```
### watchOS
To use FlurrySDK for Apple Watch 2.x Extension:
```ruby
target 'Your Apple Watch 2.x Extension Target' do
platform :watchos, '2.0'
pod 'Flurry-iOS-SDK/FlurrySDK'
end
```
### tvOS
To use FlurrySDK for tvOS apps:
```ruby
target 'Your tvOS Application' do
platform :tvos, '10.0'
pod 'Flurry-iOS-SDK/FlurrySDK'
end
```
To enable Flurry Messaging for tvOS:
```ruby
pod 'Flurry-iOS-SDK/FlurryMessaging'
```
## Requirements
* iOS 10.0+
* tvOS 10.0+
* watchOS 3.0+
## Examples
Listed below are brief examples of initializing and using Flurry in your project. For detailed instructions, please [check our documentation](https://developer.yahoo.com/flurry/docs/).
### Initialize Flurry
* iOS/tvOS
To initialize Flurry, please import Flurry in your Application Delegate and start a Flurry session inside `applicationDidFinishLaunching`, as described below.
```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let sb = FlurrySessionBuilder()
.build(logLevel: FlurryLogLevel.all)
.build(crashReportingEnabled: true)
.build(appVersion: "1.0")
.build(iapReportingEnabled: true)
Flurry.startSession(apiKey: "YOUR_API_KEY", sessionBuilder: sb)
return true
}
```
* watchOS
Please follow [our instructions here](https://developer.yahoo.com/flurry/docs/integrateflurry/watchos/).
### Log Events
Use this to log normal events and timed events in your app.
* iOS/tvOS
```swift
// Normal events
Flurry.log(eventName: "Event", parameters: ["Key": "Value"])
// Timed events
Flurry.log(eventName: "Event", parameters: ["Key": "Value"], timed: true)
Flurry.endTimedEvent(eventName: "Event", parameters: ["Key": "Value"])
// Standard events
let param = FlurryParamBuilder()
.set(doubleVal: 34.99, param: FlurryParamBuilder.totalAmount())
.set(booleanVal: true, param: FlurryParamBuilder.success())
.set(stringVal: "book 1", param: FlurryParamBuilder.itemName())
.set(stringVal: "This is an awesome book to purchase !!!", key: "note")
Flurry.log(standardEvent: FlurryEvent.purchased, param: param)
```
Please see our [sample project here](https://github.com/flurry/iOS-StandardEventSample).
* watchOS
```swift
FlurryWatch.logWatchEvent("Event", withParameters: ["Key": "Value"])
```
### Log Error (iOS/tvOS)
Use this to log exceptions and/or errors that occur in your app. Flurry will report the first 10 errors that occur in each session.
```swift
Flurry.log(errorId: "ERROR_NAME", message: "ERROR_MESSAGE", exception: e)
```
### Track User Demographics (iOS/tvOS)
After identifying the user, use this to log the user’s assigned ID, username, age and gender in your system.
```swift
Flurry.set(userId: "USER_ID")
Flurry.set(age: 20)
Flurry.set(gender: "f") // "f" for female and "m" for male
```
### Session Origins and Attributes (iOS/tvOS)
This allows you to specify session origin and deep link attached to each session, or add a custom parameterized session parameters. You can also add an SDK origin specified by origin name and origin version.
```swift
Flurry.add(sessionOriginName: "SESSION_ORIGIN")
Flurry.add(sessionOriginName: "SESSION_ORIGIN", deepLink: "DEEP_LINK")
Flurry.sessionProperties(["key": "value"])
Flurry.add(originName: "ORIGIN_NAME", originVersion: "ORIGIN_VERSION")
Flurry.add(originName: "ORIGIN_NAME", originVersion: "ORIGIN_VERSION", parameters: ["key": "value"])
```
## Support
* [Flurry Documentation](https://developer.yahoo.com/flurry/docs/)
* [FAQs for Flurry](https://developer.yahoo.com/flurry/docs/faq/)
* [Flurry Support](https://developer.yahoo.com/support/flurry/)
## License
Copyright (c) 2021 Yahoo. All rights reserved.
This project is licensed under the terms of the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) open source license. Please refer to [LICENSE](LICENSE) for the full terms. Your use of Flurry is governed by [Flurry Terms of Service](https://developer.yahoo.com/flurry/legal-privacy/terms-service/).