Changes for page Flutter integration
Last modified by Developer on 2020/03/19 15:21
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 - xwiki:XWiki.spicyadmin1 +XWiki.developer - Content
-
... ... @@ -1,0 +1,704 @@ 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 +**Import it in your Dart code** 28 + 29 +{{code language="dart"}} 30 +import 'package:flutter_mobigate/flutter_mobigate.dart'; 31 +{{/code}} 32 + 33 += 3. Api methods = 34 + 35 +To use any method from the plugin add import: 36 + 37 +{{code language="javascript"}} 38 +import Mobigate from 'react-native-mobigate' 39 +{{/code}} 40 + 41 +== 3.1 SDK initialization == 42 + 43 +You must initialize the library before running it. Use //init(apiKey, options, onSuccess, onError)// method for that: 44 + 45 +**Mobigate.init(apiKey, options, onSuccess, onError)** 46 + 47 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 48 +|=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 49 +|apiKey|String|Api key provided by your business partner 50 +|options|Json Object|SDK configuration 51 +|onSuccess|Function|returns callback object 52 +|onError|Function|returns callback object 53 + 54 +{{showhide id="2" showmessage="Options" hidemessage="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 +| appIdentifier|String| | Application identifier 58 +|appInstallationSource |String| | App installation source e.g., google-play, organic. 59 +|email |String | | Set's user email. 60 +|customUserId |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. 61 +| 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]]. 62 +| 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. 63 +| enableIdProfiles|Boolean |false | turns on / off the IDs profiles system. 64 +{{/showhide}} 65 + 66 +{{showhide id="3" showmessage="DataGatherPolicy options" hidemessage="DataGatherPolicy options"}} 67 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 68 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description 69 +| 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]] 70 +|notificationText|String| | if state = Mobigate.DATA_GATHER_POLICY_DEFAULT you can pass custom foreground service notification text 71 +{{/showhide}} 72 + 73 + 74 +When the library is already initialized run it. Use //startSDK(onSuccess, onError)// method for that: 75 + 76 +**Mobigate.startSDK(onSuccess, onError)** 77 + 78 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 79 +|=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 80 +|onSuccess|Function|returns callback object 81 +|onError|Function|returns callback object 82 + 83 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 84 +{{code language="javascript"}} 85 + initLibrary = () => { 86 + if (Platform.OS === 'android') { 87 + Mobigate.init("V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B", 88 + { 89 + /*custom options, check docs for more details 90 + appIdentifier: 'customUserAppIdentifier', 91 + appInstallationSource: "customAppInstallationSourcexyz", 92 + email: 'testemail@gmail.com', 93 + userAgent: 'customUserAgent', 94 + customUserId: 'customUserId',*/ 95 + }, (success) => { 96 + /* You can configure custom collectors after init 97 + Mobigate.disableAllDataCollector() 98 + Mobigate.configureDataCollectors(true, [Mobigate.DATA_COLLECTOR_APPS_LIST, 99 + Mobigate.DATA_COLLECTOR_BATTERY, 100 + Mobigate.DATA_COLLECTOR_PHONE_INFO])*/ 101 + 102 + Mobigate.startSDK((result) => { 103 + this.setState({ 104 + status: 'started', 105 + }); 106 + 107 + }, (errorResult) => { 108 + this.setState({ 109 + status: errorResult, 110 + }); 111 + }) 112 + }, (initError) => { 113 + this.setState({ 114 + status: initError, 115 + }); 116 + }) 117 + }else{ 118 + this.setState({ 119 + status: 'Mobigate SDK supports only Android' 120 + }) 121 + } 122 + } 123 +{{/code}} 124 +{{/showhide}} 125 + 126 +== 3.2 Tracking in app events == 127 + 128 +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. 129 + 130 +=== 3.2.1 Overview === 131 + 132 +An event consists of two fields that you (% style="display:none" %) (%%)can use to describe a user's interaction with your app content: 133 + 134 +(% class="table-bordered table-hover" %) 135 +|(% 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** 136 +|(% style="width:200px" %)Category|(% style="width:200px" %)String|(% style="width:200px" %)yes|(% style="width:200px" %)Event category 137 +|(% style="width:200px" %)Parameter|(% style="width:200px" %)String|(% style="width:200px" %)no|(% style="width:200px" %)Event parameter. 138 +There can be more than one 139 + 140 +You can use any event category or parameter string of your choice. However, react-native-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"]]). 141 + 142 +=== 3.2.2 Implementation === 143 + 144 +Tracking in-app events is performed by two methods: 145 + 146 +**Mobigate.trackEvent(options)** 147 + 148 +{{showhide id="2" showmessage="Options" hidemessage="Options" effect="slide" effectduration="0.3"}} 149 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 150 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Default|=(% style="background-color:powderblue" %)Description 151 +|name|String | | Event category name. 152 +|parameters|Json array| | Array of parameters. Look below on example. 153 +{{/showhide}} 154 + 155 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 156 +{{code language="javascript"}} 157 + sendTrackEvent = () => { 158 + if (Platform.OS === 'android') { 159 + Mobigate.trackEvent({ 160 + name: Mobigate.CATEGORY_PURCHASE, 161 + parameters: { 162 + [Mobigate.PARAMETER_CONTENT_ID]: 42313532, 163 + [Mobigate.PARAMETER_PRICE]: 43.23, 164 + [Mobigate.PARAMETER_QUANTITY]: 2, 165 + 'userCustomParameterName':'simpleName' 166 + }, 167 + }) 168 + } 169 + } 170 +{{/code}} 171 +{{/showhide}} 172 + 173 + 174 +**Mobigate.trackAppInstall(timestamp)** 175 + 176 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 177 +|=(% style="background-color:powderblue" %)Parameter|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 178 +|timestamp|double|Unix timestamp in milliseconds 179 + 180 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 181 +{{code language="javascript"}} 182 + sendTrackEvent = () => { 183 + if (Platform.OS === 'android') { 184 + Mobigate.trackAppInstall(1578042916000) 185 + } 186 + } 187 +{{/code}} 188 +{{/showhide}} 189 + 190 +=== 3.2.3 Event categories === 191 + 192 +The following section describes the recommended structure of each event category. In-app events categories are defined as part of plugin String constants. 193 + 194 + 195 +{{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"}} 196 + 197 +\\**Description:** Track accomplished game level achievement 198 +**Event category:** LEVEL_ACCOMPLISHED 199 +**Recommended parameters:** LEVEL, SCORE 200 +{{/showhide}} 201 + 202 +{{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"}} 203 + 204 +\\**Description:** Track payment info 205 +**Event category:** ADD_PAYMENT_INFO 206 +**Recommended parameters:** SUCCESS 207 +{{/showhide}} 208 + 209 +{{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"}} 210 + 211 +\\**Description:** Track add item to basket 212 +**Event category:** ADD_TO_BASKET 213 +**Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY 214 +{{/showhide}} 215 + 216 +{{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"}} 217 + 218 +\\**Description:** Track removed item from basket 219 +**Event category:** REMOVED_FROM_BASKET 220 +**Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY 221 +{{/showhide}} 222 + 223 +{{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"}} 224 + 225 +\\**Description:** Track add item to wish list 226 +**Event category:** ADD_TO_WISH_LIST 227 +**Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY, QUANTITY 228 +{{/showhide}} 229 + 230 +{{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"}} 231 + 232 +\\**Description:** Track registration 233 +**Event category:** REGISTRATION 234 +**Recommended parameters:** REGISTRATION_METHOD 235 +{{/showhide}} 236 + 237 +{{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"}} 238 + 239 +\\**Description:** Track tutorial completion 240 +**Event category:** TUTORIAL_COMPLETION 241 +**Recommended parameters:** SUCCESS, CONTENT, CONTENT_ID 242 +{{/showhide}} 243 + 244 +{{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"}} 245 + 246 +\\**Description:** Track triggered checkout 247 +**Event category:** TRIGGER_CHECKOUT 248 +**Recommended parameters:** PROCE, CONTENT_TYPE, CONTENT_ID, CONTENT, QUANTITY, PAYMENT_INFO_AVAILABLE, CURRENCY 249 +{{/showhide}} 250 + 251 +{{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"}} 252 + 253 +\\**Description:** Track purchased item 254 +**Event category:** PURCHASE 255 +**Recommended parameters:** REVENUE, CONTENT_TYPE, CONTENT_ID, CONTENT, PRICE, QUANTITY, CURRENCY, ORDER_ID 256 +{{/showhide}} 257 + 258 +{{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"}} 259 + 260 +\\**Description:** Track subscription purchase 261 +**Event category:** SUBSCRIBE 262 +**Recommended parameters:** REVENUE, CURRENCY 263 +{{/showhide}} 264 + 265 +{{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"}} 266 + 267 +\\**Description:** Track begin trail of product 268 +**Event category:** BEGIN_TRIAL 269 +**Recommended parameters:** PRICE, CURRENCY 270 +{{/showhide}} 271 + 272 +{{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"}} 273 + 274 +\\**Description:** Track app/item rate 275 +**Event category:** RATE 276 +**Recommended parameters:** RATING_VALUE, CONTENT_TYPE, CONTENT_ID, CONTENT, MAX_RATING_VALUE 277 +{{/showhide}} 278 + 279 +{{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"}} 280 +\\**Description:** Track search event 281 +**Event category:** SEARCH 282 +**Recommended parameters:** CONTENT_TYPE, SEARCH_STRING, SUCCESS 283 +{{/showhide}} 284 + 285 +{{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"}} 286 +\\**Description:** Track use of credit 287 +**Event category:** USED_CREDIT 288 +**Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT 289 +{{/showhide}} 290 + 291 +{{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"}} 292 +\\**Description:** Track achievement unlock 293 +**Event category:** UNLOCKED_ACHIEVEMENT 294 +**Recommended parameters:** DESCRIPTION 295 +{{/showhide}} 296 + 297 +{{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"}} 298 +\\**Description:** Track content view event 299 +**Event category:** VIEW_CONTENT 300 +**Recommended parameters:** PRICE, CONTENT_TYPE, CONTENT_ID, CONTENT, CURRENCY 301 +{{/showhide}} 302 + 303 +{{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"}} 304 +\\**Description:** Track list event 305 +**Event category:** VIEW_LIST 306 +**Recommended parameters:** CONTENT_TYPE, CONTENT_LIST 307 +{{/showhide}} 308 + 309 +{{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"}} 310 +\\**Description:** Track ad click 311 +**Event category:** CLICK_AD 312 +**Recommended parameters:** CONTENT_TYPE, CONTENT_ID 313 +{{/showhide}} 314 + 315 +{{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"}} 316 +\\**Description:** Track view ad 317 +**Event category:** VIEW_AD 318 +**Recommended parameters:** CONTENT_TYPE, CONTENT_ID 319 +{{/showhide}} 320 + 321 +{{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"}} 322 +\\**Description:** Track booking event 323 +**Event category:** EVENT_BOOKING 324 +**Recommended parameters:** REVENUE, DESTINATION_A, DESTINATION_B, CLASS, DESCRIPTION, CUSTOMER_USER_ID, CONTENT_TYPE, CONTENT_ID, DATE_A, DATE_B 325 +{{/showhide}} 326 + 327 +{{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"}} 328 +\\**Description:** Track share event 329 +**Event category:** SHARE 330 +**Recommended parameters:** DESCRIPTION 331 +{{/showhide}} 332 + 333 +{{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"}} 334 +\\**Description:** Track social invite event 335 +**Event category:** INVITE 336 +**Recommended parameters:** NONE 337 +{{/showhide}} 338 + 339 +{{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"}} 340 +\\**Description:** Track user login event 341 +**Event category:** LOGIN 342 +**Recommended parameters:** NONE 343 +{{/showhide}} 344 + 345 +{{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"}} 346 +\\**Description:** Track re engagement event 347 +**Event category:** EVENT_RETURN 348 +**Recommended parameters:** NONE 349 +{{/showhide}} 350 + 351 +{{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"}} 352 +\\**Description:** Track user opened push notification 353 +**Event category:** OPENED_PUSH_NOTIFICATION 354 +**Recommended parameters:** NONE 355 +{{/showhide}} 356 + 357 +{{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"}} 358 +\\**Description:** Track update event 359 +**Event category:** UPDATE 360 +**Recommended parameters:** CONTENT_ID 361 +{{/showhide}} 362 + 363 +=== 3.2.4 Event parameters === 364 + 365 +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. 366 + 367 +{{showhide id="1" showmessage="Parameters list" hidemessage="Parameters list" effect="slide" effectduration="0.3"}} 368 + 369 +(% class="table-bordered table-hover" %) 370 +|(% style="background-color:powderblue; width:200px" %)**Parameter enum**|(% style="background-color:powderblue; width:200px" %)**Recommended value** 371 +|(% style="width:200px" %)REVENUE|(% style="width:200px" %)FLoat 372 +|(% style="width:200px" %)PRICE|(% style="width:200px" %)Float 373 +|(% style="width:200px" %)LEVEL|(% style="width:200px" %)Integer 374 +|(% style="width:200px" %)SUCCESS|(% style="width:200px" %)Boolean 375 +|(% style="width:200px" %)CONTENT_TYPE|(% style="width:200px" %)String 376 +|(% style="width:200px" %)CONTENT_LIST|(% style="width:200px" %)Array of strings 377 +|(% style="width:200px" %)CONTENT_ID|(% style="width:200px" %)String 378 +|(% style="width:200px" %)CURRENCY|(% style="width:200px" %)String 379 +|(% style="width:200px" %)REGISTRATION_METHOD|(% style="width:200px" %)String 380 +|(% style="width:200px" %)QUANTITY|(% style="width:200px" %)Integer 381 +|(% style="width:200px" %)PAYMENT_INFO_AVAILABLE|(% style="width:200px" %)Boolean 382 +|(% style="width:200px" %)RATING_VALUE|(% style="width:200px" %)Float 383 +|(% style="width:200px" %)MAX_RATING_VALUE|(% style="width:200px" %)Float 384 +|(% style="width:200px" %)SEARCH_STRING|(% style="width:200px" %)String 385 +|(% style="width:200px" %)DESCRIPTION|(% style="width:200px" %)String 386 +|(% style="width:200px" %)SCORE|(% style="width:200px" %)Integer 387 +|(% style="width:200px" %)DESTINATION_A|(% style="width:200px" %)String 388 +|(% style="width:200px" %)DESTINATION_B|(% style="width:200px" %)String 389 +|(% style="width:200px" %)CLASS|(% style="width:200px" %)String 390 +|(% style="width:200px" %)DATE_A|(% style="width:200px" %)String 391 +|(% style="width:200px" %)DATE_B|(% style="width:200px" %)String 392 +|(% style="width:200px" %)EVENT_START|(% style="width:200px" %)Unixtime 393 +|(% style="width:200px" %)EVENT_END|(% style="width:200px" %)Unixtime 394 +|(% style="width:200px" %)LATITUDE|(% style="width:200px" %)Double 395 +|(% style="width:200px" %)LONGITUDE|(% style="width:200px" %)Double 396 +|(% style="width:200px" %)CUSTOMER_USER_ID|(% style="width:200px" %)String 397 +|(% style="width:200px" %)CUSTOMER_SEGMENT|(% style="width:200px" %)String 398 +|(% style="width:200px" %)VALIDATED|(% style="width:200px" %)String 399 +|(% style="width:200px" %)RECEIPT_ID|(% style="width:200px" %)String 400 +|(% style="width:200px" %)ORDER_ID|(% style="width:200px" %)String 401 +|(% style="width:200px" %)TUTORIAL_ID|(% style="width:200px" %)String 402 +|(% style="width:200px" %)ACHIEVEMENT_ID|(% style="width:200px" %)String 403 +|(% style="width:200px" %)VIRTUAL_CURRENCY_NAME|(% style="width:200px" %)String 404 +|(% style="width:200px" %)DEEP_LINK|(% style="width:200px" %)String 405 +|(% style="width:200px" %)OLD_VERSION|(% style="width:200px" %)String 406 +|(% style="width:200px" %)NEW_VERSION|(% style="width:200px" %)String 407 +|(% style="width:200px" %)REVIEW_TEXT|(% style="width:200px" %)String 408 +|(% style="width:200px" %)COUPON_CODE|(% style="width:200px" %)String 409 +|(% style="width:200px" %)DEPARTING_DEPARTURE_DATE|(% style="width:200px" %)String 410 +|(% style="width:200px" %)RETURNING_DEPARTURE_DATE|(% style="width:200px" %)String 411 +|(% style="width:200px" %)DESTINATION_LIST|(% style="width:200px" %)String[] 412 +|(% style="width:200px" %)CITY|(% style="width:200px" %)String 413 +|(% style="width:200px" %)REGION|(% style="width:200px" %)String 414 +|(% style="width:200px" %)COUNTRY|(% style="width:200px" %)String 415 +|(% style="width:200px" %)DEPARTING_ARRIVAL_DATE|(% style="width:200px" %)String 416 +|(% style="width:200px" %)RETURNING_ARRIVAL_DATE|(% style="width:200px" %)String 417 +|(% style="width:200px" %)SUGGESTED_DESTINATIONS|(% style="width:200px" %)String[] 418 +|(% style="width:200px" %)TRAVEL_START|(% style="width:200px" %)String 419 +|(% style="width:200px" %)TRAVEL_END|(% style="width:200px" %)String 420 +|(% style="width:200px" %)NUM_ADULTS|(% style="width:200px" %)Integer 421 +|(% style="width:200px" %)NUM_CHILDREN|(% style="width:200px" %)Integer 422 +|(% style="width:200px" %)NUM_INFANTS|(% style="width:200px" %)Integer 423 +|(% style="width:200px" %)SUGGESTED_HOTELS|(% style="width:200px" %)String[] 424 +|(% style="width:200px" %)USER_SCORE|(% style="width:200px" %)Float 425 +|(% style="width:200px" %)HOTEL_SCORE|(% style="width:200px" %)Float 426 +|(% style="width:200px" %)PURCHASE_CURRENCY|(% style="width:200px" %)String 427 +|(% style="width:200px" %)PREFERRED_STAR_RATINGS|(% style="width:200px" %)Integer[2] 428 +|(% style="width:200px" %)PREFERRED_PRICE_RANGE|(% style="width:200px" %)Integer[2] 429 +|(% style="width:200px" %)PREFERRED_NEIGHBORHOODS|(% style="width:200px" %)String[] 430 +|(% style="width:200px" %)PREFERRED_NUM_STOPS|(% style="width:200px" %)Integer 431 +|(% style="width:200px" %)CONTENT|(% style="width:200px" %)String 432 +|(% style="width:200px" %)PARAM_1|(% style="width:200px" %)String 433 +|(% style="width:200px" %)PARAM_2|(% style="width:200px" %)String 434 +|(% style="width:200px" %)PARAM_3|(% style="width:200px" %)String 435 +|(% style="width:200px" %)PARAM_4|(% style="width:200px" %)String 436 +|(% style="width:200px" %)PARAM_5|(% style="width:200px" %)String 437 +|(% style="width:200px" %)PARAM_6|(% style="width:200px" %)String 438 +|(% style="width:200px" %)PARAM_7|(% style="width:200px" %)String 439 +|(% style="width:200px" %)PARAM_8|(% style="width:200px" %)String 440 +|(% style="width:200px" %)PARAM_9|(% style="width:200px" %)String 441 +|(% style="width:200px" %)PARAM_10|(% style="width:200px" %)String 442 + 443 +{{/showhide}} 444 + 445 +== 3.3 Remaining methods == 446 + 447 +**Mobigate.setCollectAll()** 448 +This method enables all data collectors. By default all data collectors are enabled. 449 + 450 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 451 +{{code language="javascript"}} 452 +Mobigate.disableAllDataCollector() 453 +{{/code}} 454 +{{/showhide}} 455 + 456 +(% style="color:powderblue" %) 457 +---- 458 + 459 +**Mobigate.configureDataCollectors(enable, collectors)** 460 +Enable or disable DataCollector by array collectors input 461 + 462 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 463 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 464 +|enable|boolean|true if enable, false if disable| 465 +|collectors|array of [[data collector const>>doc:||anchor="H4.3Datacollectorsconstants"]]|e.g.,[Mobigate.DATA_COLLECTOR_BATTERY, DATA_COLLECTOR_GEOLOCATION]| 466 + 467 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 468 +{{code language="javascript"}} 469 +Mobigate.configureDataCollectors(true, [Mobigate.DATA_COLLECTOR_APPS_LIST, 470 + Mobigate.DATA_COLLECTOR_BATTERY, 471 + Mobigate.DATA_COLLECTOR_PHONE_INFO]) 472 +{{/code}} 473 +{{/showhide}} 474 + 475 +(% style="color:powderblue" %) 476 +---- 477 + 478 +**Mobigate.disableAllDataCollector()** 479 +Disable all data collectors 480 + 481 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 482 +{{code language="javascript"}} 483 +Mobigate.disableAllDataCollector() 484 +{{/code}} 485 +{{/showhide}} 486 + 487 +(% style="color:powderblue" %) 488 +---- 489 + 490 +**Mobigate.setEmail(email)** 491 +Set user's email 492 + 493 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 494 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 495 +|email |String |user's email address | 496 + 497 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 498 +{{code language="javascript"}} 499 +Mobigate.setEmail('emailExample@spicymobile.pl') 500 +{{/code}} 501 +{{/showhide}} 502 + 503 +(% style="color:powderblue" %) 504 +---- 505 + 506 +**Mobigate.getEmail(onSuccess, onError)** 507 +Get previously set user email 508 + 509 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 510 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 511 +|onSuccess |Function |returns callback object 512 +|onError |Function |returns callback object 513 + 514 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 515 +{{code language="javascript"}} 516 +Mobigate.getEmail((success) => { 517 + console.log("user email: " + success) 518 + }, (error) => { 519 + console.log(error) 520 + }) 521 +{{/code}} 522 +{{/showhide}} 523 + 524 +(% style="color:powderblue" %) 525 +---- 526 + 527 +**Mobigate.setFbToken(token)** 528 +Set fb token for social network collector 529 + 530 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 531 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 532 +|token |string |facebook token 533 + 534 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 535 +{{code language="javascript"}} 536 +Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012') 537 +{{/code}} 538 +{{/showhide}} 539 + 540 +((( 541 +(% class="showhidebutton" %) 542 +((( 543 +{{html clean="false"}} 544 +<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> 545 +{{/html}} 546 +))) 547 + 548 +(% class="showhidecontent" id="showhidecontent3" style="display: none;" %) 549 +((( 550 +((( 551 +{{code language="javascript"}} 552 +Mobigate.setFbToken('9dsf87ds98978das98d7893u12rj808d0j09012jd012') 553 +{{/code}} 554 +))) 555 +))) 556 +))) 557 + 558 + 559 + 560 +(% style="color:powderblue" %) 561 +---- 562 + 563 +**Mobigate.getSDKInfo(onSuccess, onError)** 564 +Getting information about the library 565 + 566 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 567 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 568 +|onSuccess |Function |returns callback object 569 +|onError |Function |returns callback object 570 + 571 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 572 +{{code language="javascript"}} 573 +Mobigate.getSDKInfo((success) => { 574 + console.log("sdk info: " + success) 575 + }, (error) => { 576 + console.log(error) 577 + }) 578 +{{/code}} 579 +{{/showhide}} 580 + 581 +(% style="color:powderblue" %) 582 +---- 583 + 584 +**Mobigate.getSDKUniqueIdentifier(onSuccess, onError)** 585 +Return unique SDK identificator 586 + 587 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 588 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 589 +|onSuccess |Function |returns callback object 590 +|onError |Function |returns callback object 591 + 592 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 593 +{{code language="javascript"}} 594 +Mobigate.getSDKUniqueIdentifier((success) => { 595 + console.log("UUID: " + success) 596 + }, (error) => { 597 + console.log(error) 598 + }) 599 +{{/code}} 600 +{{/showhide}} 601 + 602 +(% style="color:powderblue" %) 603 +---- 604 + 605 +**Mobigate.getIDsProfiles(onSuccess, onError)** 606 +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 607 + 608 + 609 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 610 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 611 +|onSuccess |Function |returns callback object 612 +|onError |Function |returns callback object 613 + 614 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 615 +{{code language="javascript"}} 616 +Mobigate.getIDsProfiles((success) => { 617 + console.log("Profiles: " + success) 618 + }, (error) => { 619 + console.log(error) 620 + }) 621 +{{/code}} 622 +{{/showhide}} 623 + 624 +(% style="color:powderblue" %) 625 +---- 626 + 627 +**Mobigate.getAdOceanTargeting(onSuccess, onError)** 628 +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 629 + 630 +(% class="table-bordered table-hover" style="border-color:powderblue" %) 631 +|=(% style="background-color:powderblue" %)Name|=(% style="background-color:powderblue" %)Type|=(% style="background-color:powderblue" %)Description 632 +|onSuccess |Function |returns callback object 633 +|onError |Function |returns callback object 634 + 635 +{{showhide id="3" showmessage="Example" hidemessage="Example"}} 636 +{{code language="javascript"}} 637 +Mobigate.getAdOceanTargeting((success) => { 638 + console.log("Adocean targeting: " + success) 639 + }, (error) => { 640 + console.log(error) 641 + }) 642 +{{/code}} 643 +{{/showhide}} 644 + 645 += 4. Constants = 646 + 647 +The plugin provides many helpful constants for easier implementation. 648 + 649 +== 4.1 User field constants == 650 + 651 +Used to set custom user fields inside //Mobigate.init()// method: 652 + 653 +* Mobigate.USER_FIELD_EMAIL 654 +* Mobigate.USER_FIELD_IMSI 655 +* Mobigate.USER_FIELD_IMEI 656 +* Mobigate.USER_FIELD_SERIAL 657 + 658 +== 4.2 Data gather policy constants == 659 + 660 +Used to set how the library collects data: 661 + 662 +* Mobigate.DATA_GATHER_POLICY_DEFAULT 663 +* Mobigate.DATA_GATHER_POLICY_HIDE_TRAY 664 +* Mobigate.DATA_GATHER_POLICY_BLOCK_DATA_BG 665 + 666 +== 4.3 Data collectors constants == 667 + 668 +Used to set which data the library should collect: 669 + 670 +* Mobigate.DATA_COLLECTOR_APPS_LIST 671 +* Mobigate.DATA_COLLECTOR_APPS_USAGE 672 +* Mobigate.DATA_COLLECTOR_BATTERY 673 +* Mobigate.DATA_COLLECTOR_BROWSER 674 +* Mobigate.DATA_COLLECTOR_CALENDAR_EVENTS 675 +* Mobigate.DATA_COLLECTOR_CPU_PROCESS 676 +* Mobigate.DATA_COLLECTOR_DICTIONARY 677 +* Mobigate.DATA_COLLECTOR_GEOLOCATION 678 +* Mobigate.DATA_COLLECTOR_HEADSET_PLUG 679 +* Mobigate.DATA_COLLECTOR_MEDIA_FILES 680 +* Mobigate.DATA_COLLECTOR_MEMORY_USEAGE 681 +* Mobigate.DATA_COLLECTOR_NETWORK_CONNECTION 682 +* Mobigate.DATA_COLLECTOR_NETWORK_USEAGE 683 +* Mobigate.DATA_COLLECTOR_PACKAGE_CHANGE 684 +* Mobigate.DATA_COLLECTOR_PHONE_INFO 685 +* Mobigate.DATA_COLLECTOR_ROAMING 686 +* Mobigate.DATA_COLLECTOR_SCREEN_ORIENTED 687 +* Mobigate.DATA_COLLECTOR_SIGNAL_STRENGTH 688 +* Mobigate.DATA_COLLECTOR_PROFILE_MODE 689 +* Mobigate.DATA_COLLECTOR_WIFI_DATA_CONNECTION 690 +* Mobigate.DATA_COLLECTOR_PERMISSION_COLLECTOR 691 +* Mobigate.DATA_COLLECTOR_NFC_COLLECTOR 692 +* Mobigate.DATA_COLLECTOR_BLUETOOTH_COLLECTOR 693 +* Mobigate.DATA_COLLECTOR_BLUETOOTH_DEVICES_COLLECTOR 694 +* Mobigate.DATA_COLLECTOR_MOVEMENT_COLLECTOR 695 +* Mobigate.DATA_COLLECTOR_FACEBOOK_NETWORK_COLLECTOR 696 +* Mobigate.DATA_COLLECTOR_ROOT_COLLECTOR 697 + 698 +== 4.4 Category and parameter constants == 699 + 700 +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. 701 + 702 += 5. Sample app = 703 + 704 +The sample application is located in the github repository [[here>>https://github.com/mobigatesdk/react-native-mobigate]] in //example// folder.