Wiki source code of Flutter integration

Version 12.1 by Developer on 2020/03/19 14:55

Show last authors
1 {{box cssClass="floatinginfobox" title="**Page Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 = 1. Overview =
6
7 The plugin is located at pub repositories [[(pub repositories)>>https://pub.dev/packages/flutter_mobigate]]
8 This plugin is built for:
9
10 * Mobigate SDK version 1.0.6
11
12 = 2. Adding SDK to the project =
13
14 **First, add this to your package's pubspec.yaml file**
15
16 {{code language=""}}
17 dependencies:
18 flutter_mobigate: ^1.0.2
19 {{/code}}
20
21 **Install packages from the command line**
22
23 {{code language=""}}
24 $ flutter pub get
25 {{/code}}
26
27 = 3. Api methods =
28
29 To use any method from the plugin add import:
30
31 {{code language="dart"}}
32 import 'package:flutter_mobigate/flutter_mobigate.dart';
33 {{/code}}
34
35 == 3.1 MobigateSDK class initialization ==
36
37 Initialize class with //MobigateSDK(MobigateOptions options)//
38
39 //MobigateOptions(apiKey,{appIdentifier, appInstallationSource,email,cusUserId,enableUserFields,dataGatherPolicy,notificationText,enableIdProfiles})//
40
41 {{showhide id="2" showmessage="MobigateOptions" hidemessage="MobigateOptions"}}
42 (% class="table-bordered table-hover" style="border-color:powderblue" %)
43 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
44 | appIdentifier|String| | Application identifier
45 |appInstallationSource |String| | App installation source e.g., google-play, organic.
46 |email |String | | Set's user email.
47 |cusUserId |String | | You may use your custom userID for marking data. By default we are using device ID and emails for matching. Set it before starting the service using MobigateSDk.Builder method.
48 | enableUserFields|Json Array | | Enable custom fields in user data. By default MobienceSDK is gathering all identifiers, which it can read. You can choose one of these field: ["email", "imei", "imsi", "msisdn", "mac", "serial"] see [[plugin user field constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.1Userfieldconstants]].
49 | dataGatherPolicy| Json Object| | Enable custom data gater policy. By default MobienceSDK gather all data it can read and hide notification icon. Check below DataGatherPolicy options for more details.
50 | notificationText|String | | if state = Mobigate.DATA_GATHER_POLICY_DEFAULT you can pass custom foreground service notification text.
51 | enableIdProfiles|Boolean |false | turns on / off the IDs profiles system.
52 {{/showhide}}
53
54 {{showhide id="3" showmessage="DataGatherPolicy options" hidemessage="DataGatherPolicy options"}}
55 (% class="table-bordered table-hover" style="border-color:powderblue" %)
56 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description
57 | monitorState|String| | Possible monitor states: [[plugin constants>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/sdkintegration/reactnativeintegration/#H4.2Datagatherpolicyconstants]]. More info about gathering data [[here>>https://wiki.spicymobile.pl/wiki/mobigatesdk/view/Main/mobigatesdkintegrationforandroiddevelopers/#H5.8Datagatherpolicy]]
58 {{/showhide}}
59
60 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
61 {{code language="dart"}}
62 MobigateSDK mobigateInstance = MobigateSDK(MobigateOptions(
63 "V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B"
64 ));
65 {{/code}}
66 {{/showhide}}
67
68 == 3.2 SDK initialization ==
69
70 You must initialize the library before running it. Use //Future<String> init// method for that:
71
72 **mobigateInstance.init()**
73
74 Return:
75
76 (% class="table-bordered table-hover" style="border-color:powderblue" %)
77 |=(% style="background-color:powderblue" %)Message|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
78 |success|String|returns success message
79 |error|String|returns error message
80
81 When the library is already initialized run it. Use //Future<String> startSdk()// method for that:
82
83 **mobigateInstance.startSdk();**
84
85 Return:
86
87 (% class="table-bordered table-hover" style="border-color:powderblue" %)
88 |=(% style="background-color:powderblue" %)Message|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
89 |success|String|returns success message
90 |error|String|returns error message
91
92 == 3.3 Tracking in app events ==
93
94 In-App Events provide insight on what is happening in your app. It is recommended to take the time and define the events you would like to measure.
95
96 === 3.3.1 Overview ===
97
98 An event consists of two fields that you (% style="display:none" %) (%%)can use to describe a user's interaction with your app content:
99
100 (% class="table-bordered table-hover" %)
101 |(% style="background-color:powderblue; width:200px" %)**Field name**|(% style="background-color:powderblue; width:200px" %)**Type**|(% style="background-color:powderblue; width:200px" %)**Required**|(% style="background-color:powderblue; width:200px" %)**Description**
102 |(% style="width:200px" %)Category|(% style="width:200px" %)String|(% style="width:200px" %)yes|(% style="width:200px" %)Event category
103 |(% style="width:200px" %)Parameter|(% style="width:200px" %)String|(% style="width:200px" %)no|(% style="width:200px" %)Event parameter. 
104 There can be more than one
105
106 You can use any event category or parameter string of your choice. However, flutter_mobigate plugin contains recommended event categories and parameters via String constants (see [[Event categories>>doc:||anchor="H3.2.3Eventcategories"]] and [[Event parameters>>doc:||anchor="H3.2.4Eventparameters"]]).
107
108 === 3.3.2 Implementation ===
109
110 Tracking in-app events is performed by two methods:
111
112 **void trackEvent(Category category)**
113
114 (% class="table-bordered table-hover" style="border-color:powderblue" %)
115 |=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
116 |Category|Category class |Category class built with help of CategoryBuilder
117
118 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
119 {{code language="dart"}}
120 mobigateInstance.trackEvent((CategoryBuilder(EventCategory.BEGIN_TRIAL)
121 ..setParameter(EventParameter.CITY, "Warsaw")
122 ..setParameter(EventParameter.CONTENT_ID, 523456)
123 ..setParameter(EventParameter.COUPON_CODE, 97636572)
124 ..setParameter(EventParameter.CUSTOMER_SEGMENT, [1, 2, 4]))
125 .build());
126 {{/code}}
127 {{/showhide}}
128
129
130 **void trackAppInstall(int timestamp)**
131
132 (% class="table-bordered table-hover" style="border-color:powderblue" %)
133 |=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
134 |timestamp|double|Unix timestamp in milliseconds
135
136 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
137 {{code language="javascript"}}
138 sendTrackEvent = () => {
139 if (Platform.OS === 'android') {
140 Mobigate.trackAppInstall(1578042916000)
141 }
142 }
143 {{/code}}
144 {{/showhide}}
145
146 === 3.3.3 Event categories ===
147
148 The following section describes the recommended structure of each event category. In-app events categories are defined as part of plugin String constants.
149
150
151 {{showhide id="1" showmessage="LEVEL_ACCOMPLISHED" hidemessage="LEVEL_ACCOMPLISHED" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: 0px"}}
152
153 \\**Description:** Track accomplished game level achievement
154 **Event category:** LEVEL_ACCOMPLISHED
155 **Recommended parameters:** LEVEL, SCORE
156 {{/showhide}}
157
158 {{showhide id="2" showmessage="ADD_PAYMENT_INFO" hidemessage="ADD_PAYMENT_INFO" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
159
160 \\**Description:** Track payment info
161 **Event category:** ADD_PAYMENT_INFO
162 **Recommended parameters:** SUCCESS
163 {{/showhide}}
164
165 {{showhide id="3" showmessage="ADD_TO_BASKET" hidemessage="ADD_TO_BASKET" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
166
167 \\**Description:** Track add item to basket
168 **Event category:** ADD_TO_BASKET
169 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
170 {{/showhide}}
171
172 {{showhide id="4" showmessage="REMOVED_FROM_BASKET" hidemessage="REMOVED_FROM_BASKET" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
173
174 \\**Description:** Track removed item from basket
175 **Event category:** REMOVED_FROM_BASKET
176 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
177 {{/showhide}}
178
179 {{showhide id="5" showmessage="ADD_TO_WISH_LIST" hidemessage="ADD_TO_WISH_LIST" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
180
181 \\**Description:** Track add item to wish list
182 **Event category:** ADD_TO_WISH_LIST
183 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY
184 {{/showhide}}
185
186 {{showhide id="6" showmessage="REGISTRATION" hidemessage="REGISTRATION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
187
188 \\**Description:** Track registration
189 **Event category:** REGISTRATION
190 **Recommended parameters:** REGISTRATION_METHOD
191 {{/showhide}}
192
193 {{showhide id="7" showmessage="TUTORIAL_COMPLETION" hidemessage="TUTORIAL_COMPLETION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
194
195 \\**Description:** Track tutorial completion
196 **Event category:** TUTORIAL_COMPLETION
197 **Recommended parameters:** SUCCESS, CONTENT, CONTENT_ID
198 {{/showhide}}
199
200 {{showhide id="8" showmessage="TRIGGER_CHECKOUT" hidemessage="TRIGGER_CHECKOUT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
201
202 \\**Description:** Track triggered checkout
203 **Event category:** TRIGGER_CHECKOUT
204 **Recommended parameters:** PROCE, CONTENT_TYPE, CONTENT_ID, CONTENT, QUANTITY, PAYMENT_INFO_AVAILABLE, CURRENCY
205 {{/showhide}}
206
207 {{showhide id="9" showmessage="PURCHASE" hidemessage="PURCHASE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
208
209 \\**Description:** Track purchased item
210 **Event category:** PURCHASE
211 **Recommended parameters:** REVENUE, CONTENT_TYPE, CONTENT_ID, CONTENT, PRICE, QUANTITY, CURRENCY, ORDER_ID
212 {{/showhide}}
213
214 {{showhide id="10" showmessage="SUBSCRIBE" hidemessage="SUBSCRIBE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
215
216 \\**Description:** Track subscription purchase
217 **Event category:** SUBSCRIBE
218 **Recommended parameters:** REVENUE, CURRENCY
219 {{/showhide}}
220
221 {{showhide id="11" showmessage="BEGIN_TRIAL" hidemessage="BEGIN_TRIAL" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
222
223 \\**Description:** Track begin trail of product
224 **Event category:** BEGIN_TRIAL
225 **Recommended parameters:** PRICE, CURRENCY
226 {{/showhide}}
227
228 {{showhide id="12" showmessage="RATE" hidemessage="RATE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
229
230 \\**Description:** Track app/item rate
231 **Event category:** RATE
232 **Recommended parameters:** RATING_VALUE, CONTENT_TYPE, CONTENT_ID, CONTENT, MAX_RATING_VALUE
233 {{/showhide}}
234
235 {{showhide id="13" showmessage="SEARCH" hidemessage="SEARCH" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
236 \\**Description:** Track search event
237 **Event category:** SEARCH
238 **Recommended parameters:** CONTENT_TYPE, SEARCH_STRING, SUCCESS
239 {{/showhide}}
240
241 {{showhide id="14" showmessage="USED_CREDIT" hidemessage="USED_CREDIT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
242 \\**Description:** Track use of credit
243 **Event category:** USED_CREDIT
244 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT
245 {{/showhide}}
246
247 {{showhide id="15" showmessage="UNLOCKED_ACHIEVEMENT" hidemessage="UNLOCKED_ACHIEVEMENT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
248 \\**Description:** Track achievement unlock
249 **Event category:** UNLOCKED_ACHIEVEMENT
250 **Recommended parameters:** DESCRIPTION
251 {{/showhide}}
252
253 {{showhide id="16" showmessage="VIEW_CONTENT" hidemessage="VIEW_CONTENT" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
254 \\**Description:** Track content view event
255 **Event category:** VIEW_CONTENT
256 **Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY
257 {{/showhide}}
258
259 {{showhide id="17" showmessage="VIEW_LIST" hidemessage="VIEW_LIST" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
260 \\**Description:** Track list event
261 **Event category:** VIEW_LIST
262 **Recommended parameters:** CONTENT_TYPE, CONTENT_LIST
263 {{/showhide}}
264
265 {{showhide id="18" showmessage="CLICK_AD" hidemessage="CLICK_AD" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
266 \\**Description:** Track ad click
267 **Event category:** CLICK_AD
268 **Recommended parameters:** CONTENT_TYPE, CONTENT_ID
269 {{/showhide}}
270
271 {{showhide id="19" showmessage="VIEW_AD" hidemessage="VIEW_AD" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
272 \\**Description:** Track view ad
273 **Event category:** VIEW_AD
274 **Recommended parameters:** CONTENT_TYPE, CONTENT_ID
275 {{/showhide}}
276
277 {{showhide id="20" showmessage="EVENT_BOOKING" hidemessage="EVENT_BOOKING" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
278 \\**Description:** Track booking event
279 **Event category:** EVENT_BOOKING
280 **Recommended parameters:** REVENUE, DESTINATION_A, DESTINATION_B, CLASS, DESCRIPTION, CUSTOMER_USER_ID, CONTENT_TYPE, CONTENT_ID, DATE_A, DATE_B
281 {{/showhide}}
282
283 {{showhide id="21" showmessage="SHARE" hidemessage="SHARE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
284 \\**Description:** Track share event
285 **Event category:** SHARE
286 **Recommended parameters:** DESCRIPTION
287 {{/showhide}}
288
289 {{showhide id="22" showmessage="INVITE" hidemessage="INVITE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
290 \\**Description:** Track social invite event
291 **Event category:** INVITE
292 **Recommended parameters:** NONE
293 {{/showhide}}
294
295 {{showhide id="23" showmessage="LOGIN" hidemessage="LOGIN" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
296 \\**Description:** Track user login event
297 **Event category:** LOGIN
298 **Recommended parameters:** NONE
299 {{/showhide}}
300
301 {{showhide id="24" showmessage="EVENT_RETURN" hidemessage="EVENT_RETURN" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
302 \\**Description:** Track re engagement event
303 **Event category:** EVENT_RETURN
304 **Recommended parameters:** NONE
305 {{/showhide}}
306
307 {{showhide id="25" showmessage="OPENED_PUSH_NOTIFICATION" hidemessage="OPENED_PUSH_NOTIFICATION" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
308 \\**Description:** Track user opened push notification
309 **Event category:** OPENED_PUSH_NOTIFICATION
310 **Recommended parameters:** NONE
311 {{/showhide}}
312
313 {{showhide id="26" showmessage="UPDATE" hidemessage="UPDATE" effect="slide" effectduration="0.3" style="border-radius: 5px; border: 1px solid powderblue; padding: 7px 7px 7px 30px; margin: -1px 0px 0px 0px"}}
314 \\**Description:** Track update event
315 **Event category:** UPDATE
316 **Recommended parameters:** CONTENT_ID
317 {{/showhide}}
318
319 === 3.2.4 Event parameters ===
320
321 In addition each category that is passed with event may have optional parameters defined as part of the plugin constants, or custom defined as String. Below is a list of recommended parameters.
322
323 {{showhide id="1" showmessage="Parameters list" hidemessage="Parameters list" effect="slide" effectduration="0.3"}}
324
325 (% class="table-bordered table-hover" %)
326 |(% style="background-color:powderblue; width:200px" %)**Parameter enum**|(% style="background-color:powderblue; width:200px" %)**Recommended value**
327 |(% style="width:200px" %)REVENUE|(% style="width:200px" %)FLoat
328 |(% style="width:200px" %)PRICE|(% style="width:200px" %)Float
329 |(% style="width:200px" %)LEVEL|(% style="width:200px" %)Integer
330 |(% style="width:200px" %)SUCCESS|(% style="width:200px" %)Boolean
331 |(% style="width:200px" %)CONTENT_TYPE|(% style="width:200px" %)String
332 |(% style="width:200px" %)CONTENT_LIST|(% style="width:200px" %)Array of strings
333 |(% style="width:200px" %)CONTENT_ID|(% style="width:200px" %)String
334 |(% style="width:200px" %)CURRENCY|(% style="width:200px" %)String
335 |(% style="width:200px" %)REGISTRATION_METHOD|(% style="width:200px" %)String
336 |(% style="width:200px" %)QUANTITY|(% style="width:200px" %)Integer
337 |(% style="width:200px" %)PAYMENT_INFO_AVAILABLE|(% style="width:200px" %)Boolean
338 |(% style="width:200px" %)RATING_VALUE|(% style="width:200px" %)Float
339 |(% style="width:200px" %)MAX_RATING_VALUE|(% style="width:200px" %)Float
340 |(% style="width:200px" %)SEARCH_STRING|(% style="width:200px" %)String
341 |(% style="width:200px" %)DESCRIPTION|(% style="width:200px" %)String
342 |(% style="width:200px" %)SCORE|(% style="width:200px" %)Integer
343 |(% style="width:200px" %)DESTINATION_A|(% style="width:200px" %)String
344 |(% style="width:200px" %)DESTINATION_B|(% style="width:200px" %)String
345 |(% style="width:200px" %)CLASS|(% style="width:200px" %)String
346 |(% style="width:200px" %)DATE_A|(% style="width:200px" %)String
347 |(% style="width:200px" %)DATE_B|(% style="width:200px" %)String
348 |(% style="width:200px" %)EVENT_START|(% style="width:200px" %)Unixtime
349 |(% style="width:200px" %)EVENT_END|(% style="width:200px" %)Unixtime
350 |(% style="width:200px" %)LATITUDE|(% style="width:200px" %)Double
351 |(% style="width:200px" %)LONGITUDE|(% style="width:200px" %)Double
352 |(% style="width:200px" %)CUSTOMER_USER_ID|(% style="width:200px" %)String
353 |(% style="width:200px" %)CUSTOMER_SEGMENT|(% style="width:200px" %)String
354 |(% style="width:200px" %)VALIDATED|(% style="width:200px" %)String
355 |(% style="width:200px" %)RECEIPT_ID|(% style="width:200px" %)String
356 |(% style="width:200px" %)ORDER_ID|(% style="width:200px" %)String
357 |(% style="width:200px" %)TUTORIAL_ID|(% style="width:200px" %)String
358 |(% style="width:200px" %)ACHIEVEMENT_ID|(% style="width:200px" %)String
359 |(% style="width:200px" %)VIRTUAL_CURRENCY_NAME|(% style="width:200px" %)String
360 |(% style="width:200px" %)DEEP_LINK|(% style="width:200px" %)String
361 |(% style="width:200px" %)OLD_VERSION|(% style="width:200px" %)String
362 |(% style="width:200px" %)NEW_VERSION|(% style="width:200px" %)String
363 |(% style="width:200px" %)REVIEW_TEXT|(% style="width:200px" %)String
364 |(% style="width:200px" %)COUPON_CODE|(% style="width:200px" %)String
365 |(% style="width:200px" %)DEPARTING_DEPARTURE_DATE|(% style="width:200px" %)String
366 |(% style="width:200px" %)RETURNING_DEPARTURE_DATE|(% style="width:200px" %)String
367 |(% style="width:200px" %)DESTINATION_LIST|(% style="width:200px" %)String[]
368 |(% style="width:200px" %)CITY|(% style="width:200px" %)String
369 |(% style="width:200px" %)REGION|(% style="width:200px" %)String
370 |(% style="width:200px" %)COUNTRY|(% style="width:200px" %)String
371 |(% style="width:200px" %)DEPARTING_ARRIVAL_DATE|(% style="width:200px" %)String
372 |(% style="width:200px" %)RETURNING_ARRIVAL_DATE|(% style="width:200px" %)String
373 |(% style="width:200px" %)SUGGESTED_DESTINATIONS|(% style="width:200px" %)String[]
374 |(% style="width:200px" %)TRAVEL_START|(% style="width:200px" %)String
375 |(% style="width:200px" %)TRAVEL_END|(% style="width:200px" %)String
376 |(% style="width:200px" %)NUM_ADULTS|(% style="width:200px" %)Integer
377 |(% style="width:200px" %)NUM_CHILDREN|(% style="width:200px" %)Integer
378 |(% style="width:200px" %)NUM_INFANTS|(% style="width:200px" %)Integer
379 |(% style="width:200px" %)SUGGESTED_HOTELS|(% style="width:200px" %)String[]
380 |(% style="width:200px" %)USER_SCORE|(% style="width:200px" %)Float
381 |(% style="width:200px" %)HOTEL_SCORE|(% style="width:200px" %)Float
382 |(% style="width:200px" %)PURCHASE_CURRENCY|(% style="width:200px" %)String
383 |(% style="width:200px" %)PREFERRED_STAR_RATINGS|(% style="width:200px" %)Integer[2]
384 |(% style="width:200px" %)PREFERRED_PRICE_RANGE|(% style="width:200px" %)Integer[2]
385 |(% style="width:200px" %)PREFERRED_NEIGHBORHOODS|(% style="width:200px" %)String[]
386 |(% style="width:200px" %)PREFERRED_NUM_STOPS|(% style="width:200px" %)Integer
387 |(% style="width:200px" %)CONTENT|(% style="width:200px" %)String
388 |(% style="width:200px" %)PARAM_1|(% style="width:200px" %)String
389 |(% style="width:200px" %)PARAM_2|(% style="width:200px" %)String
390 |(% style="width:200px" %)PARAM_3|(% style="width:200px" %)String
391 |(% style="width:200px" %)PARAM_4|(% style="width:200px" %)String
392 |(% style="width:200px" %)PARAM_5|(% style="width:200px" %)String
393 |(% style="width:200px" %)PARAM_6|(% style="width:200px" %)String
394 |(% style="width:200px" %)PARAM_7|(% style="width:200px" %)String
395 |(% style="width:200px" %)PARAM_8|(% style="width:200px" %)String
396 |(% style="width:200px" %)PARAM_9|(% style="width:200px" %)String
397 |(% style="width:200px" %)PARAM_10|(% style="width:200px" %)String
398
399 {{/showhide}}
400
401 == 3.4 Remaining methods ==
402
403 **void setCollectAll()**
404 This method enables all data collectors. By default all data collectors are enabled.
405
406 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
407 {{code language="dart"}}
408 mobigateInstance.setCollectAll();
409 {{/code}}
410 {{/showhide}}
411
412 (% style="color:powderblue" %)
413 ----
414
415 **void configureDataCollectors(bool enable, List<int> collectors)**
416 Enable or disable DataCollector by array collectors input
417
418 (% class="table-bordered table-hover" style="border-color:powderblue" %)
419 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
420 |enable|boolean|true if enable, false if disable|
421 |collectors|array of [[data collector const>>doc:||anchor="H4.3Datacollectorsconstants"]]|e.g.,[Mobigate.DATA_COLLECTOR_BATTERY, DATA_COLLECTOR_GEOLOCATION]|
422
423 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
424 {{code language="javascript"}}
425 mobigateInstance.configureDataCollectors(true, [
426 DataCollector.APPS_LIST,
427 DataCollector.APPS_USAGE,
428 DataCollector.BROWSER
429 ])
430 {{/code}}
431 {{/showhide}}
432
433 (% style="color:powderblue" %)
434 ----
435
436 **Mobigate.disableAllDataCollector()**
437 Disable all data collectors
438
439 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
440 {{code language="javascript"}}
441 Mobigate.disableAllDataCollector()
442 {{/code}}
443 {{/showhide}}
444
445 (% style="color:powderblue" %)
446 ----
447
448 **Mobigate.setEmail(email)**
449 Set user's email
450
451 (% class="table-bordered table-hover" style="border-color:powderblue" %)
452 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
453 |email |String |user's email address |
454
455 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
456 {{code language="javascript"}}
457 Mobigate.setEmail('emailExample@spicymobile.pl')
458 {{/code}}
459 {{/showhide}}
460
461 (% style="color:powderblue" %)
462 ----
463
464 **Mobigate.getEmail(onSuccess, onError)**
465 Get previously set user email
466
467 (% class="table-bordered table-hover" style="border-color:powderblue" %)
468 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
469 |onSuccess |Function |returns callback object
470 |onError |Function |returns callback object
471
472 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
473 {{code language="javascript"}}
474 Mobigate.getEmail((success) => {
475 console.log("user email: " + success)
476 }, (error) => {
477 console.log(error)
478 })
479 {{/code}}
480 {{/showhide}}
481
482 (% style="color:powderblue" %)
483 ----
484
485 **Mobigate.setFbToken(token)**
486 Set fb token for social network collector
487
488 (% class="table-bordered table-hover" style="border-color:powderblue" %)
489 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
490 |token |string |facebook token
491
492 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
493 {{code language="javascript"}}
494 Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012')
495 {{/code}}
496 {{/showhide}}
497
498 (((
499 (% class="showhidebutton" %)
500 (((
501 {{html clean="false"}}
502 <a href="javascript:void(0)" id="showhidebuttontext3" data-show-duration="0" data-show-effect="toggle" data-show-message="Example" data-hide-message="Example">Example</a>
503 {{/html}}
504 )))
505
506 (% class="showhidecontent" id="showhidecontent3" style="display: none;" %)
507 (((
508 (((
509 {{code language="javascript"}}
510 Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012')
511 {{/code}}
512 )))
513 )))
514 )))
515
516
517
518 (% style="color:powderblue" %)
519 ----
520
521 **Mobigate.getSDKInfo(onSuccess, onError)**
522 Getting information about the library
523
524 (% class="table-bordered table-hover" style="border-color:powderblue" %)
525 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
526 |onSuccess |Function |returns callback object
527 |onError |Function |returns callback object
528
529 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
530 {{code language="javascript"}}
531 Mobigate.getSDKInfo((success) => {
532 console.log("sdk info: " + success)
533 }, (error) => {
534 console.log(error)
535 })
536 {{/code}}
537 {{/showhide}}
538
539 (% style="color:powderblue" %)
540 ----
541
542 **Mobigate.getSDKUniqueIdentifier(onSuccess, onError)**
543 Return unique SDK identificator
544
545 (% class="table-bordered table-hover" style="border-color:powderblue" %)
546 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
547 |onSuccess |Function |returns callback object
548 |onError |Function |returns callback object
549
550 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
551 {{code language="javascript"}}
552 Mobigate.getSDKUniqueIdentifier((success) => {
553 console.log("UUID: " + success)
554 }, (error) => {
555 console.log(error)
556 })
557 {{/code}}
558 {{/showhide}}
559
560 (% style="color:powderblue" %)
561 ----
562
563 **Mobigate.getIDsProfiles(onSuccess, onError)**
564 Method returns IDs profiles. List of IDs profiles in the application memory is updated (synchronized with the server) at specified intervals. To enable functionality, use the 'enableIDsProfiles (boolean enable)' method. Returns the identifiers of IDs profiles (ex. 5,9,20), returns '0' if list of user IDs profiles is empty, returns 'null' if the system has not yet communicated
565
566
567 (% class="table-bordered table-hover" style="border-color:powderblue" %)
568 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
569 |onSuccess |Function |returns callback object
570 |onError |Function |returns callback object
571
572 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
573 {{code language="javascript"}}
574 Mobigate.getIDsProfiles((success) => {
575 console.log("Profiles: " + success)
576 }, (error) => {
577 console.log(error)
578 })
579 {{/code}}
580 {{/showhide}}
581
582 (% style="color:powderblue" %)
583 ----
584
585 **Mobigate.getAdOceanTargeting(onSuccess, onError)**
586 Getting numerical variables, that can be used for ads targeting. Method must be called from separate thread. Return 3 different identifiers of a user, encoded into a map of AdOcean numerical variables
587
588 (% class="table-bordered table-hover" style="border-color:powderblue" %)
589 |=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description
590 |onSuccess |Function |returns callback object
591 |onError |Function |returns callback object
592
593 {{showhide id="3" showmessage="Example" hidemessage="Example"}}
594 {{code language="javascript"}}
595 Mobigate.getAdOceanTargeting((success) => {
596 console.log("Adocean targeting: " + success)
597 }, (error) => {
598 console.log(error)
599 })
600 {{/code}}
601 {{/showhide}}
602
603 = 4. Constants =
604
605 The plugin provides many helpful constants for easier implementation.
606
607 == 4.1 User field constants ==
608
609 Used to set custom user fields inside //Mobigate.init()// method:
610
611 * Mobigate.USER_FIELD_EMAIL
612 * Mobigate.USER_FIELD_IMSI
613 * Mobigate.USER_FIELD_IMEI
614 * Mobigate.USER_FIELD_SERIAL
615
616 == 4.2 Data gather policy constants ==
617
618 Used to set how the library collects data:
619
620 * Mobigate.DATA_GATHER_POLICY_DEFAULT
621 * Mobigate.DATA_GATHER_POLICY_HIDE_TRAY
622 * Mobigate.DATA_GATHER_POLICY_BLOCK_DATA_BG
623
624 == 4.3 Data collectors constants ==
625
626 Used to set which data the library should collect:
627
628 * Mobigate.DATA_COLLECTOR_APPS_LIST
629 * Mobigate.DATA_COLLECTOR_APPS_USAGE
630 * Mobigate.DATA_COLLECTOR_BATTERY
631 * Mobigate.DATA_COLLECTOR_BROWSER
632 * Mobigate.DATA_COLLECTOR_CALENDAR_EVENTS
633 * Mobigate.DATA_COLLECTOR_CPU_PROCESS
634 * Mobigate.DATA_COLLECTOR_DICTIONARY
635 * Mobigate.DATA_COLLECTOR_GEOLOCATION
636 * Mobigate.DATA_COLLECTOR_HEADSET_PLUG
637 * Mobigate.DATA_COLLECTOR_MEDIA_FILES
638 * Mobigate.DATA_COLLECTOR_MEMORY_USEAGE
639 * Mobigate.DATA_COLLECTOR_NETWORK_CONNECTION
640 * Mobigate.DATA_COLLECTOR_NETWORK_USEAGE
641 * Mobigate.DATA_COLLECTOR_PACKAGE_CHANGE
642 * Mobigate.DATA_COLLECTOR_PHONE_INFO
643 * Mobigate.DATA_COLLECTOR_ROAMING
644 * Mobigate.DATA_COLLECTOR_SCREEN_ORIENTED
645 * Mobigate.DATA_COLLECTOR_SIGNAL_STRENGTH
646 * Mobigate.DATA_COLLECTOR_PROFILE_MODE
647 * Mobigate.DATA_COLLECTOR_WIFI_DATA_CONNECTION
648 * Mobigate.DATA_COLLECTOR_PERMISSION_COLLECTOR
649 * Mobigate.DATA_COLLECTOR_NFC_COLLECTOR
650 * Mobigate.DATA_COLLECTOR_BLUETOOTH_COLLECTOR
651 * Mobigate.DATA_COLLECTOR_BLUETOOTH_DEVICES_COLLECTOR
652 * Mobigate.DATA_COLLECTOR_MOVEMENT_COLLECTOR
653 * Mobigate.DATA_COLLECTOR_FACEBOOK_NETWORK_COLLECTOR
654 * Mobigate.DATA_COLLECTOR_ROOT_COLLECTOR
655
656 == 4.4 Category and parameter constants ==
657
658 Instead of using defined [[categories>>doc:||anchor="H3.2.3Eventcategories"]] or [[parameters>>doc:||anchor="H3.2.4Eventparameters"]] in the form of text, you can use constants defined in the plugin. All you have to do is add the prefix "CATEGORY_" or "PARAMETER_" to the category name or parameter e.g., Mobigate.CATEGORY_LEVEL_ACCOMPLISHED, Mobigate.CATEGORY_PURCHASE, Mobigate.PARAMETER_PRICE, Mobigate.PARAMETER_LEVEL.
659
660 = 5. Sample app =
661
662 The sample application is located in the github repository [[here>>https://github.com/mobigatesdk/react-native-mobigate]] in //example// folder.
Spicy Mobile
spicymobile.pl