├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── actionscript └── src │ └── com │ └── freshplanet │ └── ane │ └── AirFlurry │ ├── AirFlurry.as │ ├── enums │ └── AirFlurryGender.as │ └── events │ └── AirFlurryEvent.as ├── android ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib │ ├── build.gradle │ ├── libs │ │ └── FlashRuntimeExtensions.jar │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── freshplanet │ │ │ └── ane │ │ │ └── AirFlurry │ │ │ ├── AirFlurryExtension.java │ │ │ ├── AirFlurryExtensionContext.java │ │ │ ├── Constants.java │ │ │ └── functions │ │ │ ├── BaseFunction.java │ │ │ ├── InitFunction.java │ │ │ ├── IsSessionOpenFunction.java │ │ │ ├── LogErrorFunction.java │ │ │ ├── LogEventFunction.java │ │ │ ├── LogPageViewFunction.java │ │ │ ├── SetLocationFunction.java │ │ │ ├── SetUserAgeFunction.java │ │ │ ├── SetUserGenderFunction.java │ │ │ ├── SetUserIdFunction.java │ │ │ ├── StartTimedEventFunction.java │ │ │ └── StopTimedEventFunction.java │ │ └── res │ │ └── values │ │ └── strings.xml └── settings.gradle ├── bin └── AirFlurry.ane ├── build ├── ant-contrib-0.6.jar ├── build.xml ├── example.build.config ├── extension.xml ├── platform-android.xml └── platform-ios.xml ├── ios ├── AirFlurry.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── AirFlurry.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── AirFlurry │ ├── AirFlurry.h │ ├── AirFlurry.m │ └── Constants.h ├── FPANEUtils.h ├── FPANEUtils.m ├── FlashRuntimeExtensions.h ├── Podfile ├── Podfile.lock └── Pods │ ├── Flurry-iOS-SDK │ ├── Flurry │ │ ├── Flurry.h │ │ ├── FlurryConsent.h │ │ ├── FlurryEmpty.m │ │ ├── FlurrySessionBuilder.h │ │ └── libFlurry_9.0.0.a │ ├── Licenses │ │ └── Flurry-LICENSE.txt │ └── README.md │ ├── Headers │ ├── Private │ │ └── Flurry-iOS-SDK │ │ │ ├── Flurry.h │ │ │ ├── FlurryConsent.h │ │ │ └── FlurrySessionBuilder.h │ └── Public │ │ └── Flurry-iOS-SDK │ │ ├── Flurry.h │ │ ├── FlurryConsent.h │ │ └── FlurrySessionBuilder.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ └── project.pbxproj │ └── Target Support Files │ ├── Flurry-iOS-SDK │ ├── Flurry-iOS-SDK-dummy.m │ ├── Flurry-iOS-SDK-prefix.pch │ └── Flurry-iOS-SDK.xcconfig │ └── Pods-AirFlurry │ ├── Pods-AirFlurry-acknowledgements.markdown │ ├── Pods-AirFlurry-acknowledgements.plist │ ├── Pods-AirFlurry-dummy.m │ ├── Pods-AirFlurry-frameworks.sh │ ├── Pods-AirFlurry-resources.sh │ ├── Pods-AirFlurry.debug.xcconfig │ └── Pods-AirFlurry.release.xcconfig └── sample ├── Main-app.xml ├── libs └── AirFlurry.ane └── src ├── Main.as └── com └── freshplanet └── ui ├── ScrollableContainer.as └── TestBlock.as /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | temp 3 | build.config 4 | 5 | # Flash Builder 6 | actionscript/bin 7 | .actionScriptProperties 8 | .flexLibProperties 9 | 10 | # Eclipse 11 | .settings 12 | .project 13 | 14 | # Android 15 | android/bin 16 | android/gen 17 | android/res 18 | android/lint.xml 19 | .classpath 20 | proguard-project.txt 21 | project.properties 22 | 23 | # Xcode 24 | xcuserdata 25 | 26 | # OS X 27 | Icon 28 | Thumbs.db 29 | .DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2017 Freshplanet (http://freshplanet.com | opensource@freshplanet.com) 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Air Native Extension for Flurry Analytics (iOS + Android) 2 | ====================================== 3 | 4 | This is an [Air native extension](http://www.adobe.com/devnet/air/native-extensions-for-air.html) for [Flurry](http://flurry.com) SDK on iOS and Android. It has been developed by [FreshPlanet](http://freshplanet.com) and is used in the game [SongPop](http://songpop.fm). 5 | 6 | 7 | Flurry SDK Versions 8 | --------- 9 | 10 | * iOS: 8.1.0 11 | * Android: 7.0.0 12 | 13 | 14 | Installation 15 | --------- 16 | 17 | The ANE binary (AirFlurry.ane) is located in the *bin* folder. You should add it to your application project's Build Path and make sure to package it with your app (more information [here](http://help.adobe.com/en_US/air/build/WS597e5dadb9cc1e0253f7d2fc1311b491071-8000.html)). 18 | 19 | 20 | Notes: 21 | * included binary has been compiled for 64-bit iOS support 22 | 23 | 24 | Documentation 25 | -------- 26 | 27 | Actionscript documentation is available in HTML format in the *docs* folder. 28 | 29 | 30 | Build script 31 | --------- 32 | 33 | Should you need to edit the extension source code and/or recompile it, you will find an ant build script (build.xml) in the *build* folder: 34 | 35 | ```bash 36 | cd /path/to/the/ane 37 | 38 | # Setup build configuration 39 | cd build 40 | mv example.build.config build.config 41 | # Edit build.config file to provide your machine-specific paths 42 | 43 | # Build the ANE 44 | ant 45 | ``` 46 | 47 | 48 | Authors 49 | ------ 50 | 51 | This ANE has been written by [Thibaut Crenn](https://github.com/titi-us), [Alexis Taugeron](http://alexistaugeron.com) and [Mateo Kozomara](mateo.kozomara@gmail.com). It belongs to [FreshPlanet Inc.](http://freshplanet.com) and is distributed under the [Apache Licence, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 52 | 53 | 54 | 55 | Join the FreshPlanet team - GAME DEVELOPMENT in NYC 56 | ------ 57 | 58 | We are expanding our mobile engineering teams. 59 | 60 | FreshPlanet is a NYC based mobile game development firm and we are looking for senior engineers to lead the development initiatives for one or more of our games/apps. We work in small teams (6-9) who have total product control. These teams consist of mobile engineers, UI/UX designers and product experts. 61 | 62 | 63 | Please contact Tom Cassidy (tcassidy@freshplanet.com) or apply at http://freshplanet.com/jobs/ 64 | -------------------------------------------------------------------------------- /actionscript/src/com/freshplanet/ane/AirFlurry/AirFlurry.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry 17 | { 18 | import com.freshplanet.ane.AirFlurry.enums.AirFlurryGender; 19 | import com.freshplanet.ane.AirFlurry.events.AirFlurryEvent; 20 | 21 | import flash.events.EventDispatcher; 22 | import flash.events.StatusEvent; 23 | import flash.external.ExtensionContext; 24 | import flash.system.Capabilities; 25 | 26 | public class AirFlurry extends EventDispatcher { 27 | 28 | // --------------------------------------------------------------------------------------// 29 | // // 30 | // PUBLIC API // 31 | // // 32 | // --------------------------------------------------------------------------------------// 33 | 34 | 35 | /** 36 | * Flurry is supported on iOS and Android devices. 37 | * 38 | */ 39 | public static function get isSupported() : Boolean { 40 | return isAndroid || isIOS; 41 | } 42 | 43 | /** 44 | * AirFlurry instance 45 | * @return AirFlurry instance 46 | */ 47 | public static function get instance() : AirFlurry { 48 | return _instance ? _instance : new AirFlurry(); 49 | } 50 | 51 | /** 52 | * If true, logs will be displayed at the Actionscript level. 53 | */ 54 | public function get logEnabled() : Boolean { 55 | return _logEnabled; 56 | } 57 | 58 | public function set logEnabled( value : Boolean ) : void { 59 | _logEnabled = value; 60 | } 61 | 62 | 63 | /** 64 | * Start AirFlurry 65 | * @param apiKey Flurry API key 66 | * @param appVersion Version of your app 67 | * @param continueSessionInMillis Set the timeout for expiring a Flurry session 68 | */ 69 | public function init(apiKey:String, appVersion:String, continueSessionInMillis:int = 100):void { 70 | if(apiKey == null || appVersion == null) { 71 | log("Please provide apiKey and appVersion to initialize AirFlurry"); 72 | return; 73 | 74 | } 75 | if (isSupported) 76 | _context.call("initFlurry", apiKey, appVersion, continueSessionInMillis); 77 | 78 | } 79 | 80 | /** 81 | * Does an active session exist 82 | */ 83 | public function get isSessionOpen() : Boolean { 84 | return _context.call("isSessionOpen"); 85 | } 86 | 87 | /** 88 | * Set user id 89 | * @param userId 90 | */ 91 | public function setUserId(userId:String):void { 92 | if (isSupported) 93 | _context.call("setUserId", userId); 94 | } 95 | 96 | /** 97 | * Set user age 98 | * @param age Must be > 0. 99 | */ 100 | public function setUserAge(age:uint):void { 101 | if (isSupported) 102 | _context.call("setUserAge", age); 103 | } 104 | 105 | /** 106 | * Set user gender 107 | * @param gender 108 | */ 109 | public function setUserGender(gender:AirFlurryGender):void { 110 | if (isSupported) 111 | _context.call("setUserGender", gender.value); 112 | } 113 | 114 | /** 115 | * Set user location 116 | * @param latitude 117 | * @param longitude 118 | * @param horizontalAccuracy 119 | * @param verticalAccuracy 120 | */ 121 | public function setLocation(latitude:Number, longitude:Number, horizontalAccuracy:Number, verticalAccuracy:Number):void { 122 | if (isSupported) 123 | _context.call("setLocation", latitude, longitude, horizontalAccuracy, verticalAccuracy); 124 | } 125 | 126 | /** 127 | * Log a regular event. 128 | * 129 | * @param eventName Name of the event. Limits : 130 | * 135 | * 136 | * @param properties map of additional parameters sent with the event. Limits : 137 | * 141 | */ 142 | public function logEvent(eventName:String, properties:Object = null):void { 143 | if (!checkLength(eventName)) { 144 | log("Couldn't log event " + eventName + " (too long, max 255)"); 145 | return; 146 | } 147 | 148 | var parameterKeys:Array = []; 149 | var parameterValues:Array = []; 150 | if (properties) { 151 | var value:String; 152 | var count:int = 0; 153 | for (var key:String in properties) { 154 | if (count > 10) { 155 | log("Too many properties provided. Only kept " + JSON.stringify(parameterKeys)); 156 | break; 157 | } 158 | 159 | value = properties[key].toString(); 160 | if (checkLength(value) && checkLength(key)) { 161 | parameterKeys.push(key); 162 | parameterValues.push(value); 163 | } 164 | else { 165 | log("Skipped property " + key + ". Value " + value + " was too long"); 166 | } 167 | count++; 168 | } 169 | } 170 | 171 | if (isSupported) 172 | _context.call("logEvent", eventName, parameterKeys, parameterValues); 173 | 174 | } 175 | 176 | /** 177 | * Starts a timed event specified by eventName 178 | * @param eventName 179 | * @param properties map of additional parameters sent with the event. Limits : 180 | * 184 | */ 185 | public function startTimedEvent(eventName:String, properties:Object = null):void { 186 | if (!checkLength(eventName)) { 187 | log("Couldn't start timed event " + eventName + " (too long, max 255)"); 188 | return; 189 | } 190 | 191 | var parameterKeys:Array = []; 192 | var parameterValues:Array = []; 193 | if (properties) { 194 | var value:String; 195 | var count:int = 0; 196 | for (var key:String in properties) { 197 | if (count > 10) { 198 | log("Too many properties provided. Only kept " + JSON.stringify(parameterKeys)); 199 | break; 200 | } 201 | 202 | value = properties[key].toString(); 203 | if (checkLength(value) && checkLength(key)) { 204 | parameterKeys.push(key); 205 | parameterValues.push(value); 206 | } 207 | else { 208 | log("Skipped property " + key + ". Value " + value + " was too long"); 209 | } 210 | count++; 211 | } 212 | } 213 | 214 | if (isSupported) 215 | _context.call("startTimedEvent", eventName, parameterKeys, parameterValues); 216 | } 217 | 218 | /** 219 | * Ends a timed event specified by eventName 220 | * @param eventName must be <= 255 characters 221 | * @param properties map of additional parameters sent with the event. Limits : 222 | * 226 | */ 227 | public function stopTimedEvent(eventName:String, properties:Object = null):void { 228 | if (!checkLength(eventName)) { 229 | log("Couldn't stop timed event " + eventName + " (too long, max 255)"); 230 | return; 231 | } 232 | 233 | var parameterKeys:Array = []; 234 | var parameterValues:Array = []; 235 | if (properties) { 236 | var value:String; 237 | var count:int = 0; 238 | for (var key:String in properties) { 239 | if (count > 10) { 240 | log("Too many properties provided. Only kept " + JSON.stringify(parameterKeys)); 241 | break; 242 | } 243 | 244 | value = properties[key].toString(); 245 | if (checkLength(value) && checkLength(key)) { 246 | parameterKeys.push(key); 247 | parameterValues.push(value); 248 | } 249 | else { 250 | log("Skipped property " + key + ". Value " + value + " was too long"); 251 | } 252 | count++; 253 | } 254 | } 255 | 256 | if (isSupported) 257 | _context.call("stopTimedEvent", eventName, parameterKeys, parameterValues); 258 | 259 | } 260 | 261 | /** 262 | * Log an error. 263 | *

264 | * 265 | * Limits: 266 | * 270 | */ 271 | public function logError(errorId:String, message:String = null):void { 272 | if (!errorId) { 273 | log("Couldn't log error. You need to provide an error ID."); 274 | return; 275 | } 276 | 277 | if (errorId.length > 255) { 278 | errorId = errorId.substr(0, 255); 279 | } 280 | 281 | message = message || ""; 282 | if (message.length > 255) { 283 | message = message.substr(0, 255); 284 | } 285 | 286 | if (isSupported) 287 | _context.call("logError", errorId, message); 288 | 289 | } 290 | 291 | /** 292 | * This method increments the page view count for a session when invoked 293 | */ 294 | public function logPageView():void { 295 | if (isSupported) 296 | _context.call("logPageView"); 297 | } 298 | 299 | /** 300 | * Use this method report session data when the app is closed. iOS only 301 | * @param value 302 | */ 303 | public function set setSessionReportsOnCloseEnabled(value:Boolean):void { 304 | if (isIOS) 305 | _context.call("setSessionReportsOnCloseEnabled", value); 306 | 307 | } 308 | 309 | /** 310 | * Use this method report session data when the app is paused. iOS only 311 | * @param value 312 | */ 313 | public function set setSessionReportsOnPauseEnabled(value:Boolean):void { 314 | if (isIOS) 315 | _context.call("setSessionReportsOnPauseEnabled", value); 316 | 317 | } 318 | 319 | /** 320 | * Use this method to enable reporting of errors and events when application is 321 | * running in backgorund (such applications have UIBackgroundModes in Info.plist). iOS only 322 | * @param value 323 | */ 324 | public function set setBackgroundSessionEnabled(value:Boolean):void { 325 | if (isIOS) 326 | _context.call("setBackgroundSessionEnabled", value); 327 | 328 | } 329 | 330 | /** 331 | * This method should be used in case of #setBackgroundSessionEnabled: set to true. It can be 332 | * called when application finished all background tasks (such as playing music) to pause session. iOS only 333 | */ 334 | public function pauseBackgroundSession():void { 335 | if (isIOS) 336 | _context.call("pauseBackgroundSession"); 337 | 338 | } 339 | 340 | // --------------------------------------------------------------------------------------// 341 | // // 342 | // PRIVATE API // 343 | // // 344 | // --------------------------------------------------------------------------------------// 345 | 346 | private static const EXTENSION_ID : String = "com.freshplanet.ane.AirFlurry"; 347 | private static var _instance : AirFlurry; 348 | private var _context : ExtensionContext = null; 349 | private var _logEnabled : Boolean = true; 350 | 351 | /** 352 | * "private" singleton constructor 353 | */ 354 | public function AirFlurry() { 355 | if (!_instance) { 356 | _context = ExtensionContext.createExtensionContext(EXTENSION_ID, null); 357 | if (!_context) { 358 | log("ERROR - Extension context is null. Please check if extension.xml is setup correctly."); 359 | return; 360 | } 361 | _context.addEventListener(StatusEvent.STATUS, onStatus); 362 | 363 | _instance = this; 364 | } 365 | else { 366 | throw Error("This is a singleton, use instance, do not call the constructor directly."); 367 | } 368 | } 369 | 370 | private static function get isAndroid():Boolean { 371 | return Capabilities.manufacturer.indexOf("Android") > -1; 372 | } 373 | 374 | private static function get isIOS():Boolean { 375 | return Capabilities.manufacturer.indexOf("iOS") > -1 && Capabilities.os.indexOf("x86_64") < 0 && Capabilities.os.indexOf("i386") < 0; 376 | } 377 | 378 | 379 | private function checkLength(value:String):Boolean { 380 | return value && value.length < 255; 381 | } 382 | 383 | private function onStatus(event:StatusEvent):void { 384 | if (event.code == AirFlurryEvent.SESSION_STARTED) { 385 | this.dispatchEvent(new AirFlurryEvent(AirFlurryEvent.SESSION_STARTED)); 386 | } 387 | else if (event.code == "log") { 388 | log(event.level); 389 | } 390 | } 391 | 392 | private function log(message:String):void { 393 | if (_logEnabled) trace("[AirFlurry] " + message); 394 | } 395 | } 396 | } -------------------------------------------------------------------------------- /actionscript/src/com/freshplanet/ane/AirFlurry/enums/AirFlurryGender.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package com.freshplanet.ane.AirFlurry.enums { 16 | public class AirFlurryGender { 17 | 18 | 19 | /*************************** 20 | * 21 | * PUBLIC 22 | * 23 | ***************************/ 24 | 25 | 26 | static public const MALE : AirFlurryGender = new AirFlurryGender(Private, "m"); 27 | static public const FEMALE : AirFlurryGender = new AirFlurryGender(Private, "f"); 28 | 29 | public static function fromValue(value:String):AirFlurryGender { 30 | 31 | switch (value) 32 | { 33 | case MALE.value: 34 | return MALE; 35 | break; 36 | case FEMALE.value: 37 | return FEMALE; 38 | break; 39 | default: 40 | return null; 41 | break; 42 | } 43 | } 44 | 45 | public function get value():String { 46 | return _value; 47 | } 48 | 49 | /*************************** 50 | * 51 | * PRIVATE 52 | * 53 | ***************************/ 54 | 55 | private var _value:String = null; 56 | 57 | public function AirFlurryGender(access:Class, value:String) { 58 | 59 | if (access != Private) 60 | throw new Error("Private constructor call!"); 61 | 62 | _value = value; 63 | } 64 | } 65 | } 66 | 67 | final class Private {} 68 | -------------------------------------------------------------------------------- /actionscript/src/com/freshplanet/ane/AirFlurry/events/AirFlurryEvent.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package com.freshplanet.ane.AirFlurry.events { 16 | import flash.events.Event; 17 | 18 | public class AirFlurryEvent extends Event { 19 | 20 | public static const SESSION_STARTED:String = "AirFlurryEvent_sessionStarted"; 21 | public function AirFlurryEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { 22 | super(type, bubbles, cancelable); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | jcenter() 7 | maven { 8 | url "https://maven.google.com" 9 | } 10 | google() 11 | 12 | 13 | } 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:4.0.1' 17 | } 18 | 19 | 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | jcenter() 25 | maven { 26 | url "https://maven.google.com" 27 | } 28 | } 29 | } 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | android.useAndroidX=true 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Oct 22 20:04:49 CEST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | 25 | dependencies { 26 | compile fileTree(include: ['*.jar'], dir: 'libs') 27 | // Required for Flurry Analytics integration 28 | compile 'com.flurry.android:analytics:11.0.0@aar' 29 | 30 | } 31 | 32 | task copyDependencies(type: Copy) { 33 | from configurations.compile 34 | into 'dependencies' 35 | } -------------------------------------------------------------------------------- /android/lib/libs/FlashRuntimeExtensions.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/android/lib/libs/FlashRuntimeExtensions.jar -------------------------------------------------------------------------------- /android/lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/AirFlurryExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry; 17 | 18 | import android.util.Log; 19 | 20 | import com.adobe.fre.FREContext; 21 | import com.adobe.fre.FREExtension; 22 | 23 | public class AirFlurryExtension implements FREExtension { 24 | 25 | public static String TAG = "AirFlurry"; 26 | public static AirFlurryExtensionContext context; 27 | 28 | 29 | public FREContext createContext(String extId) 30 | { 31 | context = new AirFlurryExtensionContext(); 32 | return context; 33 | } 34 | 35 | public void dispose() 36 | { 37 | Log.d(TAG, "AirFlurryExtension disposed."); 38 | context = null; 39 | } 40 | 41 | public void initialize() 42 | { 43 | Log.d(TAG, "AirFlurryExtension initialized."); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/AirFlurryExtensionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | import android.util.Log; 22 | 23 | import com.adobe.fre.FREContext; 24 | import com.adobe.fre.FREFunction; 25 | import com.freshplanet.ane.AirFlurry.functions.InitFunction; 26 | import com.freshplanet.ane.AirFlurry.functions.IsSessionOpenFunction; 27 | import com.freshplanet.ane.AirFlurry.functions.LogErrorFunction; 28 | import com.freshplanet.ane.AirFlurry.functions.LogEventFunction; 29 | import com.freshplanet.ane.AirFlurry.functions.LogPageViewFunction; 30 | import com.freshplanet.ane.AirFlurry.functions.SetLocationFunction; 31 | import com.freshplanet.ane.AirFlurry.functions.SetUserAgeFunction; 32 | import com.freshplanet.ane.AirFlurry.functions.SetUserGenderFunction; 33 | import com.freshplanet.ane.AirFlurry.functions.SetUserIdFunction; 34 | import com.freshplanet.ane.AirFlurry.functions.StartTimedEventFunction; 35 | import com.freshplanet.ane.AirFlurry.functions.StopTimedEventFunction; 36 | 37 | public class AirFlurryExtensionContext extends FREContext 38 | { 39 | public AirFlurryExtensionContext() 40 | { 41 | Log.d(AirFlurryExtension.TAG, "Context created."); 42 | } 43 | 44 | @Override 45 | public void dispose() 46 | { 47 | Log.d(AirFlurryExtension.TAG, "Context disposed."); 48 | AirFlurryExtension.context = null; 49 | } 50 | 51 | @Override 52 | public Map getFunctions() 53 | { 54 | Map functionMap = new HashMap(); 55 | functionMap.put("initFlurry", new InitFunction()); 56 | functionMap.put("logEvent", new LogEventFunction()); 57 | functionMap.put("logError", new LogErrorFunction()); 58 | functionMap.put("setUserId", new SetUserIdFunction()); 59 | functionMap.put("setUserAge", new SetUserAgeFunction()); 60 | functionMap.put("setUserGender", new SetUserGenderFunction()); 61 | functionMap.put("startTimedEvent", new StartTimedEventFunction()); 62 | functionMap.put("stopTimedEvent", new StopTimedEventFunction()); 63 | functionMap.put("setLocation", new SetLocationFunction()); 64 | functionMap.put("logPageView", new LogPageViewFunction()); 65 | functionMap.put("isSessionOpen", new IsSessionOpenFunction()); 66 | 67 | return functionMap; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package com.freshplanet.ane.AirFlurry; 16 | 17 | public class Constants { 18 | public static final String AirFlurryEvent_SESSION_STARTED = "AirFlurryEvent_sessionStarted"; 19 | } 20 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/BaseFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | import android.os.Bundle; 21 | import com.adobe.fre.FREArray; 22 | import com.adobe.fre.FREContext; 23 | import com.adobe.fre.FREFunction; 24 | import com.adobe.fre.FREObject; 25 | import com.freshplanet.ane.AirFlurry.AirFlurryExtension; 26 | import com.freshplanet.ane.AirFlurry.AirFlurryExtensionContext; 27 | 28 | public class BaseFunction implements FREFunction { 29 | @Override 30 | public FREObject call(FREContext context, FREObject[] args) { 31 | AirFlurryExtension.context = (AirFlurryExtensionContext)context; 32 | return null; 33 | } 34 | 35 | protected String getStringFromFREObject(FREObject object) { 36 | try { 37 | return object.getAsString(); 38 | } 39 | catch (Exception e) { 40 | e.printStackTrace(); 41 | return null; 42 | } 43 | } 44 | 45 | protected Boolean getBooleanFromFREObject(FREObject object) { 46 | try { 47 | return object.getAsBool(); 48 | } 49 | catch(Exception e) { 50 | e.printStackTrace(); 51 | return false; 52 | } 53 | } 54 | 55 | protected int getIntFromFREObject(FREObject object) { 56 | try { 57 | return object.getAsInt(); 58 | } 59 | catch(Exception e) { 60 | e.printStackTrace(); 61 | return 0; 62 | } 63 | } 64 | 65 | protected double getDoubleFromFREObject(FREObject object) { 66 | try { 67 | return object.getAsDouble(); 68 | } 69 | catch(Exception e) { 70 | e.printStackTrace(); 71 | return 0; 72 | } 73 | } 74 | 75 | protected List getListOfStringFromFREArray(FREArray array) { 76 | List result = new ArrayList(); 77 | 78 | try { 79 | for (int i = 0; i < array.getLength(); i++) { 80 | try { 81 | result.add(getStringFromFREObject(array.getObjectAt((long)i))); 82 | } 83 | catch (Exception e) { 84 | e.printStackTrace(); 85 | } 86 | } 87 | } 88 | catch (Exception e) { 89 | e.printStackTrace(); 90 | return null; 91 | } 92 | 93 | return result; 94 | } 95 | 96 | protected Bundle getBundleOfStringFromFREArrays(FREArray keys, FREArray values) { 97 | Bundle result = new Bundle(); 98 | 99 | try { 100 | long length = Math.min(keys.getLength(), values.getLength()); 101 | for (int i = 0; i < length; i++) { 102 | try { 103 | String key = getStringFromFREObject(keys.getObjectAt((long)i)); 104 | String value = getStringFromFREObject(values.getObjectAt((long)i)); 105 | result.putString(key, value); 106 | } 107 | catch (Exception e) { 108 | e.printStackTrace(); 109 | } 110 | } 111 | } 112 | catch (Exception e) { 113 | e.printStackTrace(); 114 | return null; 115 | } 116 | 117 | return result; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/InitFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import com.adobe.fre.FREContext; 19 | import com.adobe.fre.FREObject; 20 | import com.flurry.android.FlurryAgent; 21 | import com.flurry.android.FlurryAgentListener; 22 | import com.freshplanet.ane.AirFlurry.Constants; 23 | 24 | import static android.util.Log.VERBOSE; 25 | 26 | public class InitFunction extends BaseFunction { 27 | 28 | @Override 29 | public FREObject call(FREContext context, FREObject[] args) { 30 | 31 | super.call(context, args); 32 | 33 | final FREContext appContext = context; 34 | String apiKey = getStringFromFREObject(args[0]); 35 | String appVersion = getStringFromFREObject(args[1]); 36 | int continueSessionInMillis = getIntFromFREObject(args[2]); 37 | 38 | FlurryAgent.setVersionName(appVersion); 39 | new FlurryAgent.Builder() 40 | .withLogEnabled(true) 41 | .withCaptureUncaughtExceptions(true) 42 | .withContinueSessionMillis(continueSessionInMillis) 43 | .withLogEnabled(true) 44 | .withLogLevel(VERBOSE) 45 | .withListener(new FlurryAgentListener() { 46 | @Override 47 | public void onSessionStarted() { 48 | appContext.dispatchStatusEventAsync(Constants.AirFlurryEvent_SESSION_STARTED, ""); 49 | 50 | } 51 | }) 52 | .build(context.getActivity(), apiKey); 53 | 54 | 55 | 56 | return null; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/IsSessionOpenFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | 19 | import com.adobe.fre.FREContext; 20 | import com.adobe.fre.FREObject; 21 | import com.flurry.android.FlurryAgent; 22 | 23 | public class IsSessionOpenFunction extends BaseFunction { 24 | 25 | 26 | @Override 27 | public FREObject call(FREContext context, FREObject[] args) { 28 | 29 | super.call(context, args); 30 | 31 | try { 32 | return FREObject.newObject(FlurryAgent.isSessionActive()); 33 | } 34 | catch (Exception e) { 35 | e.printStackTrace(); 36 | return null; 37 | } 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/LogErrorFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import com.adobe.fre.FREContext; 19 | import com.adobe.fre.FREObject; 20 | import com.flurry.android.FlurryAgent; 21 | 22 | 23 | public class LogErrorFunction extends BaseFunction { 24 | 25 | @Override 26 | public FREObject call(FREContext context, FREObject[] args) { 27 | super.call(context, args); 28 | 29 | String errorId = getStringFromFREObject(args[0]); 30 | String message = getStringFromFREObject(args[1]); 31 | FlurryAgent.onError(errorId, message, ""); 32 | 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/LogEventFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import java.util.HashMap; 19 | import java.util.List; 20 | 21 | 22 | import com.adobe.fre.FREArray; 23 | import com.adobe.fre.FREContext; 24 | import com.adobe.fre.FREObject; 25 | import com.flurry.android.FlurryAgent; 26 | 27 | public class LogEventFunction extends BaseFunction { 28 | 29 | @Override 30 | public FREObject call(FREContext context, FREObject[] args) { 31 | super.call(context, args); 32 | 33 | 34 | String eventName = getStringFromFREObject(args[0]); 35 | HashMap params = new HashMap(); 36 | 37 | if ( args.length == 3 ) { 38 | List paramsKeys = getListOfStringFromFREArray((FREArray) args[1]); 39 | List paramsValues = getListOfStringFromFREArray((FREArray) args[2]); 40 | 41 | for(int i = 0; i < paramsKeys.size(); i++){ 42 | String key = paramsKeys.get(i); 43 | String value = paramsValues.get(i); 44 | params.put(key, value); 45 | } 46 | } 47 | 48 | if (params.size() > 0) { 49 | FlurryAgent.logEvent(eventName, params); 50 | } else { 51 | FlurryAgent.logEvent(eventName); 52 | } 53 | 54 | return null; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/LogPageViewFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import com.adobe.fre.FREContext; 19 | import com.adobe.fre.FREObject; 20 | import com.flurry.android.FlurryAgent; 21 | 22 | 23 | public class LogPageViewFunction extends BaseFunction { 24 | 25 | @Override 26 | public FREObject call(FREContext context, FREObject[] args) { 27 | super.call(context, args); 28 | 29 | FlurryAgent.onPageView(); 30 | 31 | return null; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/SetLocationFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import com.adobe.fre.FREContext; 19 | import com.adobe.fre.FREObject; 20 | import com.flurry.android.FlurryAgent; 21 | 22 | public class SetLocationFunction extends BaseFunction { 23 | 24 | 25 | @Override 26 | public FREObject call(FREContext context, FREObject[] args) { 27 | super.call(context, args); 28 | 29 | float latitude = (float) getDoubleFromFREObject(args[0]); 30 | float longitude = (float) getDoubleFromFREObject(args[1]); 31 | FlurryAgent.setLocation(latitude, longitude); 32 | return null; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/SetUserAgeFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | 19 | import com.adobe.fre.FREContext; 20 | import com.adobe.fre.FREObject; 21 | import com.flurry.android.FlurryAgent; 22 | 23 | public class SetUserAgeFunction extends BaseFunction { 24 | 25 | @Override 26 | public FREObject call(FREContext context, FREObject[] args) { 27 | super.call(context, args); 28 | 29 | int age = getIntFromFREObject(args[0]); 30 | FlurryAgent.setAge(age); 31 | 32 | return null; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/SetUserGenderFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import android.util.Log; 19 | 20 | import com.adobe.fre.FREContext; 21 | import com.adobe.fre.FREObject; 22 | import com.flurry.android.Constants; 23 | import com.flurry.android.FlurryAgent; 24 | 25 | public class SetUserGenderFunction extends BaseFunction { 26 | 27 | @Override 28 | public FREObject call(FREContext context, FREObject[] args) { 29 | super.call(context, args); 30 | 31 | byte gender = 0; 32 | String genderString = getStringFromFREObject(args[0]); 33 | if (genderString.compareTo("m") == 0) { 34 | gender = Constants.MALE; 35 | } 36 | else if (genderString.compareTo("f") == 0) { 37 | gender = Constants.FEMALE; 38 | } 39 | FlurryAgent.setGender(gender); 40 | 41 | return null; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/SetUserIdFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | import com.adobe.fre.FREContext; 19 | import com.adobe.fre.FREObject; 20 | import com.flurry.android.FlurryAgent; 21 | 22 | public class SetUserIdFunction extends BaseFunction { 23 | 24 | 25 | @Override 26 | public FREObject call(FREContext context, FREObject[] args) { 27 | 28 | super.call(context, args); 29 | 30 | String userId = getStringFromFREObject(args[0]); 31 | FlurryAgent.setUserId(userId); 32 | 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/StartTimedEventFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | 19 | import com.adobe.fre.FREArray; 20 | import com.adobe.fre.FREContext; 21 | import com.adobe.fre.FREObject; 22 | import com.flurry.android.FlurryAgent; 23 | 24 | import java.util.HashMap; 25 | import java.util.List; 26 | 27 | public class StartTimedEventFunction extends BaseFunction { 28 | 29 | 30 | @Override 31 | public FREObject call(FREContext context, FREObject[] args) { 32 | super.call(context, args); 33 | 34 | String eventName = getStringFromFREObject(args[0]); 35 | HashMap params = new HashMap(); 36 | 37 | if ( args.length == 3 ) { 38 | List paramsKeys = getListOfStringFromFREArray((FREArray) args[1]); 39 | List paramsValues = getListOfStringFromFREArray((FREArray) args[2]); 40 | 41 | for(int i = 0; i < paramsKeys.size(); i++){ 42 | String key = paramsKeys.get(i); 43 | String value = paramsValues.get(i); 44 | params.put(key, value); 45 | } 46 | } 47 | 48 | if (params.size() > 0) { 49 | FlurryAgent.logEvent(eventName, params, true); 50 | } else { 51 | FlurryAgent.logEvent(eventName, true); 52 | } 53 | 54 | return null; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /android/lib/src/main/java/com/freshplanet/ane/AirFlurry/functions/StopTimedEventFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package com.freshplanet.ane.AirFlurry.functions; 17 | 18 | 19 | import com.adobe.fre.FREArray; 20 | import com.adobe.fre.FREContext; 21 | import com.adobe.fre.FREObject; 22 | import com.flurry.android.FlurryAgent; 23 | 24 | import java.util.HashMap; 25 | import java.util.List; 26 | 27 | public class StopTimedEventFunction extends BaseFunction { 28 | 29 | 30 | @Override 31 | public FREObject call(FREContext context, FREObject[] args) { 32 | super.call(context, args); 33 | 34 | String eventName = getStringFromFREObject(args[0]); 35 | HashMap params = new HashMap(); 36 | 37 | if ( args.length == 3 ) { 38 | List paramsKeys = getListOfStringFromFREArray((FREArray) args[1]); 39 | List paramsValues = getListOfStringFromFREArray((FREArray) args[2]); 40 | 41 | for(int i = 0; i < paramsKeys.size(); i++){ 42 | String key = paramsKeys.get(i); 43 | String value = paramsValues.get(i); 44 | params.put(key, value); 45 | } 46 | } 47 | 48 | if (params.size() > 0) { 49 | FlurryAgent.endTimedEvent(eventName, params); 50 | } else { 51 | FlurryAgent.endTimedEvent(eventName); 52 | } 53 | 54 | 55 | return null; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /android/lib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | lib 3 | 4 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':lib' 2 | -------------------------------------------------------------------------------- /bin/AirFlurry.ane: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/bin/AirFlurry.ane -------------------------------------------------------------------------------- /build/ant-contrib-0.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/build/ant-contrib-0.6.jar -------------------------------------------------------------------------------- /build/build.xml: -------------------------------------------------------------------------------- 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 | 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 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /build/example.build.config: -------------------------------------------------------------------------------- 1 | name = AirFlurry 2 | 3 | air.sdk.home = /path/to/your/airsdk/folder 4 | 5 | ios.sdkversion = iphoneos 6 | 7 | android.sdk.home = /path/to/your/android-sdk -------------------------------------------------------------------------------- /build/extension.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | com.freshplanet.ane.AirFlurry 18 | 1.0 19 | 20 | 21 | 22 | libAirFlurry.a 23 | AirFlurryInitializer 24 | AirFlurryFinalizer 25 | 26 | 27 | 28 | 29 | 30 | libAirFlurry.jar 31 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 32 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 33 | 34 | 35 | 36 | 37 | 38 | libAirFlurry.jar 39 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 40 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 41 | 42 | 43 | 44 | 45 | 46 | libAirFlurry.jar 47 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 48 | com.freshplanet.ane.AirFlurry.AirFlurryExtension 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /build/platform-android.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | analytics-11.0.0.jar 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /build/platform-ios.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 10.0 17 | 18 | 19 | 20 | 21 | 22 | libFlurry-iOS-SDK.a 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/AirFlurry.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8BFDFD223D37D3FEC7EA1D2F /* libPods-AirFlurry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 641A9572240E4482355A2478 /* libPods-AirFlurry.a */; }; 11 | A2EF58CA1F1D5D7A009FB49A /* FPANEUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = A2EF58C91F1D5D7A009FB49A /* FPANEUtils.m */; }; 12 | A2EF58CD1F1D5F1F009FB49A /* AirFlurry.m in Sources */ = {isa = PBXBuildFile; fileRef = A2EF58CC1F1D5F1F009FB49A /* AirFlurry.m */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | A2EF58B91F1D5D0A009FB49A /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/$(PRODUCT_NAME)"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | ); 23 | runOnlyForDeploymentPostprocessing = 0; 24 | }; 25 | /* End PBXCopyFilesBuildPhase section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 641A9572240E4482355A2478 /* libPods-AirFlurry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AirFlurry.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | A23BE2B81F334AE3003B97D1 /* libgcc_s.1.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libgcc_s.1.tbd; path = usr/lib/libgcc_s.1.tbd; sourceTree = SDKROOT; }; 30 | A2C49B1E1F1E6FDE00925030 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 31 | A2EF58BB1F1D5D0A009FB49A /* libAirFlurry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAirFlurry.a; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | A2EF58C71F1D5D5C009FB49A /* FlashRuntimeExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlashRuntimeExtensions.h; sourceTree = ""; }; 33 | A2EF58C81F1D5D7A009FB49A /* FPANEUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FPANEUtils.h; sourceTree = ""; }; 34 | A2EF58C91F1D5D7A009FB49A /* FPANEUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FPANEUtils.m; sourceTree = ""; }; 35 | A2EF58CB1F1D5F1F009FB49A /* AirFlurry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirFlurry.h; sourceTree = ""; }; 36 | A2EF58CC1F1D5F1F009FB49A /* AirFlurry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AirFlurry.m; sourceTree = ""; }; 37 | AAFAAD538FA8A82001E66296 /* Pods-AirFlurry.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AirFlurry.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry.debug.xcconfig"; sourceTree = ""; }; 38 | FD728D01166DF8A6E02206BB /* Pods-AirFlurry.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AirFlurry.release.xcconfig"; path = "Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry.release.xcconfig"; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | A2EF58B81F1D5D0A009FB49A /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | 8BFDFD223D37D3FEC7EA1D2F /* libPods-AirFlurry.a in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 2C5391C97CF62377388BB97F /* Pods */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | AAFAAD538FA8A82001E66296 /* Pods-AirFlurry.debug.xcconfig */, 57 | FD728D01166DF8A6E02206BB /* Pods-AirFlurry.release.xcconfig */, 58 | ); 59 | name = Pods; 60 | sourceTree = ""; 61 | }; 62 | A2EF58B21F1D5D0A009FB49A = { 63 | isa = PBXGroup; 64 | children = ( 65 | A2EF58C71F1D5D5C009FB49A /* FlashRuntimeExtensions.h */, 66 | A2EF58C81F1D5D7A009FB49A /* FPANEUtils.h */, 67 | A2EF58C91F1D5D7A009FB49A /* FPANEUtils.m */, 68 | A2EF58BD1F1D5D0B009FB49A /* AirFlurry */, 69 | A2EF58BC1F1D5D0B009FB49A /* Products */, 70 | 2C5391C97CF62377388BB97F /* Pods */, 71 | D56C45783F5A0E04E74D64BE /* Frameworks */, 72 | ); 73 | sourceTree = ""; 74 | }; 75 | A2EF58BC1F1D5D0B009FB49A /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | A2EF58BB1F1D5D0A009FB49A /* libAirFlurry.a */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | A2EF58BD1F1D5D0B009FB49A /* AirFlurry */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | A2C49B1E1F1E6FDE00925030 /* Constants.h */, 87 | A2EF58CB1F1D5F1F009FB49A /* AirFlurry.h */, 88 | A2EF58CC1F1D5F1F009FB49A /* AirFlurry.m */, 89 | ); 90 | path = AirFlurry; 91 | sourceTree = ""; 92 | }; 93 | D56C45783F5A0E04E74D64BE /* Frameworks */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | A23BE2B81F334AE3003B97D1 /* libgcc_s.1.tbd */, 97 | 641A9572240E4482355A2478 /* libPods-AirFlurry.a */, 98 | ); 99 | name = Frameworks; 100 | sourceTree = ""; 101 | }; 102 | /* End PBXGroup section */ 103 | 104 | /* Begin PBXNativeTarget section */ 105 | A2EF58BA1F1D5D0A009FB49A /* AirFlurry */ = { 106 | isa = PBXNativeTarget; 107 | buildConfigurationList = A2EF58C41F1D5D0B009FB49A /* Build configuration list for PBXNativeTarget "AirFlurry" */; 108 | buildPhases = ( 109 | 9F1241AD652A525686FF9655 /* [CP] Check Pods Manifest.lock */, 110 | A2EF58B71F1D5D0A009FB49A /* Sources */, 111 | A2EF58B81F1D5D0A009FB49A /* Frameworks */, 112 | A2EF58B91F1D5D0A009FB49A /* CopyFiles */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = AirFlurry; 119 | productName = AirFlurry; 120 | productReference = A2EF58BB1F1D5D0A009FB49A /* libAirFlurry.a */; 121 | productType = "com.apple.product-type.library.static"; 122 | }; 123 | /* End PBXNativeTarget section */ 124 | 125 | /* Begin PBXProject section */ 126 | A2EF58B31F1D5D0A009FB49A /* Project object */ = { 127 | isa = PBXProject; 128 | attributes = { 129 | LastUpgradeCheck = 0830; 130 | ORGANIZATIONNAME = "Mateo Kozomara"; 131 | TargetAttributes = { 132 | A2EF58BA1F1D5D0A009FB49A = { 133 | CreatedOnToolsVersion = 8.3.3; 134 | DevelopmentTeam = HWKC8H7H6U; 135 | ProvisioningStyle = Automatic; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = A2EF58B61F1D5D0A009FB49A /* Build configuration list for PBXProject "AirFlurry" */; 140 | compatibilityVersion = "Xcode 3.2"; 141 | developmentRegion = English; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | ); 146 | mainGroup = A2EF58B21F1D5D0A009FB49A; 147 | productRefGroup = A2EF58BC1F1D5D0B009FB49A /* Products */; 148 | projectDirPath = ""; 149 | projectRoot = ""; 150 | targets = ( 151 | A2EF58BA1F1D5D0A009FB49A /* AirFlurry */, 152 | ); 153 | }; 154 | /* End PBXProject section */ 155 | 156 | /* Begin PBXShellScriptBuildPhase section */ 157 | 9F1241AD652A525686FF9655 /* [CP] Check Pods Manifest.lock */ = { 158 | isa = PBXShellScriptBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | ); 162 | inputPaths = ( 163 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 164 | "${PODS_ROOT}/Manifest.lock", 165 | ); 166 | name = "[CP] Check Pods Manifest.lock"; 167 | outputPaths = ( 168 | "$(DERIVED_FILE_DIR)/Pods-AirFlurry-checkManifestLockResult.txt", 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | shellPath = /bin/sh; 172 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 173 | showEnvVarsInLog = 0; 174 | }; 175 | /* End PBXShellScriptBuildPhase section */ 176 | 177 | /* Begin PBXSourcesBuildPhase section */ 178 | A2EF58B71F1D5D0A009FB49A /* Sources */ = { 179 | isa = PBXSourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | A2EF58CD1F1D5F1F009FB49A /* AirFlurry.m in Sources */, 183 | A2EF58CA1F1D5D7A009FB49A /* FPANEUtils.m in Sources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXSourcesBuildPhase section */ 188 | 189 | /* Begin XCBuildConfiguration section */ 190 | A2EF58C21F1D5D0B009FB49A /* Debug */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_ANALYZER_NONNULL = YES; 195 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 196 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 197 | CLANG_CXX_LIBRARY = "libc++"; 198 | CLANG_ENABLE_MODULES = YES; 199 | CLANG_ENABLE_OBJC_ARC = YES; 200 | CLANG_WARN_BOOL_CONVERSION = YES; 201 | CLANG_WARN_CONSTANT_CONVERSION = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 204 | CLANG_WARN_EMPTY_BODY = YES; 205 | CLANG_WARN_ENUM_CONVERSION = YES; 206 | CLANG_WARN_INFINITE_RECURSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 209 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 210 | CLANG_WARN_UNREACHABLE_CODE = YES; 211 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 212 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 213 | COPY_PHASE_STRIP = NO; 214 | DEBUG_INFORMATION_FORMAT = dwarf; 215 | ENABLE_STRICT_OBJC_MSGSEND = YES; 216 | ENABLE_TESTABILITY = YES; 217 | GCC_C_LANGUAGE_STANDARD = gnu99; 218 | GCC_DYNAMIC_NO_PIC = NO; 219 | GCC_NO_COMMON_BLOCKS = YES; 220 | GCC_OPTIMIZATION_LEVEL = 0; 221 | GCC_PREPROCESSOR_DEFINITIONS = ( 222 | "DEBUG=1", 223 | "$(inherited)", 224 | ); 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 232 | MTL_ENABLE_DEBUG_INFO = YES; 233 | ONLY_ACTIVE_ARCH = YES; 234 | SDKROOT = iphoneos; 235 | }; 236 | name = Debug; 237 | }; 238 | A2EF58C31F1D5D0B009FB49A /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | CLANG_ANALYZER_NONNULL = YES; 243 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 244 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 245 | CLANG_CXX_LIBRARY = "libc++"; 246 | CLANG_ENABLE_MODULES = YES; 247 | CLANG_ENABLE_OBJC_ARC = YES; 248 | CLANG_WARN_BOOL_CONVERSION = YES; 249 | CLANG_WARN_CONSTANT_CONVERSION = YES; 250 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 251 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INFINITE_RECURSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 258 | CLANG_WARN_UNREACHABLE_CODE = YES; 259 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 260 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 261 | COPY_PHASE_STRIP = NO; 262 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 263 | ENABLE_NS_ASSERTIONS = NO; 264 | ENABLE_STRICT_OBJC_MSGSEND = YES; 265 | GCC_C_LANGUAGE_STANDARD = gnu99; 266 | GCC_NO_COMMON_BLOCKS = YES; 267 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 269 | GCC_WARN_UNDECLARED_SELECTOR = YES; 270 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 271 | GCC_WARN_UNUSED_FUNCTION = YES; 272 | GCC_WARN_UNUSED_VARIABLE = YES; 273 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 274 | MTL_ENABLE_DEBUG_INFO = NO; 275 | SDKROOT = iphoneos; 276 | VALIDATE_PRODUCT = YES; 277 | }; 278 | name = Release; 279 | }; 280 | A2EF58C51F1D5D0B009FB49A /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | baseConfigurationReference = AAFAAD538FA8A82001E66296 /* Pods-AirFlurry.debug.xcconfig */; 283 | buildSettings = { 284 | DEVELOPMENT_TEAM = HWKC8H7H6U; 285 | LIBRARY_SEARCH_PATHS = ( 286 | "$(inherited)", 287 | "$(PROJECT_DIR)/Pods/Flurry-iOS-SDK/Flurry", 288 | ); 289 | OTHER_LDFLAGS = "-ObjC"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | SKIP_INSTALL = YES; 292 | }; 293 | name = Debug; 294 | }; 295 | A2EF58C61F1D5D0B009FB49A /* Release */ = { 296 | isa = XCBuildConfiguration; 297 | baseConfigurationReference = FD728D01166DF8A6E02206BB /* Pods-AirFlurry.release.xcconfig */; 298 | buildSettings = { 299 | DEVELOPMENT_TEAM = HWKC8H7H6U; 300 | LIBRARY_SEARCH_PATHS = ( 301 | "$(inherited)", 302 | "$(PROJECT_DIR)/Pods/Flurry-iOS-SDK/Flurry", 303 | ); 304 | OTHER_LDFLAGS = "-ObjC"; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SKIP_INSTALL = YES; 307 | }; 308 | name = Release; 309 | }; 310 | /* End XCBuildConfiguration section */ 311 | 312 | /* Begin XCConfigurationList section */ 313 | A2EF58B61F1D5D0A009FB49A /* Build configuration list for PBXProject "AirFlurry" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | A2EF58C21F1D5D0B009FB49A /* Debug */, 317 | A2EF58C31F1D5D0B009FB49A /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | defaultConfigurationName = Release; 321 | }; 322 | A2EF58C41F1D5D0B009FB49A /* Build configuration list for PBXNativeTarget "AirFlurry" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | A2EF58C51F1D5D0B009FB49A /* Debug */, 326 | A2EF58C61F1D5D0B009FB49A /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | /* End XCConfigurationList section */ 332 | }; 333 | rootObject = A2EF58B31F1D5D0A009FB49A /* Project object */; 334 | } 335 | -------------------------------------------------------------------------------- /ios/AirFlurry.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/AirFlurry.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/AirFlurry.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/AirFlurry/AirFlurry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | #import 18 | #import "Flurry.h" 19 | #import "FPANEUtils.h" 20 | 21 | 22 | @interface AirFlurry : NSObject { 23 | FREContext _context; 24 | } 25 | 26 | @end 27 | 28 | void AirFlurryContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet); 29 | void AirFlurryContextFinalizer(FREContext ctx); 30 | void AirFlurryInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet); 31 | void AirFlurryFinalizer(void *extData); 32 | -------------------------------------------------------------------------------- /ios/AirFlurry/AirFlurry.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #import "AirFlurry.h" 17 | #import "Constants.h" 18 | 19 | @interface AirFlurry () 20 | @property (nonatomic, readonly) FREContext context; 21 | @end 22 | 23 | 24 | @implementation AirFlurry 25 | 26 | 27 | - (instancetype)initWithContext:(FREContext)extensionContext { 28 | 29 | if ((self = [super init])) { 30 | 31 | _context = extensionContext; 32 | } 33 | 34 | return self; 35 | } 36 | 37 | 38 | -(void)flurrySessionDidCreateWithInfo:(NSDictionary *)info { 39 | 40 | [self sendEvent:kAirFlurryEvent_SESSION_STARTED]; 41 | } 42 | 43 | 44 | #pragma mark - Other 45 | 46 | - (void) sendLog:(NSString*)log { 47 | [self sendEvent:@"log" level:log]; 48 | } 49 | 50 | - (void) sendEvent:(NSString*)code { 51 | [self sendEvent:code level:@""]; 52 | } 53 | 54 | - (void) sendEvent:(NSString*)code level:(NSString*)level { 55 | FREDispatchStatusEventAsync(_context, (const uint8_t*)[code UTF8String], (const uint8_t*)[level UTF8String]); 56 | } 57 | 58 | @end 59 | 60 | AirFlurry* GetAirFlurryContextNativeData(FREContext context) { 61 | 62 | CFTypeRef controller; 63 | FREGetContextNativeData(context, (void**)&controller); 64 | return (__bridge AirFlurry*)controller; 65 | } 66 | 67 | #pragma mark - C interface - Flurry setup 68 | 69 | DEFINE_ANE_FUNCTION(initFlurry) { 70 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 71 | 72 | if (!controller) 73 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 74 | 75 | @try { 76 | NSString *apiKey = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 77 | NSString *appVersion = AirFlurry_FPANE_FREObjectToNSString(argv[1]); 78 | NSInteger continueSessionInSeconds = (NSInteger) AirFlurry_FPANE_FREObjectToInt(argv[1]) / 1000; // value sent is in millis 79 | 80 | [Flurry setDelegate:controller]; 81 | 82 | FlurrySessionBuilder* builder = [[[[[FlurrySessionBuilder new] 83 | withLogLevel:FlurryLogLevelAll] 84 | withCrashReporting:NO] 85 | withSessionContinueSeconds:continueSessionInSeconds] 86 | withAppVersion:appVersion]; 87 | 88 | [Flurry startSession:apiKey withSessionBuilder:builder]; 89 | 90 | 91 | } 92 | @catch (NSException *exception) { 93 | [controller sendLog:[@"Exception occured while trying to init Flurry : " stringByAppendingString:exception.reason]]; 94 | } 95 | 96 | return nil; 97 | } 98 | 99 | 100 | DEFINE_ANE_FUNCTION(logEvent) { 101 | 102 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 103 | 104 | if (!controller) 105 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 106 | 107 | @try { 108 | NSString *eventName = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 109 | NSMutableDictionary *params = nil; 110 | if (argc > 1 && argv[1] != NULL && argv[2] != NULL && argv[1] != nil && argv[2] != NULL) { 111 | params = [[NSMutableDictionary alloc] init]; 112 | NSArray *arrayKeys = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[1]); 113 | NSArray *arrayValues = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[2]); 114 | int i; 115 | for (i = 0; i < [arrayKeys count]; i++) { 116 | NSString *key = [arrayKeys objectAtIndex:i]; 117 | NSString *value = [arrayValues objectAtIndex:i]; 118 | [params setValue:value forKey:key]; 119 | } 120 | } 121 | 122 | if (params != nil && params.count > 0) { 123 | [Flurry logEvent:eventName withParameters:params]; 124 | } 125 | else { 126 | [Flurry logEvent:eventName]; 127 | } 128 | 129 | } 130 | @catch (NSException *exception) { 131 | [controller sendLog:[@"Exception occured while trying to logEvent : " stringByAppendingString:exception.reason]]; 132 | } 133 | 134 | return nil; 135 | } 136 | 137 | DEFINE_ANE_FUNCTION(logError) { 138 | 139 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 140 | 141 | if (!controller) 142 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 143 | 144 | @try { 145 | NSString *errorId = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 146 | NSString *message = AirFlurry_FPANE_FREObjectToNSString(argv[1]); 147 | 148 | [Flurry logError:errorId message:message error:nil]; 149 | 150 | } 151 | @catch (NSException *exception) { 152 | [controller sendLog:[@"Exception occured while trying to logError : " stringByAppendingString:exception.reason]]; 153 | } 154 | 155 | 156 | return nil; 157 | } 158 | 159 | DEFINE_ANE_FUNCTION(setLocation) { 160 | 161 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 162 | 163 | if (!controller) 164 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 165 | 166 | @try { 167 | 168 | double latitude = AirFlurry_FPANE_FREObjectToDouble(argv[0]); 169 | double longitude = AirFlurry_FPANE_FREObjectToDouble(argv[1]); 170 | float horizontalAccuracy = (float) AirFlurry_FPANE_FREObjectToDouble(argv[2]); 171 | float verticalAccuracy = (float) AirFlurry_FPANE_FREObjectToDouble(argv[3]); 172 | [Flurry setLatitude:latitude 173 | longitude:longitude 174 | horizontalAccuracy:horizontalAccuracy 175 | verticalAccuracy:verticalAccuracy]; 176 | 177 | } 178 | @catch (NSException *exception) { 179 | [controller sendLog:[@"Exception occured while trying to setLocation : " stringByAppendingString:exception.reason]]; 180 | } 181 | 182 | 183 | return nil; 184 | } 185 | 186 | DEFINE_ANE_FUNCTION(setUserId) { 187 | 188 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 189 | 190 | if (!controller) 191 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 192 | 193 | @try { 194 | NSString *userId = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 195 | [Flurry setUserID:userId]; 196 | } 197 | @catch (NSException *exception) { 198 | [controller sendLog:[@"Exception occured while trying to setUserId : " stringByAppendingString:exception.reason]]; 199 | } 200 | 201 | return nil; 202 | } 203 | 204 | DEFINE_ANE_FUNCTION(setUserAge) { 205 | 206 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 207 | 208 | if (!controller) 209 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 210 | 211 | @try { 212 | NSInteger userAge = AirFlurry_FPANE_FREObjectToInt(argv[0]); 213 | [Flurry setAge: (int) userAge]; 214 | } 215 | @catch (NSException *exception) { 216 | [controller sendLog:[@"Exception occured while trying to setUserAge : " stringByAppendingString:exception.reason]]; 217 | } 218 | 219 | 220 | 221 | return nil; 222 | } 223 | 224 | DEFINE_ANE_FUNCTION(setUserGender) { 225 | 226 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 227 | 228 | if (!controller) 229 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 230 | 231 | @try { 232 | NSString *userGender = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 233 | [Flurry setGender:userGender]; 234 | } 235 | @catch (NSException *exception) { 236 | [controller sendLog:[@"Exception occured while trying to setUserGender : " stringByAppendingString:exception.reason]]; 237 | } 238 | 239 | return nil; 240 | } 241 | 242 | DEFINE_ANE_FUNCTION(setSessionReportsOnCloseEnabled) { 243 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 244 | 245 | if (!controller) 246 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 247 | 248 | @try { 249 | BOOL enabled = AirFlurry_FPANE_FREObjectToBool(argv[0]); 250 | [Flurry setSessionReportsOnCloseEnabled:enabled]; 251 | } 252 | @catch (NSException *exception) { 253 | [controller sendLog:[@"Exception occured while trying to setSessionReportsOnCloseEnabled : " stringByAppendingString:exception.reason]]; 254 | } 255 | 256 | return nil; 257 | } 258 | 259 | DEFINE_ANE_FUNCTION(setSessionReportsOnPauseEnabled) { 260 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 261 | 262 | if (!controller) 263 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 264 | 265 | @try { 266 | BOOL enabled = AirFlurry_FPANE_FREObjectToBool(argv[0]); 267 | [Flurry setSessionReportsOnPauseEnabled:enabled]; 268 | } 269 | @catch (NSException *exception) { 270 | [controller sendLog:[@"Exception occured while trying to setSessionReportsOnPauseEnabled : " stringByAppendingString:exception.reason]]; 271 | } 272 | 273 | return nil; 274 | } 275 | 276 | DEFINE_ANE_FUNCTION(setBackgroundSessionEnabled) { 277 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 278 | 279 | if (!controller) 280 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 281 | 282 | @try { 283 | BOOL enabled = AirFlurry_FPANE_FREObjectToBool(argv[0]); 284 | [Flurry setBackgroundSessionEnabled:enabled]; 285 | } 286 | @catch (NSException *exception) { 287 | [controller sendLog:[@"Exception occured while trying to setBackgroundSessionEnabled : " stringByAppendingString:exception.reason]]; 288 | } 289 | 290 | return nil; 291 | } 292 | 293 | DEFINE_ANE_FUNCTION(pauseBackgroundSession) { 294 | [Flurry pauseBackgroundSession]; 295 | return nil; 296 | } 297 | 298 | DEFINE_ANE_FUNCTION(logPageView) { 299 | [Flurry logPageView]; 300 | return nil; 301 | } 302 | 303 | DEFINE_ANE_FUNCTION(startTimedEvent) { 304 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 305 | 306 | if (!controller) 307 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 308 | 309 | @try { 310 | NSString *eventName = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 311 | NSMutableDictionary *params = nil; 312 | if (argc > 1 && argv[1] != NULL && argv[2] != NULL && argv[1] != nil && argv[2] != NULL) { 313 | params = [[NSMutableDictionary alloc] init]; 314 | NSArray *arrayKeys = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[1]); 315 | NSArray *arrayValues = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[2]); 316 | int i; 317 | for (i = 0; i < [arrayKeys count]; i++) { 318 | NSString *key = [arrayKeys objectAtIndex:i]; 319 | NSString *value = [arrayValues objectAtIndex:i]; 320 | [params setValue:value forKey:key]; 321 | } 322 | } 323 | 324 | if (params != nil && params.count > 0) { 325 | [Flurry logEvent:eventName withParameters:params timed:YES]; 326 | } 327 | else { 328 | [Flurry logEvent:eventName timed:YES]; 329 | } 330 | 331 | } 332 | @catch (NSException *exception) { 333 | [controller sendLog:[@"Exception occured while trying to startTimedEvent : " stringByAppendingString:exception.reason]]; 334 | } 335 | 336 | return nil; 337 | } 338 | 339 | DEFINE_ANE_FUNCTION(stopTimedEvent) { 340 | 341 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 342 | 343 | if (!controller) 344 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 345 | 346 | @try { 347 | NSString *eventName = AirFlurry_FPANE_FREObjectToNSString(argv[0]); 348 | NSMutableDictionary *params = nil; 349 | if (argc > 1 && argv[1] != NULL && argv[2] != NULL && argv[1] != nil && argv[2] != NULL){ 350 | params = [[NSMutableDictionary alloc] init]; 351 | NSArray *arrayKeys = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[1]); 352 | NSArray *arrayValues = AirFlurry_FPANE_FREObjectToNSArrayOfNSString(argv[2]); 353 | int i; 354 | for (i = 0; i < [arrayKeys count]; i++) { 355 | NSString *key = [arrayKeys objectAtIndex:i]; 356 | NSString *value = [arrayValues objectAtIndex:i]; 357 | [params setValue:value forKey:key]; 358 | } 359 | } 360 | 361 | if (params != nil && params.count > 0){ 362 | [Flurry endTimedEvent:eventName withParameters:params]; 363 | } 364 | else{ 365 | [Flurry endTimedEvent:eventName withParameters:nil]; 366 | } 367 | 368 | } 369 | @catch (NSException *exception) { 370 | [controller sendLog:[@"Exception occured while trying to stopTimedEvent : " stringByAppendingString:exception.reason]]; 371 | } 372 | 373 | 374 | return NULL; 375 | } 376 | 377 | DEFINE_ANE_FUNCTION(isSessionOpen) { 378 | 379 | AirFlurry* controller = GetAirFlurryContextNativeData(context); 380 | 381 | if (!controller) 382 | return AirFlurry_FPANE_CreateError(@"context's AirFlurry is null", 0); 383 | 384 | @try { 385 | return AirFlurry_FPANE_BOOLToFREObject([Flurry activeSessionExists]); 386 | } 387 | @catch (NSException *exception) { 388 | [controller sendLog:[@"Exception occured while trying to check for open session : " stringByAppendingString:exception.reason]]; 389 | } 390 | 391 | 392 | return AirFlurry_FPANE_BOOLToFREObject(NO); 393 | } 394 | 395 | #pragma mark - ANE setup 396 | 397 | void AirFlurryContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, 398 | uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet) { 399 | 400 | AirFlurry* controller = [[AirFlurry alloc] initWithContext:ctx]; 401 | FRESetContextNativeData(ctx, (void*)CFBridgingRetain(controller)); 402 | 403 | static FRENamedFunction functions[] = { 404 | MAP_FUNCTION(initFlurry, NULL), 405 | MAP_FUNCTION(logEvent, NULL), 406 | MAP_FUNCTION(logError, NULL), 407 | MAP_FUNCTION(setLocation, NULL), 408 | MAP_FUNCTION(setUserId, NULL), 409 | MAP_FUNCTION(setUserAge, NULL), 410 | MAP_FUNCTION(setUserGender, NULL), 411 | MAP_FUNCTION(startTimedEvent, NULL), 412 | MAP_FUNCTION(stopTimedEvent, NULL), 413 | MAP_FUNCTION(setSessionReportsOnCloseEnabled, NULL), 414 | MAP_FUNCTION(setSessionReportsOnPauseEnabled, NULL), 415 | MAP_FUNCTION(setBackgroundSessionEnabled, NULL), 416 | MAP_FUNCTION(pauseBackgroundSession, NULL), 417 | MAP_FUNCTION(logPageView, NULL), 418 | MAP_FUNCTION(isSessionOpen, NULL), 419 | }; 420 | 421 | *numFunctionsToTest = sizeof(functions) / sizeof(FRENamedFunction); 422 | *functionsToSet = functions; 423 | 424 | } 425 | 426 | void AirFlurryContextFinalizer(FREContext ctx) { 427 | CFTypeRef controller; 428 | FREGetContextNativeData(ctx, (void **)&controller); 429 | CFBridgingRelease(controller); 430 | } 431 | 432 | void AirFlurryInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet ) { 433 | *extDataToSet = NULL; 434 | *ctxInitializerToSet = &AirFlurryContextInitializer; 435 | *ctxFinalizerToSet = &AirFlurryContextFinalizer; 436 | } 437 | 438 | void AirFlurryFinalizer(void *extData) {} 439 | -------------------------------------------------------------------------------- /ios/AirFlurry/Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | #ifndef Constants_h 17 | #define Constants_h 18 | 19 | 20 | #endif /* Constants_h */ 21 | 22 | static NSString *const kAirFlurryEvent_SESSION_STARTED = @"AirFlurryEvent_sessionStarted"; 23 | -------------------------------------------------------------------------------- /ios/FPANEUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | #import 16 | #import "FlashRuntimeExtensions.h" 17 | 18 | #define DEFINE_ANE_FUNCTION(fn) FREObject fn(FREContext context, void* functionData, uint32_t argc, FREObject argv[]) 19 | #define MAP_FUNCTION(fn, data) { (const uint8_t*)(#fn), (data), &(fn) } 20 | #define ROOT_VIEW_CONTROLLER [[[UIApplication sharedApplication] keyWindow] rootViewController] 21 | 22 | void AirFlurry_FPANE_DispatchEvent(FREContext context, NSString* eventName); 23 | void AirFlurry_FPANE_DispatchEventWithInfo(FREContext context, NSString* eventName, NSString* eventInfo); 24 | void AirFlurry_FPANE_Log(FREContext context, NSString* message); 25 | 26 | NSString* AirFlurry_FPANE_FREObjectToNSString(FREObject object); 27 | NSArray* AirFlurry_FPANE_FREObjectToNSArrayOfNSString(FREObject object); 28 | NSDictionary* AirFlurry_FPANE_FREObjectsToNSDictionaryOfNSString(FREObject keys, FREObject values); 29 | BOOL AirFlurry_FPANE_FREObjectToBool(FREObject object); 30 | NSInteger AirFlurry_FPANE_FREObjectToInt(FREObject object); 31 | double AirFlurry_FPANE_FREObjectToDouble(FREObject object); 32 | 33 | FREObject AirFlurry_FPANE_BOOLToFREObject(BOOL boolean); 34 | FREObject AirFlurry_FPANE_IntToFREObject(NSInteger i); 35 | FREObject AirFlurry_FPANE_DoubleToFREObject(double d); 36 | FREObject AirFlurry_FPANE_NSStringToFREObject(NSString* string); 37 | FREObject AirFlurry_FPANE_CreateError(NSString* error, NSInteger* id); 38 | -------------------------------------------------------------------------------- /ios/FPANEUtils.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | #import "FPANEUtils.h" 16 | 17 | #pragma mark - Dispatch events 18 | 19 | void AirFlurry_FPANE_DispatchEvent(FREContext context, NSString* eventName) { 20 | 21 | FREDispatchStatusEventAsync(context, (const uint8_t*) [eventName UTF8String], (const uint8_t*) ""); 22 | } 23 | 24 | void AirFlurry_FPANE_DispatchEventWithInfo(FREContext context, NSString* eventName, NSString* eventInfo) { 25 | 26 | FREDispatchStatusEventAsync(context, (const uint8_t*) [eventName UTF8String], (const uint8_t*) [eventInfo UTF8String]); 27 | } 28 | 29 | void AirFlurry_FPANE_Log(FREContext context, NSString* message) { 30 | 31 | AirFlurry_FPANE_DispatchEventWithInfo(context, @"LOGGING", message); 32 | } 33 | 34 | #pragma mark - FREObject -> Obj-C 35 | 36 | NSString* AirFlurry_FPANE_FREObjectToNSString(FREObject object) { 37 | 38 | uint32_t stringLength; 39 | const uint8_t* string; 40 | FREGetObjectAsUTF8(object, &stringLength, &string); 41 | return [NSString stringWithUTF8String:(char*) string]; 42 | } 43 | 44 | NSArray* AirFlurry_FPANE_FREObjectToNSArrayOfNSString(FREObject object) { 45 | 46 | uint32_t arrayLength; 47 | FREGetArrayLength(object, &arrayLength); 48 | 49 | uint32_t stringLength; 50 | NSMutableArray* mutableArray = [NSMutableArray arrayWithCapacity:arrayLength]; 51 | for (NSInteger i = 0; i < arrayLength; i++) { 52 | FREObject itemRaw; 53 | FREGetArrayElementAt(object, (uint) i, &itemRaw); 54 | 55 | // Convert item to string. Skip with warning if not possible. 56 | const uint8_t* itemString; 57 | if (FREGetObjectAsUTF8(itemRaw, &stringLength, &itemString) != FRE_OK) { 58 | NSLog(@"Couldn't convert FREObject to NSString at index %ld", (long) i); 59 | continue; 60 | } 61 | 62 | NSString* item = [NSString stringWithUTF8String:(char*) itemString]; 63 | [mutableArray addObject:item]; 64 | } 65 | 66 | return [NSArray arrayWithArray:mutableArray]; 67 | } 68 | 69 | NSDictionary* AirFlurry_FPANE_FREObjectsToNSDictionaryOfNSString(FREObject keys, FREObject values) { 70 | 71 | uint32_t numKeys, numValues; 72 | FREGetArrayLength(keys, &numKeys); 73 | FREGetArrayLength(values, &numValues); 74 | 75 | uint32_t stringLength; 76 | uint32_t numItems = MIN(numKeys, numValues); 77 | NSMutableDictionary* mutableDictionary = [NSMutableDictionary dictionaryWithCapacity:numItems]; 78 | for (NSInteger i = 0; i < numItems; i++) { 79 | FREObject keyRaw, valueRaw; 80 | FREGetArrayElementAt(keys, (uint) i, &keyRaw); 81 | FREGetArrayElementAt(values, (uint) i, &valueRaw); 82 | 83 | // Convert key and value to strings. Skip with warning if not possible. 84 | const uint8_t* keyString, * valueString; 85 | if (FREGetObjectAsUTF8(keyRaw, &stringLength, &keyString) != FRE_OK || FREGetObjectAsUTF8(valueRaw, &stringLength, &valueString) != FRE_OK) { 86 | NSLog(@"Couldn't convert FREObject to NSString at index %ld", (long) i); 87 | continue; 88 | } 89 | 90 | NSString* key = [NSString stringWithUTF8String:(char*) keyString]; 91 | NSString* value = [NSString stringWithUTF8String:(char*) valueString]; 92 | [mutableDictionary setObject:value forKey:key]; 93 | } 94 | 95 | return [NSDictionary dictionaryWithDictionary:mutableDictionary]; 96 | } 97 | 98 | BOOL AirFlurry_FPANE_FREObjectToBool(FREObject object) { 99 | 100 | uint32_t b; 101 | FREGetObjectAsBool(object, &b); 102 | return b != 0; 103 | } 104 | 105 | NSInteger AirFlurry_FPANE_FREObjectToInt(FREObject object) { 106 | 107 | int32_t i; 108 | FREGetObjectAsInt32(object, &i); 109 | return i; 110 | } 111 | 112 | double AirFlurry_FPANE_FREObjectToDouble(FREObject object) { 113 | 114 | double x; 115 | FREGetObjectAsDouble(object, &x); 116 | return x; 117 | } 118 | 119 | #pragma mark - Obj-C -> FREObject 120 | 121 | FREObject AirFlurry_FPANE_BOOLToFREObject(BOOL boolean) { 122 | 123 | FREObject result; 124 | FRENewObjectFromBool(boolean, &result); 125 | return result; 126 | } 127 | 128 | FREObject AirFlurry_FPANE_IntToFREObject(NSInteger i) { 129 | 130 | FREObject result; 131 | FRENewObjectFromInt32((int32_t) i, &result); 132 | return result; 133 | } 134 | 135 | FREObject AirFlurry_FPANE_DoubleToFREObject(double d) { 136 | 137 | FREObject result; 138 | FRENewObjectFromDouble(d, &result); 139 | return result; 140 | } 141 | 142 | FREObject AirFlurry_FPANE_NSStringToFREObject(NSString* string) { 143 | 144 | FREObject result; 145 | FRENewObjectFromUTF8((int) string.length, (const uint8_t*) [string UTF8String], &result); 146 | return result; 147 | } 148 | 149 | FREObject AirFlurry_FPANE_CreateError(NSString* error, NSInteger* id) { 150 | 151 | FREObject ret; 152 | FREObject errorThrown; 153 | 154 | FREObject freId; 155 | FRENewObjectFromInt32((int32_t) *id, &freId); 156 | FREObject argV[] = { 157 | AirFlurry_FPANE_NSStringToFREObject(error), 158 | freId 159 | }; 160 | FRENewObject((const uint8_t*) "Error", 2, argV, &ret, &errorThrown); 161 | 162 | return ret; 163 | } 164 | -------------------------------------------------------------------------------- /ios/FlashRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | // ADOBE CONFIDENTIAL 2 | // 3 | // Copyright 2011 Adobe Systems Incorporated All Rights Reserved. 4 | // 5 | // NOTICE: All information contained herein is, and remains the property of 6 | // Adobe Systems Incorporated and its suppliers, if any. The intellectual and 7 | // technical concepts contained herein are proprietary to Adobe Systems 8 | // Incorporated and its suppliers and may be covered by U.S. and Foreign 9 | // Patents, patents in process, and are protected by trade secret or copyright 10 | // law. Dissemination of this information or reproduction of this material 11 | // is strictly forbidden unless prior written permission is obtained from 12 | // Adobe Systems Incorporated. 13 | 14 | // AdobePatentID="P969" 15 | 16 | #ifdef WIN32 17 | typedef unsigned __int32 uint32_t; 18 | typedef unsigned __int8 uint8_t; 19 | typedef __int32 int32_t; 20 | #else 21 | #include 22 | #endif 23 | 24 | #ifndef FRNATIVEEXTENSIONS_H_ 25 | #define FRNATIVEEXTENSIONS_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef void * FREContext; 32 | typedef void * FREObject; 33 | 34 | /* Initialization *************************************************************/ 35 | 36 | /** 37 | * Defines the signature for native calls that can be invoked via an 38 | * instance of the AS ExtensionContext class. 39 | * 40 | * @return The return value corresponds to the return value 41 | * from the AS ExtensionContext class call() method. It defaults to 42 | * FRE_INVALID_OBJECT, which is reported as null in AS. 43 | */ 44 | 45 | typedef FREObject (*FREFunction)( 46 | FREContext ctx, 47 | void* functionData, 48 | uint32_t argc, 49 | FREObject argv[] 50 | ); 51 | 52 | typedef struct FRENamedFunction_ { 53 | const uint8_t* name; 54 | void* functionData; 55 | FREFunction function; 56 | } FRENamedFunction; 57 | 58 | /** 59 | * Defines the signature for the initializer that is called each time 60 | * a new AS ExtensionContext object is created. 61 | * 62 | * @param extData The extension client data provided to the FREInitializer function as extDataToSet. 63 | * 64 | * @param ctxType Pointer to the contextType string (UTF8) as provided to the AS createExtensionContext call. 65 | * 66 | * @param ctx The FREContext being initialized. 67 | * 68 | * @param numFunctionsToSet The number of elements in the functionsToSet array. 69 | * 70 | * @param functionsToSet A pointer to an array of FRENamedFunction elements. 71 | */ 72 | 73 | typedef void (*FREContextInitializer)( 74 | void* extData , 75 | const uint8_t* ctxType , 76 | FREContext ctx , 77 | uint32_t* numFunctionsToSet, 78 | const FRENamedFunction** functionsToSet 79 | ); 80 | 81 | /** 82 | * Defines the signature for the finalizer that is called each time 83 | * an ExtensionContext instance is disposed. 84 | */ 85 | 86 | typedef void (*FREContextFinalizer)( 87 | FREContext ctx 88 | ); 89 | 90 | /** 91 | * The initialization function provided by each extension must conform 92 | * to the following signature. 93 | * 94 | * @param extDataToSet Provided for the extension to store per-extension instance data. 95 | * For example, if the extension creates 96 | * globals per-instance, it can store a pointer to them here. 97 | * 98 | * @param ctxInitializerToSet Must be set to a pointer to a function 99 | * of type FREContextInitializer. Will be invoked whenever 100 | * the ActionScript code creates a new context for this extension. 101 | * 102 | * @param ctxFinalizerToSet Must be set to a pointer to a function 103 | * of type FREContextFinalizer. 104 | */ 105 | 106 | typedef void (*FREInitializer)( 107 | void** extDataToSet , 108 | FREContextInitializer* ctxInitializerToSet, 109 | FREContextFinalizer* ctxFinalizerToSet 110 | ); 111 | 112 | /** 113 | * Called iff the extension is unloaded from the process. Extensions 114 | * are not guaranteed to be unloaded; the runtime process may exit without 115 | * doing so. 116 | */ 117 | 118 | typedef void (*FREFinalizer)( 119 | void* extData 120 | ); 121 | 122 | /* Result Codes ***************************************************************/ 123 | /** 124 | * These values must not be changed. 125 | */ 126 | 127 | typedef enum { 128 | FRE_OK = 0, 129 | FRE_NO_SUCH_NAME = 1, 130 | FRE_INVALID_OBJECT = 2, 131 | FRE_TYPE_MISMATCH = 3, 132 | FRE_ACTIONSCRIPT_ERROR = 4, 133 | FRE_INVALID_ARGUMENT = 5, 134 | FRE_READ_ONLY = 6, 135 | FRE_WRONG_THREAD = 7, 136 | FRE_ILLEGAL_STATE = 8, 137 | FRE_INSUFFICIENT_MEMORY = 9, 138 | FREResult_ENUMPADDING = 0xfffff /* will ensure that C and C++ treat this enum as the same size. */ 139 | } FREResult; 140 | 141 | /* Context Data ************************************************************/ 142 | 143 | /** 144 | * @returns FRE_OK 145 | * FRE_WRONG_THREAD 146 | * FRE_INVALID_ARGUMENT If nativeData is null. 147 | */ 148 | 149 | FREResult FREGetContextNativeData( FREContext ctx, void** nativeData ); 150 | 151 | /** 152 | * @returns FRE_OK 153 | * FRE_INVALID_ARGUMENT 154 | * FRE_WRONG_THREAD 155 | */ 156 | 157 | FREResult FRESetContextNativeData( FREContext ctx, void* nativeData ); 158 | 159 | /** 160 | * @returns FRE_OK 161 | * FRE_WRONG_THREAD 162 | * FRE_INVALID_ARGUMENT If actionScriptData is null. 163 | */ 164 | 165 | FREResult FREGetContextActionScriptData( FREContext ctx, FREObject *actionScriptData ); 166 | 167 | /** 168 | * @returns FRE_OK 169 | * FRE_WRONG_THREAD 170 | */ 171 | 172 | FREResult FRESetContextActionScriptData( FREContext ctx, FREObject actionScriptData ); 173 | 174 | /* Primitive Types ************************************************************/ 175 | /** 176 | * These values must not be changed. 177 | */ 178 | 179 | typedef enum { 180 | FRE_TYPE_OBJECT = 0, 181 | FRE_TYPE_NUMBER = 1, 182 | FRE_TYPE_STRING = 2, 183 | FRE_TYPE_BYTEARRAY = 3, 184 | FRE_TYPE_ARRAY = 4, 185 | FRE_TYPE_VECTOR = 5, 186 | FRE_TYPE_BITMAPDATA = 6, 187 | FRE_TYPE_BOOLEAN = 7, 188 | FRE_TYPE_NULL = 8, 189 | FREObjectType_ENUMPADDING = 0xfffff /* will ensure that C and C++ treat this enum as the same size. */ 190 | } FREObjectType; 191 | 192 | /** 193 | * @returns FRE_OK 194 | * FRE_INVALID_OBJECT 195 | * FRE_WRONG_THREAD 196 | * FRE_INVALID_ARGUMENT If objectType is null. 197 | */ 198 | 199 | FREResult FREGetObjectType( FREObject object, FREObjectType *objectType ); 200 | 201 | /** 202 | * @return FRE_OK 203 | * FRE_TYPE_MISMATCH 204 | * FRE_INVALID_OBJECT 205 | * FRE_INVALID_ARGUMENT 206 | * FRE_WRONG_THREAD 207 | */ 208 | 209 | FREResult FREGetObjectAsInt32 ( FREObject object, int32_t *value ); 210 | FREResult FREGetObjectAsUint32( FREObject object, uint32_t *value ); 211 | FREResult FREGetObjectAsDouble( FREObject object, double *value ); 212 | FREResult FREGetObjectAsBool ( FREObject object, uint32_t *value ); 213 | 214 | /** 215 | * @return FRE_OK 216 | * FRE_INVALID_ARGUMENT 217 | * FRE_WRONG_THREAD 218 | */ 219 | 220 | FREResult FRENewObjectFromInt32 ( int32_t value, FREObject *object ); 221 | FREResult FRENewObjectFromUint32( uint32_t value, FREObject *object ); 222 | FREResult FRENewObjectFromDouble( double value, FREObject *object ); 223 | FREResult FRENewObjectFromBool ( uint32_t value, FREObject *object ); 224 | 225 | /** 226 | * Retrieves a string representation of the object referred to by 227 | * the given object. The referenced string is immutable and valid 228 | * only for duration of the call to a registered function. If the 229 | * caller wishes to keep the the string, they must keep a copy of it. 230 | * 231 | * @param object The string to be retrieved. 232 | * 233 | * @param length The size, in bytes, of the string. Includes the 234 | * null terminator. 235 | * 236 | * @param value A pointer to a possibly temporary copy of the string. 237 | * 238 | * @return FRE_OK 239 | * FRE_TYPE_MISMATCH 240 | * FRE_INVALID_OBJECT 241 | * FRE_INVALID_ARGUMENT 242 | * FRE_WRONG_THREAD 243 | */ 244 | 245 | FREResult FREGetObjectAsUTF8( 246 | FREObject object, 247 | uint32_t* length, 248 | const uint8_t** value 249 | ); 250 | 251 | /** 252 | * Creates a new String object that contains a copy of the specified 253 | * string. 254 | * 255 | * @param length The length, in bytes, of the original string. Must include 256 | * the null terminator. 257 | * 258 | * @param value A pointer to the original string. 259 | * 260 | * @param object Receives a reference to the new string object. 261 | * 262 | * @return FRE_OK 263 | * FRE_INVALID_ARGUMENT 264 | * FRE_WRONG_THREAD 265 | */ 266 | 267 | FREResult FRENewObjectFromUTF8( 268 | uint32_t length, 269 | const uint8_t* value , 270 | FREObject* object 271 | ); 272 | 273 | /* Object Access **************************************************************/ 274 | 275 | /** 276 | * @param className UTF8-encoded name of the class being constructed. 277 | * 278 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 279 | * Error thrown during execution. May be null if the caller does not 280 | * want to receive this handle. If not null and no error occurs, is set an 281 | * invalid handle value. 282 | * 283 | * @return FRE_OK 284 | * FRE_TYPE_MISMATCH 285 | * FRE_INVALID_OBJECT 286 | * FRE_INVALID_ARGUMENT 287 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from calling this method. 288 | * In this case, thrownException will be set to the handle of the thrown value. 289 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 290 | * FRE_NO_SUCH_NAME 291 | * FRE_WRONG_THREAD 292 | */ 293 | 294 | FREResult FRENewObject( 295 | const uint8_t* className , 296 | uint32_t argc , 297 | FREObject argv[] , 298 | FREObject* object , 299 | FREObject* thrownException 300 | ); 301 | 302 | /** 303 | * @param propertyName UTF8-encoded name of the property being fetched. 304 | * 305 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 306 | * Error thrown during getting the property. May be null if the caller does not 307 | * want to receive this handle. If not null and no error occurs, is set an 308 | * invalid handle value. 309 | * 310 | * @return FRE_OK 311 | * FRE_TYPE_MISMATCH 312 | * FRE_INVALID_OBJECT 313 | * FRE_INVALID_ARGUMENT 314 | * 315 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from getting this property. 316 | * In this case, thrownException will be set to the handle of the thrown value. 317 | * 318 | * FRE_NO_SUCH_NAME If the named property doesn't exist, or if the reference is ambiguous 319 | * because the property exists in more than one namespace. 320 | * 321 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 322 | * 323 | * FRE_WRONG_THREAD 324 | */ 325 | 326 | FREResult FREGetObjectProperty( 327 | FREObject object , 328 | const uint8_t* propertyName , 329 | FREObject* propertyValue , 330 | FREObject* thrownException 331 | ); 332 | 333 | /** 334 | * @param propertyName UTF8-encoded name of the property being set. 335 | * 336 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 337 | * Error thrown during method execution. May be null if the caller does not 338 | * want to receive this handle. If not null and no error occurs, is set an 339 | * invalid handle value. 340 | * 341 | * 342 | * @return FRE_OK 343 | * FRE_TYPE_MISMATCH 344 | * FRE_INVALID_OBJECT 345 | * FRE_INVALID_ARGUMENT 346 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from getting this property. 347 | * In this case, thrownException will be set to the handle of the thrown value. 348 | * 349 | * FRE_NO_SUCH_NAME If the named property doesn't exist, or if the reference is ambiguous 350 | * because the property exists in more than one namespace. 351 | * 352 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 353 | * 354 | * FRE_READ_ONLY 355 | * FRE_WRONG_THREAD 356 | */ 357 | 358 | FREResult FRESetObjectProperty( 359 | FREObject object , 360 | const uint8_t* propertyName , 361 | FREObject propertyValue , 362 | FREObject* thrownException 363 | ); 364 | 365 | /** 366 | * @param methodName UTF8-encoded null-terminated name of the method being invoked. 367 | * 368 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 369 | * Error thrown during method execution. May be null if the caller does not 370 | * want to receive this handle. If not null and no error occurs, is set an 371 | * invalid handle value. 372 | * 373 | * @return FRE_OK 374 | * FRE_TYPE_MISMATCH 375 | * FRE_INVALID_OBJECT 376 | * FRE_INVALID_ARGUMENT 377 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from calling this method. 378 | * In this case, thrownException will be set to the handle of the thrown value. 379 | * 380 | * FRE_NO_SUCH_NAME If the named method doesn't exist, or if the reference is ambiguous 381 | * because the method exists in more than one namespace. 382 | * 383 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 384 | * 385 | * FRE_WRONG_THREAD 386 | */ 387 | 388 | FREResult FRECallObjectMethod ( 389 | FREObject object , 390 | const uint8_t* methodName , 391 | uint32_t argc , 392 | FREObject argv[] , 393 | FREObject* result , 394 | FREObject* thrownException 395 | ); 396 | 397 | /* BitmapData Access **********************************************************/ 398 | 399 | typedef struct { 400 | uint32_t width; /* width of the BitmapData bitmap */ 401 | uint32_t height; /* height of the BitmapData bitmap */ 402 | uint32_t hasAlpha; /* if non-zero, pixel format is ARGB32, otherwise pixel format is _RGB32, host endianness */ 403 | uint32_t isPremultiplied; /* pixel color values are premultiplied with alpha if non-zero, un-multiplied if zero */ 404 | uint32_t lineStride32; /* line stride in number of 32 bit values, typically the same as width */ 405 | uint32_t* bits32; /* pointer to the first 32-bit pixel of the bitmap data */ 406 | } FREBitmapData; 407 | 408 | typedef struct { 409 | uint32_t width; /* width of the BitmapData bitmap */ 410 | uint32_t height; /* height of the BitmapData bitmap */ 411 | uint32_t hasAlpha; /* if non-zero, pixel format is ARGB32, otherwise pixel format is _RGB32, host endianness */ 412 | uint32_t isPremultiplied; /* pixel color values are premultiplied with alpha if non-zero, un-multiplied if zero */ 413 | uint32_t lineStride32; /* line stride in number of 32 bit values, typically the same as width */ 414 | uint32_t isInvertedY; /* if non-zero, last row of pixels starts at bits32, otherwise, first row of pixels starts at bits32. */ 415 | uint32_t* bits32; /* pointer to the first 32-bit pixel of the bitmap data */ 416 | } FREBitmapData2; 417 | 418 | /** 419 | * Referenced data is valid only for duration of the call 420 | * to a registered function. 421 | * 422 | * @return FRE_OK 423 | * FRE_TYPE_MISMATCH 424 | * FRE_INVALID_OBJECT 425 | * FRE_INVALID_ARGUMENT 426 | * FRE_WRONG_THREAD 427 | * FRE_ILLEGAL_STATE 428 | */ 429 | 430 | FREResult FREAcquireBitmapData( 431 | FREObject object , 432 | FREBitmapData* descriptorToSet 433 | ); 434 | 435 | /** 436 | * Referenced data is valid only for duration of the call 437 | * to a registered function. 438 | * 439 | * Use of this API requires that the extension and application must be packaged for 440 | * the 3.1 namespace or later. 441 | * 442 | * @return FRE_OK 443 | * FRE_TYPE_MISMATCH 444 | * FRE_INVALID_OBJECT 445 | * FRE_INVALID_ARGUMENT 446 | * FRE_WRONG_THREAD 447 | * FRE_ILLEGAL_STATE 448 | */ 449 | 450 | FREResult FREAcquireBitmapData2( 451 | FREObject object , 452 | FREBitmapData2* descriptorToSet 453 | ); 454 | 455 | /** 456 | * BitmapData must be acquired to call this. Clients must invalidate any region 457 | * they modify in order to notify AIR of the changes. Only invalidated regions 458 | * are redrawn. 459 | * 460 | * @return FRE_OK 461 | * FRE_INVALID_OBJECT 462 | * FRE_WRONG_THREAD 463 | * FRE_ILLEGAL_STATE 464 | * FRE_TYPE_MISMATCH 465 | */ 466 | 467 | FREResult FREInvalidateBitmapDataRect( 468 | FREObject object, 469 | uint32_t x , 470 | uint32_t y , 471 | uint32_t width , 472 | uint32_t height 473 | ); 474 | /** 475 | * @return FRE_OK 476 | * FRE_WRONG_THREAD 477 | * FRE_ILLEGAL_STATE 478 | * FRE_TYPE_MISMATCH 479 | */ 480 | 481 | FREResult FREReleaseBitmapData( FREObject object ); 482 | 483 | /** 484 | * Referenced data is valid only for duration of the call 485 | * to a registered function. 486 | * 487 | * @return FRE_OK 488 | * FRE_TYPE_MISMATCH 489 | * FRE_INVALID_OBJECT 490 | * FRE_WRONG_THREAD 491 | */ 492 | 493 | /* ByteArray Access ***********************************************************/ 494 | 495 | typedef struct { 496 | uint32_t length; 497 | uint8_t* bytes; 498 | } FREByteArray; 499 | 500 | /** 501 | * Referenced data is valid only for duration of the call 502 | * to a registered function. 503 | * 504 | * @return FRE_OK 505 | * FRE_TYPE_MISMATCH 506 | * FRE_INVALID_OBJECT 507 | * FRE_INVALID_ARGUMENT 508 | * FRE_WRONG_THREAD 509 | * FRE_ILLEGAL_STATE 510 | */ 511 | 512 | FREResult FREAcquireByteArray( 513 | FREObject object , 514 | FREByteArray* byteArrayToSet 515 | ); 516 | 517 | /** 518 | * @return FRE_OK 519 | * FRE_INVALID_OBJECT 520 | * FRE_ILLEGAL_STATE 521 | * FRE_WRONG_THREAD 522 | */ 523 | 524 | FREResult FREReleaseByteArray( FREObject object ); 525 | 526 | /* Array and Vector Access ****************************************************/ 527 | 528 | /** 529 | * @return FRE_OK 530 | * FRE_INVALID_OBJECT 531 | * FRE_INVALID_ARGUMENT 532 | * FRE_ILLEGAL_STATE 533 | * FRE_TYPE_MISMATCH 534 | * FRE_WRONG_THREAD 535 | */ 536 | 537 | FREResult FREGetArrayLength( 538 | FREObject arrayOrVector, 539 | uint32_t* length 540 | ); 541 | 542 | /** 543 | * @return FRE_OK 544 | * FRE_INVALID_OBJECT 545 | * FRE_TYPE_MISMATCH 546 | * FRE_ILLEGAL_STATE 547 | * FRE_INVALID_ARGUMENT If length is greater than 2^32. 548 | * 549 | * FRE_READ_ONLY If the handle refers to a Vector 550 | * of fixed size. 551 | * 552 | * FRE_WRONG_THREAD 553 | * FRE_INSUFFICIENT_MEMORY 554 | */ 555 | 556 | FREResult FRESetArrayLength( 557 | FREObject arrayOrVector, 558 | uint32_t length 559 | ); 560 | 561 | /** 562 | * If an Array is sparse and an element that isn't defined is requested, the 563 | * return value will be FRE_OK but the handle value will be invalid. 564 | * 565 | * @return FRE_OK 566 | * FRE_ILLEGAL_STATE 567 | * 568 | * FRE_INVALID_ARGUMENT If the handle refers to a vector and the index is 569 | * greater than the size of the array. 570 | * 571 | * FRE_INVALID_OBJECT 572 | * FRE_TYPE_MISMATCH 573 | * FRE_WRONG_THREAD 574 | */ 575 | 576 | FREResult FREGetArrayElementAt( 577 | FREObject arrayOrVector, 578 | uint32_t index , 579 | FREObject* value 580 | ); 581 | 582 | /** 583 | * 584 | * @return FRE_OK 585 | * FRE_INVALID_OBJECT 586 | * FRE_ILLEGAL_STATE 587 | * 588 | * FRE_TYPE_MISMATCH If an attempt to made to set a value in a Vector 589 | * when the type of the value doesn't match the Vector's item type. 590 | * 591 | * FRE_WRONG_THREAD 592 | */ 593 | 594 | FREResult FRESetArrayElementAt( 595 | FREObject arrayOrVector, 596 | uint32_t index , 597 | FREObject value 598 | ); 599 | 600 | /* Callbacks ******************************************************************/ 601 | 602 | /** 603 | * Causes a StatusEvent to be dispatched from the associated 604 | * ExtensionContext object. 605 | * 606 | * Dispatch happens asynchronously, even if this is called during 607 | * a call to a registered function. 608 | * 609 | * The ActionScript portion of this extension can listen for that event 610 | * and, upon receipt, query the native portion for details of the event 611 | * that occurred. 612 | * 613 | * This call is thread-safe and may be invoked from any thread. The string 614 | * values are copied before the call returns. 615 | * 616 | * @return FRE_OK In all circumstances, as the referenced object cannot 617 | * necessarily be checked for validity on the invoking thread. 618 | * However, no event will be dispatched if the object is 619 | * invalid or not an EventDispatcher. 620 | * FRE_INVALID_ARGUMENT If code or level is NULL 621 | */ 622 | 623 | FREResult FREDispatchStatusEventAsync( 624 | FREContext ctx , 625 | const uint8_t* code , 626 | const uint8_t* level 627 | ); 628 | 629 | #ifdef __cplusplus 630 | } 631 | #endif 632 | 633 | #endif /* #ifndef _FLASH_RUNTIME_EXTENSIONS_H_ */ 634 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '10.0' 3 | 4 | target 'AirFlurry' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | pod 'Flurry-iOS-SDK/FlurrySDK', '9.0.0' 8 | # Pods for AirFlurry 9 | 10 | end 11 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flurry-iOS-SDK/FlurrySDK (9.0.0) 3 | 4 | DEPENDENCIES: 5 | - Flurry-iOS-SDK/FlurrySDK (= 9.0.0) 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - Flurry-iOS-SDK 10 | 11 | SPEC CHECKSUMS: 12 | Flurry-iOS-SDK: 58e48e417fee667154e4d240040b270b3734d28a 13 | 14 | PODFILE CHECKSUM: 65a017edf130110eb8008d359f910324672fbbaf 15 | 16 | COCOAPODS: 1.5.2 17 | -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/Flurry/FlurryConsent.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlurryConsent.h 3 | // Flurry 4 | // 5 | // Created by Ishwarya Iyer on 4/2/18. 6 | // Copyright © 2018 Flurry Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FlurryConsent : NSObject 12 | 13 | @property (nonatomic, assign, readonly) BOOL isGDPRScope; 14 | @property (nonatomic, strong, readonly) NSDictionary* consentStrings; 15 | 16 | /*! 17 | * @brief Use this api to initialize the FlurryConsent object. 18 | * @since 8.5.0 19 | * 20 | * This api initializes the consent object. This object needs to be registered with the SDK. 21 | * 22 | * @param isGDPRScope @c YES states that GDPR laws apply 23 | * The default value is @c NO 24 | * 25 | * @param consentStrings NSDictionary* => . 26 | * 27 | * @note ConsentStrings must be provided if "isGDPRScope" is set to YES for the consent information to be valid 28 | * 29 | */ 30 | - (FlurryConsent*) initWithGDPRScope:(BOOL)isGDPRScope andConsentStrings:(NSDictionary*)consentStrings; 31 | 32 | 33 | /*! 34 | * @brief Use this api to register/update the consent information with the SDK. 35 | * @since 8.5.0 36 | * 37 | * This api can be called anytime to pass the consent information to the SDK. 38 | * 39 | * @see FlurrySessionBuilder#withConsent: to register the consent before starting Flurry. \n 40 | * FlurryConsent#initWithGDPRScope:andConsentStrings to create the FlurryConsent object 41 | * 42 | * @param consent The FlurryConsent object which contains the GDPR scope flag and the consent strings 43 | * 44 | * @return indicates if the consent information provided is valid or not 45 | * 46 | */ 47 | + (BOOL) updateConsentInformation:(FlurryConsent*)consent; 48 | 49 | /*! 50 | * @brief Use this api to get the consent information registered with the SDK. 51 | * @since 8.5.0 52 | * 53 | * This object is immutable. To update the consent a new FlurryConsent object must be created and passed on to the SDK 54 | * 55 | */ 56 | + (FlurryConsent*) getConsent; 57 | 58 | @end 59 | 60 | -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/Flurry/FlurryEmpty.m: -------------------------------------------------------------------------------- 1 | 2 | #import "Flurry.h" 3 | 4 | @implementation Flurry (ForceLoad) 5 | 6 | @end -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/Flurry/FlurrySessionBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlurrySessionBuilder.h 3 | // Flurry 4 | // 5 | // Created by Akshay Bhandary on 7/14/16. 6 | // Copyright © 2016 Flurry Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FlurryConsent.h" 11 | 12 | 13 | /*! 14 | * @brief Enum for setting up log output level. 15 | * @since 4.2.0 16 | * 17 | */ 18 | typedef enum { 19 | FlurryLogLevelNone = 0, //No output 20 | FlurryLogLevelCriticalOnly, //Default, outputs only critical log events 21 | FlurryLogLevelDebug, //Debug level, outputs critical and main log events 22 | FlurryLogLevelAll //Highest level, outputs all log events 23 | } FlurryLogLevel; 24 | 25 | 26 | @interface FlurrySessionBuilder : NSObject 27 | 28 | /*! 29 | * @brief Explicitly specifies the App Version that Flurry will use to group Analytics data. 30 | * @since 7.7.0 31 | * 32 | * This is an optional method that overrides the App Version Flurry uses for reporting. Flurry will 33 | * use the CFBundleVersion in your info.plist file when this method is not invoked. 34 | * 35 | * @note There is a maximum of 605 versions allowed for a single app. 36 | * 37 | * @param value The custom version name. 38 | */ 39 | - (FlurrySessionBuilder*) withAppVersion:(NSString *)value; 40 | 41 | 42 | /*! 43 | * @brief Set the timeout for expiring a Flurry session. 44 | * @since 7.7.0 45 | * 46 | * This is an optional method that sets the time the app may be in the background before 47 | * starting a new session upon resume. The default value for the session timeout is 10 48 | * seconds in the background. 49 | * 50 | * @param value The time in seconds to set the session timeout to. 51 | */ 52 | - (FlurrySessionBuilder*) withSessionContinueSeconds:(NSInteger)value; 53 | 54 | 55 | /*! 56 | * @brief Enable automatic collection of crash reports. 57 | * @since 7.7.0 58 | * 59 | * This is an optional method that collects crash reports when enabled. The 60 | * default value is @c NO. 61 | * 62 | * @param value @c YES to enable collection of crash reports. 63 | */ 64 | - (FlurrySessionBuilder*) withCrashReporting:(BOOL)value; 65 | 66 | /*! 67 | * @brief Generates debug logs to console. 68 | * @since 7.7.0 69 | * 70 | * This is an optional method that displays debug information related to the Flurry SDK. 71 | * display information to the console. The default setting for this method is @c FlurryLogLevelCriticalOnly. 72 | * 73 | * @note The log level can be changed at any point in the execution of your application using the setLogLevel API defined in 74 | * Flurry.h, see #setLogLevel for more info. 75 | * 76 | * @param value Log level 77 | * 78 | */ 79 | - (FlurrySessionBuilder*) withLogLevel:(FlurryLogLevel) value; 80 | 81 | 82 | 83 | /*! 84 | * @brief Displays an exception in the debug log if thrown during a Session. 85 | * @since 7.7.0 86 | * 87 | * This is an optional method that augments the debug logs with exceptions that occur during the session. 88 | * You must both capture exceptions to Flurry and set the log level to Debug or All for this method to 89 | * display information to the console. The default setting for this method is @c NO. 90 | * 91 | * @note This method can be called at any point in the execution of your application and 92 | * the setting will take effect for SDK activity after this call. 93 | * 94 | * @see #setLogLevel: for information on how to view debugging information on your console. \n 95 | * #logError:message:exception: for details on logging exceptions. \n 96 | * #logError:message:error: for details on logging errors. 97 | * 98 | * @param value @c YES to show errors in debug logs, @c NO to omit errors in debug logs. 99 | */ 100 | - (FlurrySessionBuilder*) withShowErrorInLog:(BOOL) value; 101 | 102 | 103 | /*! 104 | * @brief Registers the consent information with the SDK. Consent information is used to determine if the gdpr laws are applicable 105 | * @since 8.5.0 106 | * 107 | * Use this method to pass the consent information to the SDK 108 | * 109 | * @note This method must be called prior to invoking #startSession: 110 | * 111 | * @param consent The consent information. 112 | * @see (FlurryConsent#initWithGDPRScope:andConsentStrings:) 113 | */ 114 | 115 | - (FlurrySessionBuilder*) withConsent:(FlurryConsent*)consent; 116 | 117 | 118 | #if !TARGET_OS_WATCH 119 | /*! 120 | * @brief Enables implicit recording of Apple Store transactions. 121 | * @since 7.9.0 122 | * 123 | * @note This method needs to be called before any transaction is finialized. 124 | * 125 | * @param value @c YES to enable transaction logging with the default being @c NO. 126 | * 127 | */ 128 | 129 | - (FlurrySessionBuilder*) withIAPReportingEnabled:(BOOL) value; 130 | 131 | /*! 132 | * @brief Enables opting out of background sessions being counted towards total sessions. 133 | * @since 8.1.0-rc.1 134 | * 135 | * @note This method must be called prior to invoking #startSession:. 136 | * 137 | * @param value @c NO to opt out of counting background sessions towards total sessions. 138 | * The default value for the session is @c YES 139 | * 140 | */ 141 | 142 | - (FlurrySessionBuilder*) withIncludeBackgroundSessionsInMetrics:(BOOL) value; 143 | 144 | 145 | 146 | #endif 147 | 148 | #if TARGET_OS_TV 149 | /*! 150 | * @brief Sets the minimum duration (in minutes) before a partial session report is sent to Flurry. 151 | * @since 7.7.0 152 | * 153 | * This is an optional method that sets the minimum duration (in minutes) before a partial session report is sent to Flurry. 154 | * The acceptable values are between 5 and 60 minutes. 155 | * 156 | * @note This method must be called prior to invoking #startSession:. 157 | * 158 | * @param value The period after which a partial session report is sent to Flurry. 159 | */ 160 | - (FlurrySessionBuilder*) withTVSessionReportingInterval:(NSInteger) value; 161 | 162 | /*! 163 | * @brief Sets the minimum number of events before a partial session report is sent to Flurry. 164 | * @since 7.7.0 165 | * 166 | * This is an optional method that sets the minimum number of events before a partial session report is sent to Flurry. 167 | * The acceptable values are between 5 and 50. 168 | * 169 | * @note This method must be called prior to invoking #startSession:. 170 | * 171 | * @param value The number of events after which partial session report is sent to Flurry. 172 | */ 173 | - (FlurrySessionBuilder*) withTVEventCountThreshold:(NSInteger) value; 174 | #endif 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/Flurry/libFlurry_9.0.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/ios/Pods/Flurry-iOS-SDK/Flurry/libFlurry_9.0.0.a -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/Licenses/Flurry-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Developer's use of the SDK is governed by the license in the applicable Flurry Terms of Service. Some components of the SDK are governed by open source software licenses. In the event of any conflict between the license in the applicable Flurry Terms of Service and the applicable open source license, the terms of the open source license shall prevail with respect to those components. 2 | -------------------------------------------------------------------------------- /ios/Pods/Flurry-iOS-SDK/README.md: -------------------------------------------------------------------------------- 1 | Flurry SDK 2 | ========== 3 | 4 | 5 | To use FlurrySDK from cocoapods, for Analytics, Ad serving, Apple Watch Extension, and for Tumblr in-app sharing follow the instructions: 6 | 7 | 8 | To enable Flurry Analytics: 9 | 10 | ``` 11 | pod 'Flurry-iOS-SDK/FlurrySDK' 12 | ``` 13 | 14 | 15 | To enable Flurry Ad serving : 16 | 17 | ``` 18 | pod 'Flurry-iOS-SDK/FlurrySDK' 19 | pod 'Flurry-iOS-SDK/FlurryAds' 20 | ``` 21 | 22 | 23 | To use FlurrySDK for Apple Watch 1.x Extension: 24 | ``` 25 | target :"Your Apple Watch 1.x Extension Target" do 26 | pod 'Flurry-iOS-SDK/FlurryWatchSDK' 27 | end 28 | ``` 29 | 30 | 31 | To use FlurrySDK for Apple Watch 2.x Extension: 32 | ``` 33 | target :"Your Apple Watch 2.x Extension Target" do 34 | pod 'Flurry-iOS-SDK/FlurryWatchOSSDK' 35 | platform :watchos, '2.0' 36 | end 37 | ``` 38 | 39 | 40 | To use FlurrySDK for tvOS apps: 41 | 42 | ``` 43 | target :"Your TVOS Application" do 44 | pod 'Flurry-iOS-SDK/FlurryTVOS' #tVOS Analytics Pod' 45 | platform :tvos, '9.0' 46 | end 47 | ``` 48 | 49 | Don't forget to read how to track events correctly in Apple Watch Extensions in FlurryiOSAnalyticsREADMExx.pdf 50 | 51 | -------------------------------------------------------------------------------- /ios/Pods/Headers/Private/Flurry-iOS-SDK/Flurry.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/Flurry.h -------------------------------------------------------------------------------- /ios/Pods/Headers/Private/Flurry-iOS-SDK/FlurryConsent.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/FlurryConsent.h -------------------------------------------------------------------------------- /ios/Pods/Headers/Private/Flurry-iOS-SDK/FlurrySessionBuilder.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/FlurrySessionBuilder.h -------------------------------------------------------------------------------- /ios/Pods/Headers/Public/Flurry-iOS-SDK/Flurry.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/Flurry.h -------------------------------------------------------------------------------- /ios/Pods/Headers/Public/Flurry-iOS-SDK/FlurryConsent.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/FlurryConsent.h -------------------------------------------------------------------------------- /ios/Pods/Headers/Public/Flurry-iOS-SDK/FlurrySessionBuilder.h: -------------------------------------------------------------------------------- 1 | ../../../Flurry-iOS-SDK/Flurry/FlurrySessionBuilder.h -------------------------------------------------------------------------------- /ios/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flurry-iOS-SDK/FlurrySDK (9.0.0) 3 | 4 | DEPENDENCIES: 5 | - Flurry-iOS-SDK/FlurrySDK (= 9.0.0) 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - Flurry-iOS-SDK 10 | 11 | SPEC CHECKSUMS: 12 | Flurry-iOS-SDK: 58e48e417fee667154e4d240040b270b3734d28a 13 | 14 | PODFILE CHECKSUM: 65a017edf130110eb8008d359f910324672fbbaf 15 | 16 | COCOAPODS: 1.5.2 17 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Flurry-iOS-SDK/Flurry-iOS-SDK-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Flurry_iOS_SDK : NSObject 3 | @end 4 | @implementation PodsDummy_Flurry_iOS_SDK 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Flurry-iOS-SDK/Flurry-iOS-SDK-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Flurry-iOS-SDK/Flurry-iOS-SDK.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Flurry-iOS-SDK 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Flurry-iOS-SDK" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Flurry-iOS-SDK" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Flurry-iOS-SDK/Flurry" 5 | OTHER_LDFLAGS = -l"Flurry_9.0.0" -framework "Foundation" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "CoreLocation" -weak_framework "WatchConnectivity" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Flurry-iOS-SDK 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Flurry-iOS-SDK 5 | 6 | Developer's use of the SDK is governed by the license in the applicable Flurry Terms of Service. Some components of the SDK are governed by open source software licenses. In the event of any conflict between the license in the applicable Flurry Terms of Service and the applicable open source license, the terms of the open source license shall prevail with respect to those components. 7 | 8 | Generated by CocoaPods - https://cocoapods.org 9 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Developer's use of the SDK is governed by the license in the applicable Flurry Terms of Service. Some components of the SDK are governed by open source software licenses. In the event of any conflict between the license in the applicable Flurry Terms of Service and the applicable open source license, the terms of the open source license shall prevail with respect to those components. 18 | 19 | License 20 | Commercial 21 | Title 22 | Flurry-iOS-SDK 23 | Type 24 | PSGroupSpecifier 25 | 26 | 27 | FooterText 28 | Generated by CocoaPods - https://cocoapods.org 29 | Title 30 | 31 | Type 32 | PSGroupSpecifier 33 | 34 | 35 | StringsTable 36 | Acknowledgements 37 | Title 38 | Acknowledgements 39 | 40 | 41 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AirFlurry : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AirFlurry 5 | @end 6 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Flurry-iOS-SDK" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Flurry-iOS-SDK" "${PODS_ROOT}/Flurry-iOS-SDK/Flurry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Flurry-iOS-SDK" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Flurry-iOS-SDK" -l"Flurry_9.0.0" -framework "Foundation" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "CoreLocation" -weak_framework "WatchConnectivity" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /ios/Pods/Target Support Files/Pods-AirFlurry/Pods-AirFlurry.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Flurry-iOS-SDK" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Flurry-iOS-SDK" "${PODS_ROOT}/Flurry-iOS-SDK/Flurry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Flurry-iOS-SDK" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Flurry-iOS-SDK" -l"Flurry_9.0.0" -framework "Foundation" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "CoreLocation" -weak_framework "WatchConnectivity" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /sample/Main-app.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 15 | Main 16 | 17 | 18 | Main 19 | 20 | 21 | Main 22 | 23 | 26 | 0.0.0 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | com.freshplanet.ane.AirFlurry 46 | 47 | 48 | 49 | 50 | 51 | SWF file name is set automatically at compile time 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | true 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 | true 97 | 98 | 99 | true 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 153 | 154 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | UIDeviceFamily 189 | 190 | 191 | 1 192 | 193 | 2 194 | 195 | 196 | 197 | 198 | 199 | ]]> 200 | 201 | 202 | 203 | 212 | 213 | 214 | high 215 | 216 | 217 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | ]]> 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | -------------------------------------------------------------------------------- /sample/libs/AirFlurry.ane: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freshplanet/ANE-Flurry/e7807ac806e44b59fc77ec5a1c4c0028494ac1d8/sample/libs/AirFlurry.ane -------------------------------------------------------------------------------- /sample/src/Main.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package { 16 | 17 | 18 | import com.freshplanet.ane.AirFlurry.AirFlurry; 19 | import com.freshplanet.ane.AirFlurry.enums.AirFlurryGender; 20 | import com.freshplanet.ane.AirFlurry.events.AirFlurryEvent; 21 | 22 | import flash.display.Sprite; 23 | import flash.display.StageAlign; 24 | import flash.events.Event; 25 | 26 | import com.freshplanet.ui.ScrollableContainer; 27 | import com.freshplanet.ui.TestBlock; 28 | 29 | [SWF(backgroundColor="#057fbc", frameRate='60')] 30 | public class Main extends Sprite { 31 | 32 | public static var stageWidth:Number = 0; 33 | public static var indent:Number = 0; 34 | 35 | private var _scrollableContainer:ScrollableContainer = null; 36 | 37 | public function Main() { 38 | this.addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 39 | } 40 | 41 | private function _onAddedToStage(event:Event):void { 42 | this.removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 43 | this.stage.align = StageAlign.TOP_LEFT; 44 | 45 | stageWidth = this.stage.stageWidth; 46 | indent = stage.stageWidth * 0.025; 47 | 48 | _scrollableContainer = new ScrollableContainer(false, true); 49 | this.addChild(_scrollableContainer); 50 | 51 | if (!AirFlurry.isSupported) { 52 | trace("AirFlurry ANE is NOT supported on this platform!"); 53 | return; 54 | } 55 | 56 | AirFlurry.instance.addEventListener( 57 | AirFlurryEvent.SESSION_STARTED, 58 | onSessionStarted); 59 | 60 | var blocks:Array = []; 61 | 62 | blocks.push(new TestBlock("init", function():void { 63 | AirFlurry.instance.init("V5SY5PXDJFSTQHNZ839D", "1.0.1", 1000); 64 | })); 65 | blocks.push(new TestBlock("logEvent", function():void { 66 | if(AirFlurry.instance.isSessionOpen) 67 | AirFlurry.instance.logEvent("testing_event"); 68 | })); 69 | blocks.push(new TestBlock("logPageView", function():void { 70 | if(AirFlurry.instance.isSessionOpen) 71 | AirFlurry.instance.logPageView(); 72 | })); 73 | blocks.push(new TestBlock("startTimedEvent", function():void { 74 | if(AirFlurry.instance.isSessionOpen) 75 | AirFlurry.instance.startTimedEvent("timed_event"); 76 | })); 77 | blocks.push(new TestBlock("stopTimedEvent", function():void { 78 | if(AirFlurry.instance.isSessionOpen) 79 | AirFlurry.instance.stopTimedEvent("timed_event"); 80 | })); 81 | blocks.push(new TestBlock("logError", function():void { 82 | if(AirFlurry.instance.isSessionOpen) 83 | AirFlurry.instance.logError("test_error", "test error occured"); 84 | })); 85 | blocks.push(new TestBlock("setUserAge", function():void { 86 | if(AirFlurry.instance.isSessionOpen) 87 | AirFlurry.instance.setUserAge(21); 88 | })); 89 | blocks.push(new TestBlock("setUserGender", function():void { 90 | if(AirFlurry.instance.isSessionOpen) 91 | AirFlurry.instance.setUserGender(AirFlurryGender.FEMALE); 92 | })); 93 | blocks.push(new TestBlock("setUserId", function():void { 94 | if(AirFlurry.instance.isSessionOpen) 95 | AirFlurry.instance.setUserId("test_user_id"); 96 | })); 97 | blocks.push(new TestBlock("setLocation", function():void { 98 | if(AirFlurry.instance.isSessionOpen) 99 | AirFlurry.instance.setLocation(40.730610, -73.935242, 60.0, 60.0); 100 | })); 101 | 102 | 103 | /** 104 | * add ui to screen 105 | */ 106 | 107 | var nextY:Number = indent; 108 | 109 | for each (var block:TestBlock in blocks) { 110 | 111 | _scrollableContainer.addChild(block); 112 | block.y = nextY; 113 | nextY += block.height + indent; 114 | } 115 | } 116 | 117 | private function onSessionStarted(event:AirFlurryEvent):void { 118 | trace("onSessionStarted"); 119 | } 120 | 121 | 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /sample/src/com/freshplanet/ui/ScrollableContainer.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package com.freshplanet.ui { 16 | 17 | import flash.display.Sprite; 18 | import flash.events.Event; 19 | import flash.events.MouseEvent; 20 | import flash.geom.Point; 21 | 22 | public class ScrollableContainer extends Sprite { 23 | 24 | private var _xMovement:Boolean = true; 25 | private var _yMovement:Boolean = true; 26 | 27 | private var _prevTime:Number = 0; 28 | private var _moving:Boolean = false; 29 | private var _velocity:Point = new Point(); 30 | private var _prevGripPoint:Point = new Point(); 31 | private var _force:Point = new Point(); 32 | 33 | public function ScrollableContainer(xMovement:Boolean, yMovement:Boolean) { 34 | 35 | super(); 36 | 37 | _xMovement = xMovement; 38 | _yMovement = yMovement; 39 | 40 | this.addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 41 | } 42 | 43 | private function _onAddedToStage(event:Event):void { 44 | 45 | this.removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 46 | this.stage.addEventListener(MouseEvent.MOUSE_DOWN, _onMouseDown); 47 | } 48 | 49 | private function _onMouseDown(mouseEvent:MouseEvent):void { 50 | 51 | var gripPoint:Point = new Point(mouseEvent.stageX, mouseEvent.stageY); 52 | 53 | _moving = true; 54 | _velocity.setTo(0, 0); 55 | _prevGripPoint.copyFrom(gripPoint); 56 | 57 | this.stage.removeEventListener(MouseEvent.MOUSE_DOWN, _onMouseDown); 58 | this.stage.addEventListener(MouseEvent.MOUSE_MOVE, _onMouseMove); 59 | this.stage.addEventListener(MouseEvent.MOUSE_UP, _onMouseUp); 60 | 61 | if (this.hasEventListener(Event.ENTER_FRAME)) 62 | this.removeEventListener(Event.ENTER_FRAME, _onEnterFrame); 63 | } 64 | 65 | private function _onMouseMove(mouseEvent:MouseEvent):void { 66 | 67 | var gripPoint:Point = new Point(mouseEvent.stageX, mouseEvent.stageY); 68 | var movement:Point = gripPoint.subtract(_prevGripPoint); 69 | 70 | _force.copyFrom(movement); 71 | 72 | if (_xMovement) 73 | this.x += movement.x; 74 | 75 | if (_yMovement) 76 | this.y += movement.y; 77 | 78 | _prevGripPoint.copyFrom(gripPoint); 79 | } 80 | 81 | private function _onMouseUp(mouseEvent:MouseEvent):void { 82 | 83 | var gripPoint:Point = new Point(mouseEvent.stageX, mouseEvent.stageY); 84 | 85 | if (!gripPoint.equals(_prevGripPoint)) 86 | _onMouseMove(mouseEvent); 87 | 88 | _moving = false; 89 | 90 | _velocity.copyFrom(_force); 91 | // _maxVelocity = _force ? _force / stopDuration : 1; 92 | 93 | _force.setTo(0, 0); 94 | 95 | this.stage.addEventListener(MouseEvent.MOUSE_DOWN, _onMouseDown); 96 | this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, _onMouseMove); 97 | this.stage.removeEventListener(MouseEvent.MOUSE_UP, _onMouseUp); 98 | this.addEventListener(Event.ENTER_FRAME, _onEnterFrame); 99 | } 100 | 101 | private function _onEnterFrame(event:Event):void { 102 | 103 | // grabbing the scroller stops all movement 104 | if (_moving) 105 | return; 106 | 107 | // // tunneling catch 108 | // if ((_maxVelocity > 0 && _velocity < 0) || (_maxVelocity < 0 && _velocity > 0)) 109 | // _velocity = 0; 110 | // 111 | // float friction = _maxVelocity * deltaTime; 112 | // 113 | // // apply friction to velocity, cease at epsilon 114 | // if (fabsf(_velocity) > fabsf(_maxVelocity * _velocityEpsilon)) 115 | // _velocity -= friction; 116 | // else 117 | // _velocity = 0; 118 | 119 | // // calculate gravity 120 | // float snapGravity = 0; 121 | // 122 | // if (fabsf(_velocity) < fabsf(_maxVelocity) * velocityThreshold) { 123 | // 124 | // snapGravity = (attractPoint - _position) * gravityStrength; 125 | // 126 | // // gravity gets stronger as velocity gets weaker 127 | // snapGravity *= velocityThreshold - fabsf(_velocity / _maxVelocity); 128 | // } 129 | 130 | // // update position 131 | // this.x += _velocity.x;// + snapGravity.x; 132 | // this.y += _velocity.y;// + snapGravity.y; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /sample/src/com/freshplanet/ui/TestBlock.as: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 FreshPlanet 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | package com.freshplanet.ui { 16 | 17 | import flash.display.Sprite; 18 | import flash.events.Event; 19 | import flash.events.MouseEvent; 20 | import flash.text.TextField; 21 | import flash.text.TextFormat; 22 | import flash.text.TextFormatAlign; 23 | 24 | public class TestBlock extends Sprite { 25 | 26 | static private const NAME_FORMAT:TextFormat = new TextFormat("Courier", 27 | 32, 0xffffff, true, null, null, null, null, TextFormatAlign.CENTER); 28 | 29 | private var _name:String = null; 30 | private var _func:Function = null; 31 | 32 | public function TestBlock(name:String, func:Function) { 33 | 34 | super(); 35 | 36 | _name = name; 37 | _func = func; 38 | 39 | this.addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 40 | } 41 | 42 | private function _onAddedToStage(event:Event):void { 43 | 44 | this.removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); 45 | 46 | this.graphics.beginFill(0x000000); 47 | this.graphics.drawRect(0, 0, Main.stageWidth - (Main.indent * 2), 60); 48 | this.graphics.endFill(); 49 | this.x = (Main.stageWidth - this.width) / 2; 50 | 51 | var nameText:TextField = new TextField(); 52 | nameText.defaultTextFormat = NAME_FORMAT; 53 | nameText.textColor = 0xffffff; 54 | nameText.text = _name; 55 | nameText.width = this.width; 56 | nameText.height = this.height; 57 | this.addChild(nameText); 58 | 59 | this.addEventListener(MouseEvent.CLICK, _onClick); 60 | } 61 | 62 | private function _onClick(mouseEvent:MouseEvent):void { 63 | _func(); 64 | } 65 | } 66 | } 67 | --------------------------------------------------------------------------------