├── .classpath ├── .gitignore ├── .project ├── LICENSE ├── README.md ├── android ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.apt.core.prefs │ └── org.eclipse.jdt.core.prefs ├── Resources │ └── README.md ├── build.properties ├── build.xml ├── java-sources.txt ├── lib │ ├── README │ ├── com.google.android.gms.measurement.impl-9.4.0.jar │ ├── com.google.firebase-9.4.0.jar │ ├── com.google.firebase.auth.api-9.4.0.jar │ ├── com.google.firebase.auth.common-9.4.0.jar │ ├── com.google.firebase.auth.module-9.4.0.jar │ ├── com.google.firebase.crash-9.4.0.jar │ ├── com.google.firebase.database-9.4.0.jar │ ├── com.google.firebase.database.connection-9.4.0.jar │ ├── com.google.firebase.iid-9.4.0.jar │ ├── com.google.firebase.messaging-9.4.0.jar │ ├── com.google.firebase.remoteconfig-9.4.0.jar │ ├── com.google.firebase.storage-9.4.0.jar │ └── renamer.js ├── manifest ├── platform │ └── README.md ├── scripts │ ├── global_tracker.xml │ ├── import-google-services.js │ ├── node_modules │ │ ├── fs │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── object-path │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── benchmark.js │ │ │ ├── bower.json │ │ │ ├── component.json │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test.js │ │ └── underscore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── underscore-min.js │ │ │ ├── underscore-min.map │ │ │ └── underscore.js │ └── values.xml ├── src │ └── ti │ │ └── firebase │ │ ├── ExampleProxy.java │ │ └── TiFirebaseModule.java └── timodule.xml ├── assets └── README ├── documentation └── index.md ├── example └── app.js ├── iphone ├── .gitignore ├── Classes │ ├── TiFirebaseAnalyticsModule.h │ ├── TiFirebaseAnalyticsModule.m │ ├── TiFirebaseAuthModule.h │ ├── TiFirebaseAuthModule.m │ ├── TiFirebaseModule.h │ ├── TiFirebaseModule.m │ ├── TiFirebaseModuleAssets.h │ └── TiFirebaseModuleAssets.m ├── Resources │ └── README.md ├── TiFirebase_Prefix.pch ├── build.py ├── manifest ├── metadata.json ├── module.modulemap ├── module.xcconfig ├── platform │ ├── Firebase.h │ ├── FirebaseAnalytics.framework │ │ ├── FirebaseAnalytics │ │ ├── Headers │ │ │ ├── FIRAnalytics+AppDelegate.h │ │ │ ├── FIRAnalytics.h │ │ │ ├── FIRAnalyticsConfiguration.h │ │ │ ├── FIRApp.h │ │ │ ├── FIRConfiguration.h │ │ │ ├── FIREventNames.h │ │ │ ├── FIROptions.h │ │ │ ├── FIRParameterNames.h │ │ │ ├── FIRUserPropertyNames.h │ │ │ └── FirebaseAnalytics.h │ │ └── Modules │ │ │ └── module.modulemap │ ├── FirebaseAuth.framework │ │ ├── FirebaseAuth │ │ ├── Headers │ │ │ ├── FIRAuth.h │ │ │ ├── FIRAuthCredential.h │ │ │ ├── FIRAuthErrors.h │ │ │ ├── FIREmailPasswordAuthProvider.h │ │ │ ├── FIRFacebookAuthProvider.h │ │ │ ├── FIRGitHubAuthProvider.h │ │ │ ├── FIRGoogleAuthProvider.h │ │ │ ├── FIRTwitterAuthProvider.h │ │ │ ├── FIRUser.h │ │ │ ├── FIRUserInfo.h │ │ │ ├── FirebaseAuth.h │ │ │ └── FirebaseAuthVersion.h │ │ └── Modules │ │ │ └── module.modulemap │ ├── FirebaseCore.framework │ │ ├── FirebaseCore │ │ ├── Headers │ │ │ ├── FIRAnalyticsConfiguration.h │ │ │ ├── FIRApp.h │ │ │ ├── FIRConfiguration.h │ │ │ ├── FIRLoggerLevel.h │ │ │ ├── FIROptions.h │ │ │ └── FirebaseCore.h │ │ └── Modules │ │ │ └── module.modulemap │ ├── FirebaseInstanceID.framework │ │ ├── FirebaseInstanceID │ │ ├── Headers │ │ │ ├── FIRInstanceID.h │ │ │ └── FirebaseInstanceID.h │ │ └── Modules │ │ │ └── module.modulemap │ ├── GTMSessionFetcher.framework │ │ └── GTMSessionFetcher │ ├── GoogleToolboxForMac.framework │ │ └── GoogleToolboxForMac │ ├── README.md │ └── module.modulemap ├── ti-firebase.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── cribe.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── ti-firebase.xcscheme │ └── xcuserdata │ │ └── cribe.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── timodule.xml └── titanium.xcconfig └── ti.firebase-iphone-1.3.1.zip /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserstate 2 | xcsettings 3 | xcuserdata 4 | 5 | *.plist 6 | 7 | # Build folder and log file 8 | bin/ 9 | build/ 10 | android/libs 11 | android/documentation 12 | android/example 13 | android/assets 14 | android/LICENSE 15 | iphone/build/ 16 | build.log 17 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ti-firebase 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | com.appcelerator.titanium.core.builder 15 | 16 | 17 | 18 | 19 | com.aptana.ide.core.unifiedBuilder 20 | 21 | 22 | 23 | 24 | 25 | com.appcelerator.titanium.mobile.module.nature 26 | org.eclipse.jdt.core.javanature 27 | com.aptana.projects.webnature 28 | 29 | 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016-Present ChrisRibe 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. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ti.Firebase 2 | Appcelerator Titanium module to build and use the Google Firebase SDK 3.15.0. 3 | 4 | How to use it: 5 | ```js 6 | // Firebase init 7 | // iOS: Initialize from GoogleService-Info.plist in "Resources" (Classic) or "app/platform/ios" (Alloy) folder 8 | var Firebase = require('ti.firebase'); 9 | Firebase.configure(); 10 | ``` 11 | 12 | **createUserWithEmail** 13 | ```js 14 | var email = myEmailField.getValue(); 15 | var pwd = myPasswordField.getValue(); 16 | 17 | Firebase.FIRAuth.createUserWithEmail({ 18 | email: email, 19 | password: pwd, 20 | success: function(data) { 21 | alert(JSON.stringify(data)); 22 | }, 23 | error: function(data) { 24 | alert(JSON.stringify(data)); 25 | } 26 | }); 27 | ``` 28 | 29 | **signInWithEmail** 30 | ```js 31 | var email = myEmailField.getValue(); 32 | var pwd = myPasswordField.getValue(); 33 | 34 | Firebase.FIRAuth.signInWithEmail({ 35 | email: email, 36 | password: pwd, 37 | success: function(data) { 38 | alert(JSON.stringify(data)); 39 | }, 40 | error: function(data) { 41 | alert(JSON.stringify(data)); 42 | } 43 | }); 44 | ``` 45 | 46 | **signOut** 47 | ```js 48 | Firebase.FIRAuth.signOut({ 49 | success: function(data) { 50 | alert(JSON.stringify(data)); 51 | }, 52 | error: function(data) { 53 | alert(JSON.stringify(data)); 54 | } 55 | }); 56 | ``` 57 | 58 | **logEventWithName** 59 | ```js 60 | Firebase.FIRAnalytics.logEventWithName({ 61 | name: 'xyz', 62 | parameters: { 63 | 'VALUE': 0.99, 64 | 'CURRENCY': 'EUR' 65 | } 66 | }); 67 | ``` 68 | 69 | **setUserPropertyString** 70 | ```js 71 | Firebase.FIRAnalytics.setUserPropertyString({ 72 | name: 'value_name', 73 | value: 'the_value' 74 | }); 75 | ``` 76 | 77 | **projectID** 78 | ```js 79 | Firebase.getProjectID(); 80 | ``` 81 | 82 | # Firebase Debug Mode 83 | 84 | Firebase is setup in this module so that if you build your app in debug mode you will see debug logs from Firebase. 85 | The required argument passed on launch “-FIRAnalyticsDebugEnabled” is set in this module’s Xcode project product scheme. The scheme is set to “share” it’s settings with the project including the module. 86 | 87 | -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ti-firebase 4 | 5 | 6 | 7 | 8 | 9 | com.appcelerator.titanium.core.builder 10 | 11 | 12 | 13 | 14 | com.aptana.ide.core.unifiedBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | com.appcelerator.titanium.mobile.module.nature 27 | com.aptana.projects.webnature 28 | 29 | 30 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.apt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Sep 02 15:18:34 CDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.apt.aptEnabled=true 4 | org.eclipse.jdt.apt.genSrcDir=.apt_generated 5 | org.eclipse.jdt.apt.reconcileEnabled=true 6 | 7 | org.eclipse.jdt.apt.processorOptions/kroll.jsonFile=ti-firebase.json 8 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | #Thu Sep 02 15:18:34 CDT 2010 2 | eclipse.preferences.version=1 3 | org.eclipse.jdt.core.compiler.processAnnotations=enabled 4 | -------------------------------------------------------------------------------- /android/Resources/README.md: -------------------------------------------------------------------------------- 1 | Files in this folder are copied directory into the compiled product directory 2 | when the Android app is compiled: 3 | 4 | /build/android/bin/assets/Resources/ 5 | 6 | Files in this directory are copied directly on top of whatever files are already 7 | in the build directory, so please be careful that your files don't clobber 8 | essential project files or files from other modules. 9 | -------------------------------------------------------------------------------- /android/build.properties: -------------------------------------------------------------------------------- 1 | titanium.platform=/Users/cribe/Library/Application Support/Titanium/mobilesdk/osx/5.2.2.GA/android 2 | android.platform=/android-sdk-macosx/platforms/android-23 3 | google.apis=/android-sdk-macosx/add-ons/addon-google_apis-google-23 4 | android.ndk=/android-ndk-r12b -------------------------------------------------------------------------------- /android/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ant build script for Titanium Android module ti-firebase 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 | -------------------------------------------------------------------------------- /android/java-sources.txt: -------------------------------------------------------------------------------- 1 | "/Users/cribe/Documents/github-projects/ti-firebase/android/src/ti/firebase/ExampleProxy.java" 2 | "/Users/cribe/Documents/github-projects/ti-firebase/android/src/ti/firebase/TiFirebaseModule.java" -------------------------------------------------------------------------------- /android/lib/README: -------------------------------------------------------------------------------- 1 | You can place any .jar dependencies in this directory and they will be included 2 | when your module is being compiled. -------------------------------------------------------------------------------- /android/lib/com.google.android.gms.measurement.impl-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.android.gms.measurement.impl-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.auth.api-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.auth.api-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.auth.common-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.auth.common-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.auth.module-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.auth.module-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.crash-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.crash-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.database-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.database-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.database.connection-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.database.connection-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.iid-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.iid-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.messaging-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.messaging-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.remoteconfig-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.remoteconfig-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/com.google.firebase.storage-9.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/android/lib/com.google.firebase.storage-9.4.0.jar -------------------------------------------------------------------------------- /android/lib/renamer.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var _ = require('underscore'); 3 | var xml2js = require('xml2js'); 4 | 5 | var parser = new xml2js.Parser(); 6 | var list = _.filter(fs.readdirSync('.'), function(file) { 7 | return fs.statSync(file).isDirectory() && fs.existsSync(file+"/AndroidManifest.xml") && fs.statSync(file+"/AndroidManifest.xml").isFile() && fs.existsSync(file+"/classes.jar") ; 8 | }); 9 | 10 | list.forEach(function(folder) { 11 | var xml = fs.readFileSync(folder+"/AndroidManifest.xml"); 12 | parser.parseString(xml, function (err, result) { 13 | var packageName = result.manifest.$.package; 14 | fs.renameSync(folder+"/classes.jar", packageName+"-9.4.0.jar"); 15 | }); 16 | 17 | }); 18 | 19 | //list = list.map(fs.statSync); 20 | 21 | console.log(list); 22 | -------------------------------------------------------------------------------- /android/manifest: -------------------------------------------------------------------------------- 1 | # 2 | # this is your module manifest and used by Titanium 3 | # during compilation, packaging, distribution, etc. 4 | # 5 | version: 1.0.0 6 | apiversion: 2 7 | architectures: armeabi armeabi-v7a x86 8 | description: ti-firebase 9 | author: Your Name 10 | license: Specify your license 11 | copyright: Copyright (c) 2016 by Your Company 12 | 13 | # these should not be edited 14 | name: ti-firebase 15 | moduleid: ti.firebase 16 | guid: 1dc51f4a-d89b-4df2-89da-278d5a246c90 17 | platform: android 18 | minsdk: 5.2.2.GA 19 | -------------------------------------------------------------------------------- /android/platform/README.md: -------------------------------------------------------------------------------- 1 | Files in this folder are copied directory into the Android build directory 2 | when the Android app is compiled: 3 | 4 | /build/android 5 | 6 | You can place files such as res strings or drawable files. 7 | 8 | Files in this directory are copied directly on top of whatever files are already 9 | in the build directory, so please be careful that your files don't clobber 10 | essential project files or files from other modules. 11 | -------------------------------------------------------------------------------- /android/scripts/global_tracker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /android/scripts/import-google-services.js: -------------------------------------------------------------------------------- 1 | var opath = require("object-path"); 2 | var _ = require("underscore"); 3 | var fs = require("fs"); 4 | 5 | var template1 = _.template('\n' + 6 | '\n' + 7 | ' \n' + 8 | ' <%=google_app_id%>\n' + 9 | ' \n' + 10 | ' <%=gcm_defaultSenderId%>\n' + 11 | ' <%=default_web_client_id%>\n' + 12 | ' <%=ga_trackingId%>\n' + 13 | ' <%=firebase_database_url%>\n' + 14 | ' <%=google_api_key%>\n' + 15 | ' <%=google_crash_reporting_api_key%>\n' + 16 | ''); 17 | 18 | var template2 = _.template('\n' + 19 | '\n' + 20 | ' <%=ga_trackingId%>\n' + 21 | ''); 22 | 23 | 24 | var json = require('./google-services.json'); 25 | 26 | var cid = 0; 27 | var aid = 0; 28 | var values = { 29 | google_app_id: opath.get(json, "client." + cid + ".client_info.mobilesdk_app_id"), 30 | gcm_defaultSenderId: opath.get(json, "project_info.project_number"), 31 | default_web_client_id: opath.get(json, "client." + cid + ".oauth_client." + cid + ".client_id"), 32 | ga_trackingId: opath.get(json, "client." + cid + ".services.analytics-service.analytics_property.tracking_id"), 33 | firebase_database_url: opath.get(json, "project_info.firebase_url"), 34 | google_api_key: opath.get(json, "client." + cid + ".api_key." + aid + ".current_key"), 35 | google_crash_reporting_api_key: opath.get(json, "client." + cid + ".api_key." + aid + ".current_key"), 36 | }; 37 | 38 | 39 | var xml1 = template1(values); 40 | var xml2 = template2(values); 41 | 42 | 43 | fs.writeFileSync("values.xml", xml1); 44 | console.log("values.xml -> "); 45 | fs.writeFileSync("global_tracker.xml", xml2); 46 | -------------------------------------------------------------------------------- /android/scripts/node_modules/fs/index.js: -------------------------------------------------------------------------------- 1 | console.log("I'm `fs` modules"); 2 | -------------------------------------------------------------------------------- /android/scripts/node_modules/fs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fs", 3 | "version": "0.0.2", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "_id": "fs@0.0.2", 12 | "_npmVersion": "0.0.0-fake", 13 | "_nodeVersion": "0.0.0-fake", 14 | "_shasum": "e1f244ef3933c1b2a64bd4799136060d0f5914f8", 15 | "_npmUser": { 16 | "name": "npm", 17 | "email": "support@npmjs.com" 18 | }, 19 | "_from": "fs@*", 20 | "dist": { 21 | "shasum": "e1f244ef3933c1b2a64bd4799136060d0f5914f8", 22 | "tarball": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz" 23 | }, 24 | "maintainers": [ 25 | { 26 | "name": "npm", 27 | "email": "npm@npmjs.com" 28 | } 29 | ], 30 | "directories": {}, 31 | "_resolved": "https://registry.npmjs.org/fs/-/fs-0.0.2.tgz" 32 | } 33 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .settings 3 | .idea 4 | npm-debug.log 5 | generated 6 | coverage 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "0.12" 5 | - "0.10" 6 | - "4" 7 | - "6" 8 | after_script: NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage 9 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Mario Casciaro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | object-path 4 | =========== 5 | 6 | Access deep properties using a path 7 | 8 | [![NPM version](https://badge.fury.io/js/object-path.png)](http://badge.fury.io/js/object-path) 9 | [![Build Status](https://travis-ci.org/mariocasciaro/object-path.png)](https://travis-ci.org/mariocasciaro/object-path) 10 | [![Coverage Status](https://coveralls.io/repos/mariocasciaro/object-path/badge.png)](https://coveralls.io/r/mariocasciaro/object-path) 11 | [![devDependency Status](https://david-dm.org/mariocasciaro/object-path/dev-status.svg)](https://david-dm.org/mariocasciaro/object-path#info=devDependencies) 12 | ![Downloads](http://img.shields.io/npm/dm/object-path.svg) 13 | 14 | 15 | ## Changelog 16 | 17 | ### 0.11.0 18 | 19 | * Introduce ability to specify options and create new instances of `object-path` 20 | * Introduce option to control the way `object-path` deals with inherited properties (`includeInheritedProps`) 21 | * New default `object-path` instance already configured to handle not-own object properties (`withInheritedProps`) 22 | 23 | ### 0.10.0 24 | 25 | * Improved performance of `get`, `set`, and `push` by 2x-3x 26 | * Introduced a benchmarking test suite 27 | * **BREAKING CHANGE**: `del`, `empty`, `set` will not affect not-own object's properties (made them consistent with the other methods) 28 | 29 | ## Install 30 | 31 | ### Node.js 32 | 33 | ``` 34 | npm install object-path --save 35 | ``` 36 | 37 | ### Bower 38 | 39 | ``` 40 | bower install object-path --save 41 | ``` 42 | 43 | ### Typescript typings 44 | 45 | ``` 46 | tsd query object-path --action install --save 47 | ``` 48 | 49 | ## Usage 50 | 51 | ```javascript 52 | 53 | var obj = { 54 | a: { 55 | b: "d", 56 | c: ["e", "f"], 57 | '\u1200': 'unicode key', 58 | 'dot.dot': 'key' 59 | } 60 | }; 61 | 62 | var objectPath = require("object-path"); 63 | 64 | //get deep property 65 | objectPath.get(obj, "a.b"); //returns "d" 66 | objectPath.get(obj, ["a", "dot.dot"]); //returns "key" 67 | objectPath.get(obj, 'a.\u1200'); //returns "unicode key" 68 | 69 | //get the first non-undefined value 70 | objectPath.coalesce(obj, ['a.z', 'a.d', ['a','b']], 'default'); 71 | 72 | //empty a given path (but do not delete it) depending on their type,so it retains reference to objects and arrays. 73 | //functions that are not inherited from prototype are set to null. 74 | //object instances are considered objects and just own property names are deleted 75 | objectPath.empty(obj, 'a.b'); // obj.a.b is now '' 76 | objectPath.empty(obj, 'a.c'); // obj.a.c is now [] 77 | objectPath.empty(obj, 'a'); // obj.a is now {} 78 | 79 | //works also with arrays 80 | objectPath.get(obj, "a.c.1"); //returns "f" 81 | objectPath.get(obj, ["a","c","1"]); //returns "f" 82 | 83 | //can return a default value with get 84 | objectPath.get(obj, ["a.c.b"], "DEFAULT"); //returns "DEFAULT", since a.c.b path doesn't exists, if omitted, returns undefined 85 | 86 | //set 87 | objectPath.set(obj, "a.h", "m"); // or objectPath.set(obj, ["a","h"], "m"); 88 | objectPath.get(obj, "a.h"); //returns "m" 89 | 90 | //set will create intermediate object/arrays 91 | objectPath.set(obj, "a.j.0.f", "m"); 92 | 93 | //will insert values in array 94 | objectPath.insert(obj, "a.c", "m", 1); // obj.a.c = ["e", "m", "f"] 95 | 96 | //push into arrays (and create intermediate objects/arrays) 97 | objectPath.push(obj, "a.k", "o"); 98 | 99 | //ensure a path exists (if it doesn't, set the default value you provide) 100 | objectPath.ensureExists(obj, "a.k.1", "DEFAULT"); 101 | var oldVal = objectPath.ensureExists(obj, "a.b", "DEFAULT"); // oldval === "d" 102 | 103 | //deletes a path 104 | objectPath.del(obj, "a.b"); // obj.a.b is now undefined 105 | objectPath.del(obj, ["a","c",0]); // obj.a.c is now ['f'] 106 | 107 | //tests path existence 108 | objectPath.has(obj, "a.b"); // true 109 | objectPath.has(obj, ["a","d"]); // false 110 | 111 | //bind object 112 | var model = objectPath({ 113 | a: { 114 | b: "d", 115 | c: ["e", "f"] 116 | } 117 | }); 118 | 119 | //now any method from above is supported directly w/o passing an object 120 | model.get("a.b"); //returns "d" 121 | model.get(["a.c.b"], "DEFAULT"); //returns "DEFAULT" 122 | model.del("a.b"); // obj.a.b is now undefined 123 | model.has("a.b"); // false 124 | 125 | ``` 126 | ### How `object-path` deals with inherited properties 127 | 128 | By default `object-path` will only access an object's own properties. Look at the following example: 129 | 130 | ```javascript 131 | var proto = { 132 | notOwn: {prop: 'a'} 133 | } 134 | var obj = Object.create(proto); 135 | 136 | //This will return undefined (or the default value you specified), because notOwn is 137 | //an inherited property 138 | objectPath.get(obj, 'notOwn.prop'); 139 | 140 | //This will set the property on the obj instance and not the prototype. 141 | //In other words proto.notOwn.prop === 'a' and obj.notOwn.prop === 'b' 142 | objectPath.set(obj, 'notOwn.prop', 'b'); 143 | ``` 144 | To configure `object-path` to also deal with inherited properties, you need to create a new instance and specify 145 | the `includeInheritedProps = true` in the options object: 146 | 147 | ```javascript 148 | var objectPath = require("object-path"); 149 | var objectPathWithInheritedProps = objectPath.create({includeInheritedProps: true}) 150 | ``` 151 | 152 | Alternatively, `object-path` exposes an instance already configured to handle inherited properties (`objectPath.withInheritedProps`): 153 | ```javascript 154 | var objectPath = require("object-path"); 155 | var objectPathWithInheritedProps = objectPath.withInheritedProps 156 | ``` 157 | 158 | Once you have the new instance, you can access inherited properties as you access other properties: 159 | ```javascript 160 | var proto = { 161 | notOwn: {prop: 'a'} 162 | } 163 | var obj = Object.create(proto); 164 | 165 | //This will return 'a' 166 | objectPath.withInheritedProps.get(obj, 'notOwn.prop'); 167 | 168 | //This will set proto.notOwn.prop to 'b' 169 | objectPath.set(obj, 'notOwn.prop', 'b'); 170 | ``` 171 | 172 | ### Immutability 173 | 174 | If you are looking for an *immutable* alternative of this library, you can take a look at: [object-path-immutable](https://github.com/mariocasciaro/object-path-immutable) 175 | 176 | 177 | ### Credits 178 | 179 | * [Mario Casciaro](https://github.com/mariocasciaro) - Author 180 | * [Paulo Cesar](https://github.com/pocesar) - Major contributor 181 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/benchmark.js: -------------------------------------------------------------------------------- 1 | var Benchpress = require('@mariocasciaro/benchpress') 2 | var benchmark = new Benchpress() 3 | var op = require('./') 4 | 5 | var testObj = { 6 | level1_a: { 7 | level2_a: { 8 | level3_a: { 9 | level4_a: { 10 | } 11 | } 12 | } 13 | } 14 | } 15 | 16 | var testObj2 17 | 18 | benchmark 19 | .add('get existing', { 20 | iterations: 100000, 21 | fn: function() { 22 | op.get(testObj, ['level1_a', 'level2_a', 'level3_a', 'level4_a']) 23 | } 24 | }) 25 | .add('get non-existing', { 26 | iterations: 100000, 27 | fn: function() { 28 | op.get(testObj, ['level5_a']) 29 | } 30 | }) 31 | .add('push', { 32 | iterations: 100000, 33 | fn: function() { 34 | op.push(testObj, ['level1_a', 'level2_a', 'level3_a', 'level4_a', 'level5_a'], 'val') 35 | } 36 | }) 37 | .add('set non existing', { 38 | iterations: 100000, 39 | fn: function() { 40 | op.set(testObj2, ['level1_a', 'level2_b', 'level3_b', 'level4_b', 'level5_b'], 'val') 41 | }, 42 | beforeEach: function() { 43 | testObj2 = {} 44 | } 45 | }) 46 | .add('set existing', { 47 | iterations: 100000, 48 | fn: function() { 49 | op.set(testObj, ['level1_a', 'level2_a', 'level3_a', 'level4_a', 'level5_b'], 'val') 50 | } 51 | }) 52 | .run() 53 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "object-path", 3 | "main": "index.js", 4 | "keywords": [ 5 | "deep", 6 | "path", 7 | "access", 8 | "bean", 9 | "object" 10 | ], 11 | "ignore" : [ 12 | "test.js", 13 | "coverage", 14 | "*.yml" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "object-path", 3 | "description": "Access deep properties using a path", 4 | "version": "0.9.2", 5 | "author": { 6 | "name": "Mario Casciaro" 7 | }, 8 | "homepage": "https://github.com/mariocasciaro/object-path", 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/mariocasciaro/object-path.git" 12 | }, 13 | "main": "index.js", 14 | "scripts": ["index.js"], 15 | "keywords": [ 16 | "deep", 17 | "path", 18 | "access", 19 | "bean" 20 | ], 21 | "license": "MIT" 22 | } 23 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/index.js: -------------------------------------------------------------------------------- 1 | (function (root, factory){ 2 | 'use strict'; 3 | 4 | /*istanbul ignore next:cant test*/ 5 | if (typeof module === 'object' && typeof module.exports === 'object') { 6 | module.exports = factory(); 7 | } else if (typeof define === 'function' && define.amd) { 8 | // AMD. Register as an anonymous module. 9 | define([], factory); 10 | } else { 11 | // Browser globals 12 | root.objectPath = factory(); 13 | } 14 | })(this, function(){ 15 | 'use strict'; 16 | 17 | var toStr = Object.prototype.toString; 18 | function hasOwnProperty(obj, prop) { 19 | if(obj == null) { 20 | return false 21 | } 22 | //to handle objects with null prototypes (too edge case?) 23 | return Object.prototype.hasOwnProperty.call(obj, prop) 24 | } 25 | 26 | function isEmpty(value){ 27 | if (!value) { 28 | return true; 29 | } 30 | if (isArray(value) && value.length === 0) { 31 | return true; 32 | } else if (typeof value !== 'string') { 33 | for (var i in value) { 34 | if (hasOwnProperty(value, i)) { 35 | return false; 36 | } 37 | } 38 | return true; 39 | } 40 | return false; 41 | } 42 | 43 | function toString(type){ 44 | return toStr.call(type); 45 | } 46 | 47 | function isObject(obj){ 48 | return typeof obj === 'object' && toString(obj) === "[object Object]"; 49 | } 50 | 51 | var isArray = Array.isArray || function(obj){ 52 | /*istanbul ignore next:cant test*/ 53 | return toStr.call(obj) === '[object Array]'; 54 | } 55 | 56 | function isBoolean(obj){ 57 | return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'; 58 | } 59 | 60 | function getKey(key){ 61 | var intKey = parseInt(key); 62 | if (intKey.toString() === key) { 63 | return intKey; 64 | } 65 | return key; 66 | } 67 | 68 | function factory(options) { 69 | options = options || {} 70 | 71 | var objectPath = function(obj) { 72 | return Object.keys(objectPath).reduce(function(proxy, prop) { 73 | if(prop === 'create') { 74 | return proxy; 75 | } 76 | 77 | /*istanbul ignore else*/ 78 | if (typeof objectPath[prop] === 'function') { 79 | proxy[prop] = objectPath[prop].bind(objectPath, obj); 80 | } 81 | 82 | return proxy; 83 | }, {}); 84 | }; 85 | 86 | function getShallowProperty(obj, prop) { 87 | if (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)) { 88 | return obj[prop]; 89 | } 90 | } 91 | 92 | function set(obj, path, value, doNotReplace){ 93 | if (typeof path === 'number') { 94 | path = [path]; 95 | } 96 | if (!path || path.length === 0) { 97 | return obj; 98 | } 99 | if (typeof path === 'string') { 100 | return set(obj, path.split('.').map(getKey), value, doNotReplace); 101 | } 102 | var currentPath = path[0]; 103 | var currentValue = getShallowProperty(obj, currentPath); 104 | if (path.length === 1) { 105 | if (currentValue === void 0 || !doNotReplace) { 106 | obj[currentPath] = value; 107 | } 108 | return currentValue; 109 | } 110 | 111 | if (currentValue === void 0) { 112 | //check if we assume an array 113 | if(typeof path[1] === 'number') { 114 | obj[currentPath] = []; 115 | } else { 116 | obj[currentPath] = {}; 117 | } 118 | } 119 | 120 | return set(obj[currentPath], path.slice(1), value, doNotReplace); 121 | } 122 | 123 | objectPath.has = function (obj, path) { 124 | if (typeof path === 'number') { 125 | path = [path]; 126 | } else if (typeof path === 'string') { 127 | path = path.split('.'); 128 | } 129 | 130 | if (!path || path.length === 0) { 131 | return !!obj; 132 | } 133 | 134 | for (var i = 0; i < path.length; i++) { 135 | var j = getKey(path[i]); 136 | 137 | if((typeof j === 'number' && isArray(obj) && j < obj.length) || 138 | (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) { 139 | obj = obj[j]; 140 | } else { 141 | return false; 142 | } 143 | } 144 | 145 | return true; 146 | }; 147 | 148 | objectPath.ensureExists = function (obj, path, value){ 149 | return set(obj, path, value, true); 150 | }; 151 | 152 | objectPath.set = function (obj, path, value, doNotReplace){ 153 | return set(obj, path, value, doNotReplace); 154 | }; 155 | 156 | objectPath.insert = function (obj, path, value, at){ 157 | var arr = objectPath.get(obj, path); 158 | at = ~~at; 159 | if (!isArray(arr)) { 160 | arr = []; 161 | objectPath.set(obj, path, arr); 162 | } 163 | arr.splice(at, 0, value); 164 | }; 165 | 166 | objectPath.empty = function(obj, path) { 167 | if (isEmpty(path)) { 168 | return void 0; 169 | } 170 | if (obj == null) { 171 | return void 0; 172 | } 173 | 174 | var value, i; 175 | if (!(value = objectPath.get(obj, path))) { 176 | return void 0; 177 | } 178 | 179 | if (typeof value === 'string') { 180 | return objectPath.set(obj, path, ''); 181 | } else if (isBoolean(value)) { 182 | return objectPath.set(obj, path, false); 183 | } else if (typeof value === 'number') { 184 | return objectPath.set(obj, path, 0); 185 | } else if (isArray(value)) { 186 | value.length = 0; 187 | } else if (isObject(value)) { 188 | for (i in value) { 189 | if (hasOwnProperty(value, i)) { 190 | delete value[i]; 191 | } 192 | } 193 | } else { 194 | return objectPath.set(obj, path, null); 195 | } 196 | }; 197 | 198 | objectPath.push = function (obj, path /*, values */){ 199 | var arr = objectPath.get(obj, path); 200 | if (!isArray(arr)) { 201 | arr = []; 202 | objectPath.set(obj, path, arr); 203 | } 204 | 205 | arr.push.apply(arr, Array.prototype.slice.call(arguments, 2)); 206 | }; 207 | 208 | objectPath.coalesce = function (obj, paths, defaultValue) { 209 | var value; 210 | 211 | for (var i = 0, len = paths.length; i < len; i++) { 212 | if ((value = objectPath.get(obj, paths[i])) !== void 0) { 213 | return value; 214 | } 215 | } 216 | 217 | return defaultValue; 218 | }; 219 | 220 | objectPath.get = function (obj, path, defaultValue){ 221 | if (typeof path === 'number') { 222 | path = [path]; 223 | } 224 | if (!path || path.length === 0) { 225 | return obj; 226 | } 227 | if (obj == null) { 228 | return defaultValue; 229 | } 230 | if (typeof path === 'string') { 231 | return objectPath.get(obj, path.split('.'), defaultValue); 232 | } 233 | 234 | var currentPath = getKey(path[0]); 235 | var nextObj = getShallowProperty(obj, currentPath) 236 | if (nextObj === void 0) { 237 | return defaultValue; 238 | } 239 | 240 | if (path.length === 1) { 241 | return nextObj; 242 | } 243 | 244 | return objectPath.get(obj[currentPath], path.slice(1), defaultValue); 245 | }; 246 | 247 | objectPath.del = function del(obj, path) { 248 | if (typeof path === 'number') { 249 | path = [path]; 250 | } 251 | 252 | if (obj == null) { 253 | return obj; 254 | } 255 | 256 | if (isEmpty(path)) { 257 | return obj; 258 | } 259 | if(typeof path === 'string') { 260 | return objectPath.del(obj, path.split('.')); 261 | } 262 | 263 | var currentPath = getKey(path[0]); 264 | var currentVal = getShallowProperty(obj, currentPath); 265 | if(currentVal == null) { 266 | return currentVal; 267 | } 268 | 269 | if(path.length === 1) { 270 | if (isArray(obj)) { 271 | obj.splice(currentPath, 1); 272 | } else { 273 | delete obj[currentPath]; 274 | } 275 | } else { 276 | if (obj[currentPath] !== void 0) { 277 | return objectPath.del(obj[currentPath], path.slice(1)); 278 | } 279 | } 280 | 281 | return obj; 282 | } 283 | 284 | return objectPath; 285 | } 286 | 287 | var mod = factory(); 288 | mod.create = factory; 289 | mod.withInheritedProps = factory({includeInheritedProps: true}) 290 | return mod; 291 | }); 292 | -------------------------------------------------------------------------------- /android/scripts/node_modules/object-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "object-path", 3 | "description": "Access deep object properties using a path", 4 | "version": "0.11.2", 5 | "author": { 6 | "name": "Mario Casciaro" 7 | }, 8 | "homepage": "https://github.com/mariocasciaro/object-path", 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/mariocasciaro/object-path.git" 12 | }, 13 | "engines": { 14 | "node": ">=0.10.0" 15 | }, 16 | "devDependencies": { 17 | "@mariocasciaro/benchpress": "^0.1.3", 18 | "chai": "^3.5.0", 19 | "coveralls": "^2.11.2", 20 | "istanbul": "^0.4.4", 21 | "mocha": "^2.2.4", 22 | "mocha-lcov-reporter": "^1.2.0" 23 | }, 24 | "scripts": { 25 | "test": "istanbul cover ./node_modules/mocha/bin/_mocha test.js --report html -- -R spec" 26 | }, 27 | "keywords": [ 28 | "deep", 29 | "path", 30 | "access", 31 | "bean", 32 | "get", 33 | "property", 34 | "dot", 35 | "prop", 36 | "object", 37 | "obj", 38 | "notation", 39 | "segment", 40 | "value", 41 | "nested", 42 | "key" 43 | ], 44 | "license": "MIT", 45 | "gitHead": "f01ab7ce2c9ca09cf3e7ad39ca9f38a7f9cf9dc2", 46 | "bugs": { 47 | "url": "https://github.com/mariocasciaro/object-path/issues" 48 | }, 49 | "_id": "object-path@0.11.2", 50 | "_shasum": "74bf3b3c5a7f2024d75e333f12021353fa9d485e", 51 | "_from": "object-path@*", 52 | "_npmVersion": "2.15.5", 53 | "_nodeVersion": "4.4.5", 54 | "_npmUser": { 55 | "name": "mariocasciaro", 56 | "email": "mariocasciaro@gmail.com" 57 | }, 58 | "maintainers": [ 59 | { 60 | "name": "mariocasciaro", 61 | "email": "mariocasciaro@gmail.com" 62 | } 63 | ], 64 | "dist": { 65 | "shasum": "74bf3b3c5a7f2024d75e333f12021353fa9d485e", 66 | "tarball": "https://registry.npmjs.org/object-path/-/object-path-0.11.2.tgz" 67 | }, 68 | "_npmOperationalInternal": { 69 | "host": "packages-16-east.internal.npmjs.com", 70 | "tmp": "tmp/object-path-0.11.2.tgz_1472723253682_0.7585110168438405" 71 | }, 72 | "directories": {}, 73 | "_resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.2.tgz" 74 | } 75 | -------------------------------------------------------------------------------- /android/scripts/node_modules/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative 2 | Reporters & Editors 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /android/scripts/node_modules/underscore/README.md: -------------------------------------------------------------------------------- 1 | __ 2 | /\ \ __ 3 | __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ 4 | /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ 5 | \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ 6 | \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ 7 | \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ 8 | \ \____/ 9 | \/___/ 10 | 11 | Underscore.js is a utility-belt library for JavaScript that provides 12 | support for the usual functional suspects (each, map, reduce, filter...) 13 | without extending any core JavaScript objects. 14 | 15 | For Docs, License, Tests, and pre-packed downloads, see: 16 | http://underscorejs.org 17 | 18 | Underscore is an open-sourced component of DocumentCloud: 19 | https://github.com/documentcloud 20 | 21 | Many thanks to our contributors: 22 | https://github.com/jashkenas/underscore/contributors 23 | -------------------------------------------------------------------------------- /android/scripts/node_modules/underscore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "description": "JavaScript's functional programming helper library.", 4 | "homepage": "http://underscorejs.org", 5 | "keywords": [ 6 | "util", 7 | "functional", 8 | "server", 9 | "client", 10 | "browser" 11 | ], 12 | "author": { 13 | "name": "Jeremy Ashkenas", 14 | "email": "jeremy@documentcloud.org" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git://github.com/jashkenas/underscore.git" 19 | }, 20 | "main": "underscore.js", 21 | "version": "1.8.3", 22 | "devDependencies": { 23 | "docco": "*", 24 | "eslint": "0.6.x", 25 | "karma": "~0.12.31", 26 | "karma-qunit": "~0.1.4", 27 | "qunit-cli": "~0.2.0", 28 | "uglify-js": "2.4.x" 29 | }, 30 | "scripts": { 31 | "test": "npm run test-node && npm run lint", 32 | "lint": "eslint underscore.js test/*.js", 33 | "test-node": "qunit-cli test/*.js", 34 | "test-browser": "npm i karma-phantomjs-launcher && ./node_modules/karma/bin/karma start", 35 | "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", 36 | "doc": "docco underscore.js" 37 | }, 38 | "license": "MIT", 39 | "files": [ 40 | "underscore.js", 41 | "underscore-min.js", 42 | "underscore-min.map", 43 | "LICENSE" 44 | ], 45 | "gitHead": "e4743ab712b8ab42ad4ccb48b155034d02394e4d", 46 | "bugs": { 47 | "url": "https://github.com/jashkenas/underscore/issues" 48 | }, 49 | "_id": "underscore@1.8.3", 50 | "_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022", 51 | "_from": "underscore@*", 52 | "_npmVersion": "1.4.28", 53 | "_npmUser": { 54 | "name": "jashkenas", 55 | "email": "jashkenas@gmail.com" 56 | }, 57 | "maintainers": [ 58 | { 59 | "name": "jashkenas", 60 | "email": "jashkenas@gmail.com" 61 | } 62 | ], 63 | "dist": { 64 | "shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022", 65 | "tarball": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz" 66 | }, 67 | "directories": {}, 68 | "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz" 69 | } 70 | -------------------------------------------------------------------------------- /android/scripts/node_modules/underscore/underscore-min.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.8.3 2 | // http://underscorejs.org 3 | // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4 | // Underscore may be freely distributed under the MIT license. 5 | (function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); 6 | //# sourceMappingURL=underscore-min.map -------------------------------------------------------------------------------- /android/scripts/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1:281852802951:android:217872f43f252bb5 5 | 6 | 281852802951 7 | 281852802951-csl64l8s7ijgi1rh43399apkinr9qv0o.apps.googleusercontent.com 8 | 9 | https://fire-demo-49cb5.firebaseio.com 10 | AIzaSyAJy17pR9iKtXdumFvCvMfNAoNWEBT2dLc 11 | AIzaSyAJy17pR9iKtXdumFvCvMfNAoNWEBT2dLc 12 | -------------------------------------------------------------------------------- /android/src/ti/firebase/ExampleProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file was auto-generated by the Titanium Module SDK helper for Android 3 | * Appcelerator Titanium Mobile 4 | * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. 5 | * Licensed under the terms of the Apache Public License 6 | * Please see the LICENSE included with this distribution for details. 7 | * 8 | */ 9 | package ti.firebase; 10 | /* 11 | import org.appcelerator.kroll.KrollDict; 12 | import org.appcelerator.kroll.KrollProxy; 13 | import org.appcelerator.kroll.annotations.Kroll; 14 | import org.appcelerator.titanium.TiC; 15 | import org.appcelerator.titanium.util.Log; 16 | import org.appcelerator.titanium.util.TiConfig; 17 | import org.appcelerator.titanium.util.TiConvert; 18 | import org.appcelerator.titanium.proxy.TiViewProxy; 19 | import org.appcelerator.titanium.view.TiCompositeLayout; 20 | import org.appcelerator.titanium.view.TiCompositeLayout.LayoutArrangement; 21 | import org.appcelerator.titanium.view.TiUIView; 22 | 23 | import android.app.Activity; 24 | 25 | 26 | // This proxy can be created by calling TiFirebase.createExample({message: "hello world"}) 27 | @Kroll.proxy(creatableInModule=TiFirebaseModule.class) 28 | public class ExampleProxy extends TiViewProxy 29 | { 30 | // Standard Debugging variables 31 | private static final String LCAT = "ExampleProxy"; 32 | private static final boolean DBG = TiConfig.LOGD; 33 | 34 | private class ExampleView extends TiUIView 35 | { 36 | public ExampleView(TiViewProxy proxy) { 37 | super(proxy); 38 | LayoutArrangement arrangement = LayoutArrangement.DEFAULT; 39 | 40 | if (proxy.hasProperty(TiC.PROPERTY_LAYOUT)) { 41 | String layoutProperty = TiConvert.toString(proxy.getProperty(TiC.PROPERTY_LAYOUT)); 42 | if (layoutProperty.equals(TiC.LAYOUT_HORIZONTAL)) { 43 | arrangement = LayoutArrangement.HORIZONTAL; 44 | } else if (layoutProperty.equals(TiC.LAYOUT_VERTICAL)) { 45 | arrangement = LayoutArrangement.VERTICAL; 46 | } 47 | } 48 | setNativeView(new TiCompositeLayout(proxy.getActivity(), arrangement)); 49 | } 50 | 51 | @Override 52 | public void processProperties(KrollDict d) 53 | { 54 | super.processProperties(d); 55 | } 56 | } 57 | 58 | 59 | // Constructor 60 | public ExampleProxy() 61 | { 62 | super(); 63 | } 64 | 65 | @Override 66 | public TiUIView createView(Activity activity) 67 | { 68 | TiUIView view = new ExampleView(this); 69 | view.getLayoutParams().autoFillsHeight = true; 70 | view.getLayoutParams().autoFillsWidth = true; 71 | return view; 72 | } 73 | 74 | // Handle creation options 75 | @Override 76 | public void handleCreationDict(KrollDict options) 77 | { 78 | super.handleCreationDict(options); 79 | 80 | if (options.containsKey("message")) { 81 | Log.d(LCAT, "example created with message: " + options.get("message")); 82 | } 83 | } 84 | 85 | // Methods 86 | @Kroll.method 87 | public void printMessage(String message) 88 | { 89 | Log.d(LCAT, "printing message: " + message); 90 | } 91 | 92 | 93 | @Kroll.getProperty @Kroll.method 94 | public String getMessage() 95 | { 96 | return "Hello World from my module"; 97 | } 98 | 99 | @Kroll.setProperty @Kroll.method 100 | public void setMessage(String message) 101 | { 102 | Log.d(LCAT, "Tried setting module message to: " + message); 103 | } 104 | } 105 | */ -------------------------------------------------------------------------------- /android/src/ti/firebase/TiFirebaseModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file was auto-generated by the Titanium Module SDK helper for Android 3 | * Appcelerator Titanium Mobile 4 | * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. 5 | * Licensed under the terms of the Apache Public License 6 | * Please see the LICENSE included with this distribution for details. 7 | * 8 | */ 9 | package ti.firebase; 10 | /* 11 | import org.appcelerator.kroll.KrollModule; 12 | import org.appcelerator.kroll.annotations.Kroll; 13 | 14 | import org.appcelerator.titanium.TiApplication; 15 | import org.appcelerator.kroll.common.Log; 16 | import org.appcelerator.kroll.common.TiConfig; 17 | 18 | 19 | @Kroll.module(name="TiFirebase", id="ti.firebase") 20 | public class TiFirebaseModule extends KrollModule 21 | // Standard Debugging variables 22 | private static final String LCAT = "FirebaseModule"; 23 | 24 | public static boolean debuggable = false; 25 | 26 | public TiFirebaseModule() { 27 | super(); 28 | } 29 | 30 | @Kroll.onAppCreate 31 | public static void onAppCreate(TiApplication app) { 32 | Log.d(LCAT, "inside onAppCreate"); 33 | // put module init code that needs to run when the application is 34 | // created 35 | } 36 | 37 | @Kroll.method 38 | public boolean configure() { 39 | try{ 40 | //final Fabric fabric = new Fabric.Builder(TiApplication.getInstance()).kits(new Crashlytics()).debuggable(debuggable).build(); 41 | //Fabric.with(fabric); 42 | return true; 43 | }catch(Exception exp){ 44 | Log.e(LCAT, exp.getMessage()); 45 | return false; 46 | } 47 | } 48 | } 49 | */ -------------------------------------------------------------------------------- /android/timodule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /assets/README: -------------------------------------------------------------------------------- 1 | Place your assets like PNG files in this directory and they will be packaged 2 | with your module. 3 | 4 | All JavaScript files in the assets directory are IGNORED except if you create a 5 | file named "ti.firebase.js" in this directory in which case it will be 6 | wrapped by native code, compiled, and used as your module. This allows you to 7 | run pure JavaScript modules that are pre-compiled. 8 | 9 | Note: Mobile Web does not support this assets directory. 10 | -------------------------------------------------------------------------------- /documentation/index.md: -------------------------------------------------------------------------------- 1 | # ti-firebase Module 2 | 3 | ## Description 4 | 5 | TODO: Enter your module description here 6 | 7 | ## Accessing the ti-firebase Module 8 | 9 | To access this module from JavaScript, you would do the following: 10 | 11 | var ti_firebase = require("ti.firebase"); 12 | 13 | The ti_firebase variable is a reference to the Module object. 14 | 15 | ## Reference 16 | 17 | TODO: If your module has an API, you should document 18 | the reference here. 19 | 20 | ### ti_firebase.function 21 | 22 | TODO: This is an example of a module function. 23 | 24 | ### ti_firebase.property 25 | 26 | TODO: This is an example of a module property. 27 | 28 | ## Usage 29 | 30 | TODO: Enter your usage example here 31 | 32 | ## Author 33 | 34 | TODO: Enter your author name, email and other contact 35 | details you want to share here. 36 | 37 | ## License 38 | 39 | TODO: Enter your license/legal information here. 40 | -------------------------------------------------------------------------------- /example/app.js: -------------------------------------------------------------------------------- 1 | // this sets the background color of the master UIView (when there are no windows/tab groups on it) 2 | Titanium.UI.setBackgroundColor('#FFF'); 3 | //Firebase init 4 | var _tFireb = require('ti.firebase'); 5 | _tFireb.configure(); 6 | 7 | var win = Titanium.UI.createWindow({ 8 | fullscreen: true, 9 | top: 0, left: 0, 10 | width: Ti.UI.FILL, 11 | height: Ti.UI.FILL 12 | }); 13 | var _v ={}; 14 | _v = initUI(_v); 15 | 16 | win.add(_v.self); 17 | win.open(); 18 | 19 | function initUI(v){ 20 | var tFieldProps = { 21 | top: 6, left: 6, right: 6, 22 | paddingLeft: 6, 23 | autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, 24 | borderColor:'lightgray', borderWidth:1, 25 | textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT, 26 | height: 30, width: Ti.UI.FILL 27 | }; 28 | v.self = Ti.UI.createScrollView({ 29 | top:20, left: 0, 30 | layout: 'vertical', 31 | width: Ti.UI.FILL, height: Ti.UI.SIZE 32 | }); 33 | v.demo_lbl = Titanium.UI.createLabel({ 34 | text:'Ti Firebase demo', 35 | width:'auto', 36 | font:{fontSize: 20} 37 | }); 38 | v.self.add(v.demo_lbl); 39 | 40 | //#### Login with email test #### 41 | v.lBox_v = Ti.UI.createView({ 42 | top:10, 43 | layout: 'vertical', 44 | width: '90%', height: Ti.UI.SIZE, 45 | borderColor:'black', borderWidth: 1, 46 | borderRadius: 6 47 | }); 48 | v.title_lbl = Titanium.UI.createLabel({ 49 | top: 6, 50 | text:'-- Login/Create user with email --', 51 | color:'lightgray', 52 | width: Ti.UI.SIZE, height: Ti.UI.SIZE 53 | }); 54 | v.lBox_v.add(v.title_lbl); 55 | 56 | v.email_f = Ti.UI.createTextField(tFieldProps); 57 | v.email_f.hintText = 'Email'; 58 | v.lBox_v.add(v.email_f); 59 | 60 | v.pwd_f = Ti.UI.createTextField(tFieldProps); 61 | v.pwd_f.passwordMask = true; 62 | v.pwd_f.hintText = 'Password'; 63 | v.lBox_v.add(v.pwd_f); 64 | 65 | //btn actions 66 | v.createByEmailBtn = Ti.UI.createButton({ 67 | title: 'Create User', 68 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 69 | }); 70 | v.signInByEmailBtn = Ti.UI.createButton({ 71 | title: 'Login User', 72 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 73 | }); 74 | v.signOutBtn = Ti.UI.createButton({ 75 | title: 'Signout User', 76 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 77 | }); 78 | v.currentUserBtn = Ti.UI.createButton({ 79 | title: 'Current User', 80 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 81 | }); 82 | 83 | v.lBox_v.add(v.createByEmailBtn); 84 | v.lBox_v.add(v.signInByEmailBtn); 85 | v.lBox_v.add(v.signOutBtn); 86 | v.lBox_v.add(v.currentUserBtn); 87 | v.self.add(v.lBox_v); 88 | 89 | //#### log events box #### 90 | v.evtBox_v = Ti.UI.createView({ 91 | top:10, 92 | layout: 'vertical', 93 | width: '90%', height: Ti.UI.SIZE, 94 | borderColor:'black', borderWidth: 1, 95 | borderRadius: 6 96 | }); 97 | v.self.add(v.evtBox_v); 98 | 99 | v.eTitle_lbl = Titanium.UI.createLabel({ 100 | top: 6, 101 | text:'-- logEventWithName --', 102 | color:'lightgray', 103 | width: Ti.UI.SIZE, height: Ti.UI.SIZE 104 | }); 105 | v.evtBox_v.add(v.eTitle_lbl); 106 | 107 | v.evtName_f = Ti.UI.createTextField(tFieldProps); 108 | v.evtName_f.hintText = 'Event Name'; 109 | v.evtBox_v.add(v.evtName_f); 110 | 111 | v.eParams_lbl = Titanium.UI.createLabel({ 112 | top: 6, left: 6, 113 | text:'Parameters key/values (pipe seperated "|")', 114 | color:'lightgray', 115 | width: Ti.UI.SIZE, height: Ti.UI.SIZE 116 | }); 117 | v.evtBox_v.add(v.eParams_lbl); 118 | 119 | v.evtKeys_f = Ti.UI.createTextField(tFieldProps); 120 | v.evtKeys_f.hintText = 'Keys'; 121 | v.evtBox_v.add(v.evtKeys_f); 122 | 123 | v.evtValues_f = Ti.UI.createTextField(tFieldProps); 124 | v.evtValues_f.hintText = 'Values (use comma for float values)'; 125 | v.evtBox_v.add(v.evtValues_f); 126 | 127 | v.logEventBtn = Ti.UI.createButton({ 128 | title: 'Log event', 129 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 130 | }); 131 | v.evtBox_v.add(v.logEventBtn); 132 | 133 | 134 | //#### setUserPropertyString #### 135 | v.uPropBox_v = Ti.UI.createView({ 136 | top:10, 137 | layout: 'vertical', 138 | width: '90%', height: Ti.UI.SIZE, 139 | borderColor:'black', borderWidth: 1, 140 | borderRadius: 6 141 | }); 142 | v.self.add(v.uPropBox_v); 143 | 144 | v.uPropTitle_lbl = Titanium.UI.createLabel({ 145 | top: 6, 146 | text:'-- setUserPropertyString --', 147 | color:'lightgray', 148 | width: Ti.UI.SIZE, height: Ti.UI.SIZE 149 | }); 150 | v.uPropBox_v.add(v.uPropTitle_lbl); 151 | 152 | v.uPropName_f = Ti.UI.createTextField(tFieldProps); 153 | v.uPropName_f.hintText = 'Name'; 154 | v.uPropBox_v.add(v.uPropName_f); 155 | 156 | v.uPropValue_f = Ti.UI.createTextField(tFieldProps); 157 | v.uPropValue_f.hintText = 'Value'; 158 | v.uPropBox_v.add(v.uPropValue_f); 159 | 160 | v.setUPropBtn = Ti.UI.createButton({ 161 | title: 'Set property', 162 | with: Ti.UI.SIZE, height: Ti.UI.SIZE 163 | }); 164 | v.uPropBox_v.add(v.setUPropBtn); 165 | 166 | addEvents(v); 167 | return(v); 168 | } 169 | 170 | function addEvents(v){ 171 | v.createByEmailBtn.addEventListener('click', createUserWithEmailCb); 172 | v.signInByEmailBtn.addEventListener('click', signInWithEmailCb); 173 | v.signOutBtn.addEventListener('click', signOutCb); 174 | 175 | v.currentUserBtn.addEventListener('click', function(e){ 176 | alert(JSON.stringify(_tFireb.FIRAuth.currentUser)); 177 | }); 178 | 179 | v.logEventBtn.addEventListener('click', logEventWithNameCb); 180 | v.setUPropBtn.addEventListener('click', setUPropBtnCb); 181 | } 182 | 183 | function createUserWithEmailCb(e){ 184 | var email = _v.email_f.value; 185 | var pwd = _v.pwd_f.value; 186 | 187 | _tFireb.FIRAuth.createUserWithEmail({ 188 | 'email': email, 189 | 'password': pwd, 190 | 'success': function(data){ 191 | alert(JSON.stringify(data)); 192 | }, 193 | 'error': function(data){ 194 | alert(JSON.stringify(data)); 195 | } 196 | }); 197 | } 198 | function signInWithEmailCb(e){ 199 | var email = _v.email_f.value; 200 | var pwd = _v.pwd_f.value; 201 | _tFireb.FIRAuth.signInWithEmail({ 202 | 'email': email, 203 | 'password': pwd, 204 | 'success': function(data){ 205 | alert(JSON.stringify(data)); 206 | }, 207 | 'error': function(data){ 208 | alert(JSON.stringify(data)); 209 | } 210 | }); 211 | } 212 | function signOutCb(e){ 213 | _tFireb.FIRAuth.signOut({ 214 | 'success': function(data){ 215 | alert(JSON.stringify(data)); 216 | }, 217 | 'error': function(data){ 218 | alert(JSON.stringify(data)); 219 | } 220 | }); 221 | } 222 | function logEventWithNameCb(e){ 223 | 224 | var name = _v.evtName_f.value; 225 | var keys = _v.evtKeys_f.value; 226 | var values = _v.evtValues_f.value; 227 | //build key value for parameters 228 | var aKeys = keys.split('|'); 229 | var aVals = values.split('|'); 230 | if(aKeys.length == 0 || (aKeys.length != aVals.length)){ 231 | alert('Event key/values count does not match!'); 232 | return; 233 | } 234 | var paramData = {}; 235 | for(var idx in aKeys){ 236 | paramData[aKeys[idx]] = aVals[idx]; 237 | } 238 | 239 | var logParams = { 240 | 'name': name, 241 | 'parameters': paramData 242 | }; 243 | //Ti.API.info("Sending logEvtData", logParams); 244 | _tFireb.FIRAnalytics.logEventWithName(logParams); 245 | alert("Sent Event Data:\n" + JSON.stringify(logParams)); 246 | } 247 | 248 | function setUPropBtnCb(e){ 249 | 250 | var name = _v.uPropName_f.value; 251 | var value = _v.uPropValue_f.value; 252 | var setParams = { 253 | 'name': name, 254 | 'value': value 255 | }; 256 | _tFireb.FIRAnalytics.setUserPropertyString(setParams); 257 | alert("Set user property data:\n" + JSON.stringify(setParams) + " for user:" + JSON.stringify(_tFireb.FIRAuth.currentUser)); 258 | } 259 | -------------------------------------------------------------------------------- /iphone/.gitignore: -------------------------------------------------------------------------------- 1 | # Build folder and log file 2 | build/ 3 | build.log -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseAnalyticsModule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase auth module 3 | * 4 | * Created by Your Name 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiModule.h" 9 | #import "Firebase.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TiFirebaseAnalyticsModule : TiModule { 14 | 15 | } 16 | 17 | /** 18 | * Logs an app event. 19 | * 20 | * @param args The arguments to define the log. 21 | */ 22 | - (void)logEventWithName:(id)args; 23 | 24 | /** 25 | * Sets a user property to a given value. 26 | * 27 | * @param args The arguments to define the user-property. 28 | */ 29 | - (void)setUserPropertyString:(id)args; 30 | 31 | /** 32 | * Sets a user ID to a given value. 33 | * 34 | * @param args The arguments to define the user ID. 35 | */ 36 | - (void)setUserID:(id)value; 37 | 38 | /** 39 | * Sets a screen nam and screen class to a given value. 40 | * 41 | * @param args The arguments to define the screen name and screen class. 42 | */ 43 | - (void)setScreenName:(id)args; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseAnalyticsModule.m: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase FIRAnalytics 3 | * 4 | * Created by Your Name 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiFirebaseModule.h" 9 | #import "TiFirebaseAnalyticsModule.h" 10 | #import "TiBase.h" 11 | #import "TiHost.h" 12 | #import "TiUtils.h" 13 | 14 | @implementation TiFirebaseAnalyticsModule 15 | 16 | #pragma Public APIs 17 | 18 | - (void)logEventWithName:(id)args 19 | { 20 | ENSURE_UI_THREAD(logEventWithName, args); 21 | ENSURE_SINGLE_ARG(args, NSDictionary); 22 | 23 | NSString *name; 24 | NSMutableDictionary *parameters; 25 | 26 | ENSURE_ARG_OR_NIL_FOR_KEY(name, args, @"name", NSString); 27 | ENSURE_ARG_OR_NIL_FOR_KEY(parameters, args, @"parameters", NSMutableDictionary); 28 | 29 | // Convert numerical parameters to NSNumber (firebase expects numbers not string numbers) 30 | NSNumberFormatter *nFormatter = [[NSNumberFormatter alloc] init]; 31 | nFormatter.numberStyle = NSNumberFormatterDecimalStyle; 32 | 33 | NSArray *keysCopy = [[parameters allKeys] copy]; 34 | 35 | for (NSString *key in keysCopy) { 36 | NSNumber *strNumber = [nFormatter numberFromString:[parameters valueForKey:key]]; 37 | 38 | // If a number was converted from string then not nil 39 | if (strNumber != nil) { 40 | [parameters setValue:strNumber forKey:key]; 41 | } 42 | } 43 | 44 | [FIRAnalytics logEventWithName:name 45 | parameters:parameters]; 46 | } 47 | 48 | - (void)setUserPropertyString:(id)args 49 | { 50 | ENSURE_UI_THREAD(setUserPropertyString, args); 51 | ENSURE_SINGLE_ARG(args, NSDictionary); 52 | 53 | NSString *value; 54 | NSString *name; 55 | 56 | ENSURE_ARG_OR_NIL_FOR_KEY(value, args, @"value", NSString); 57 | ENSURE_ARG_OR_NIL_FOR_KEY(name, args, @"name", NSString); 58 | 59 | [FIRAnalytics setUserPropertyString:value 60 | forName:name]; 61 | } 62 | 63 | - (void)setUserID:(id)value 64 | { 65 | ENSURE_UI_THREAD(setUserID, value); 66 | ENSURE_SINGLE_ARG(value, NSString); 67 | 68 | [FIRAnalytics setUserID:[TiUtils stringValue:value]]; 69 | } 70 | 71 | - (void)setScreenName:(id)args 72 | { 73 | ENSURE_UI_THREAD(setScreenName, args); 74 | ENSURE_SINGLE_ARG(args, NSDictionary); 75 | 76 | NSString *screenName; 77 | NSString *screenClass; 78 | 79 | ENSURE_ARG_OR_NIL_FOR_KEY(screenName, args, @"screenName", NSString); 80 | ENSURE_ARG_OR_NIL_FOR_KEY(screenClass, args, @"screenClass", NSString); 81 | 82 | [FIRAnalytics setScreenName:screenName 83 | screenClass:screenClass]; 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseAuthModule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase FIRAuth 3 | * 4 | * Created by cribe 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiModule.h" 9 | #import "Firebase.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TiFirebaseAuthModule : TiModule { 14 | 15 | } 16 | 17 | /** 18 | * Logs an app event. 19 | * 20 | * @param args The arguments to define the log. 21 | */ 22 | - (void)logEventWithName:(id)args; 23 | 24 | /** 25 | * Sets a user property to a given value. 26 | * 27 | * @param args The arguments to define the user-property. 28 | */ 29 | - (void)setUserPropertyString:(id)args; 30 | 31 | /** 32 | * Creates and, on success, signs in a user with the given email address and password. 33 | * 34 | * @param args The arguments to define the user-registration. 35 | */ 36 | - (void)createUserWithEmail:(id)args; 37 | 38 | /** 39 | * Signs in using an email address and password. 40 | * 41 | * @param args The arguments to define the user-login. 42 | */ 43 | - (void)signInWithEmail:(id)args; 44 | 45 | /** 46 | * Signs out the current user. 47 | * 48 | * @param args The arguments to define the user-logout. 49 | */ 50 | - (void)signOut:(id)args; 51 | 52 | /** 53 | * Sends a password reset email. 54 | * 55 | * @param args The arguments to define the reset email receiver. 56 | */ 57 | - (void)sendPasswordResetWithEmail:(id)args; 58 | 59 | /** 60 | * Synchronously gets the cached current user, or null if there is none. 61 | */ 62 | - (NSDictionary *_Nullable)currentUser; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseAuthModule.m: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase FIRAuth 3 | * 4 | * Created by Your Name 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiFirebaseModule.h" 9 | #import "TiFirebaseAuthModule.h" 10 | #import "TiBase.h" 11 | #import "TiHost.h" 12 | #import "TiUtils.h" 13 | 14 | @implementation TiFirebaseAuthModule 15 | 16 | #pragma Public APIs 17 | 18 | - (void)logEventWithName:(id)args 19 | { 20 | ENSURE_UI_THREAD(logEventWithName, args); 21 | ENSURE_SINGLE_ARG(args, NSDictionary); 22 | 23 | NSString *name; 24 | NSDictionary *parameters; 25 | 26 | ENSURE_ARG_OR_NIL_FOR_KEY(name, args, @"name", NSString); 27 | ENSURE_ARG_OR_NIL_FOR_KEY(parameters, args, @"parameter", NSDictionary); 28 | 29 | [FIRAnalytics logEventWithName:name 30 | parameters:parameters]; 31 | } 32 | 33 | - (void)setUserPropertyString:(id)args 34 | { 35 | ENSURE_UI_THREAD(setUserPropertyString, args); 36 | ENSURE_SINGLE_ARG(args, NSDictionary); 37 | 38 | NSString *value; 39 | NSString *name; 40 | 41 | ENSURE_ARG_OR_NIL_FOR_KEY(value, args, @"value", NSString); 42 | ENSURE_ARG_OR_NIL_FOR_KEY(name, args, @"name", NSString); 43 | 44 | [FIRAnalytics setUserPropertyString:value 45 | forName:name]; 46 | } 47 | 48 | - (void)createUserWithEmail:(id)args 49 | { 50 | ENSURE_UI_THREAD(createUserWithEmail, args); 51 | ENSURE_SINGLE_ARG(args, NSDictionary); 52 | 53 | NSString *email; 54 | NSString *password; 55 | KrollCallback *successCallback; 56 | KrollCallback *errorCallback; 57 | 58 | ENSURE_ARG_OR_NIL_FOR_KEY(email, args, @"email", NSString); 59 | ENSURE_ARG_OR_NIL_FOR_KEY(password, args, @"password", NSString); 60 | ENSURE_ARG_OR_NIL_FOR_KEY(successCallback, args, @"success", KrollCallback); 61 | ENSURE_ARG_OR_NIL_FOR_KEY(errorCallback, args, @"error", KrollCallback); 62 | 63 | [[FIRAuth auth] createUserWithEmail:email 64 | password:password 65 | completion:^(FIRUser *_Nullable user, NSError *_Nullable error) { 66 | if (errorCallback && error) { 67 | [errorCallback call:@[[TiFirebaseModule dictionaryFromError:error]] thisObject:nil]; 68 | } else if (successCallback) { 69 | [successCallback call:@[[TiFirebaseModule dictionaryFromUser:user]] thisObject:nil]; 70 | } 71 | }]; 72 | 73 | } 74 | 75 | - (void)signInWithEmail:(id)args 76 | { 77 | ENSURE_UI_THREAD(signInWithEmail, args); 78 | ENSURE_SINGLE_ARG(args, NSDictionary); 79 | 80 | NSString *email; 81 | NSString *password; 82 | KrollCallback *successCallback; 83 | KrollCallback *errorCallback; 84 | 85 | ENSURE_ARG_OR_NIL_FOR_KEY(email, args, @"email", NSString); 86 | ENSURE_ARG_OR_NIL_FOR_KEY(password, args, @"password", NSString); 87 | ENSURE_ARG_OR_NIL_FOR_KEY(successCallback, args, @"success", KrollCallback); 88 | ENSURE_ARG_OR_NIL_FOR_KEY(errorCallback, args, @"error", KrollCallback); 89 | 90 | [[FIRAuth auth] signInWithEmail:email 91 | password: password 92 | completion:^(FIRUser *user, NSError *error) { 93 | if (errorCallback && error) { 94 | [errorCallback call:@[[TiFirebaseModule dictionaryFromError:error]] thisObject:nil]; 95 | } else if (successCallback) { 96 | [successCallback call:@[[TiFirebaseModule dictionaryFromUser:user]] thisObject:nil]; 97 | } 98 | }]; 99 | } 100 | 101 | - (void)signOut:(id)args 102 | { 103 | ENSURE_UI_THREAD(signOut, args); 104 | ENSURE_SINGLE_ARG(args, NSDictionary); 105 | 106 | KrollCallback *successCallback; 107 | KrollCallback *errorCallback; 108 | 109 | ENSURE_ARG_OR_NIL_FOR_KEY(successCallback, args, @"success", KrollCallback); 110 | ENSURE_ARG_OR_NIL_FOR_KEY(errorCallback, args, @"error", KrollCallback); 111 | 112 | NSError *authError; 113 | BOOL status = [[FIRAuth auth] signOut:&authError];//Note: odd signOut seems to always return true!? 114 | 115 | if (status && successCallback) { 116 | // Sign-out succeeded 117 | [successCallback call:@[@"success"] thisObject:nil]; 118 | } else if (errorCallback) { 119 | [errorCallback call:@[[TiFirebaseModule dictionaryFromError:authError]] thisObject:nil]; 120 | } 121 | } 122 | 123 | - (void)sendPasswordResetWithEmail:(id)args 124 | { 125 | ENSURE_UI_THREAD(sendPasswordResetWithEmail, args); 126 | ENSURE_SINGLE_ARG(args, NSDictionary); 127 | 128 | KrollCallback *successCallback; 129 | KrollCallback *errorCallback; 130 | NSString *email; 131 | 132 | ENSURE_ARG_OR_NIL_FOR_KEY(successCallback, args, @"success", KrollCallback); 133 | ENSURE_ARG_OR_NIL_FOR_KEY(errorCallback, args, @"error", KrollCallback); 134 | ENSURE_ARG_FOR_KEY(email, args, @"email", NSString); 135 | 136 | [[FIRAuth auth] sendPasswordResetWithEmail:email 137 | completion:^(NSError *error) { 138 | if (errorCallback && error) { 139 | [errorCallback call:@[@{@"success": NUMBOOL(NO)}] thisObject:nil]; 140 | } else if (successCallback) { 141 | [successCallback call:@[@{@"success": NUMBOOL(YES)}] thisObject:nil]; 142 | } 143 | }]; 144 | } 145 | 146 | - (NSDictionary *)currentUser 147 | { 148 | return [TiFirebaseModule dictionaryFromUser:[[FIRAuth auth] currentUser]]; 149 | } 150 | @end 151 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseModule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase 3 | * 4 | * Created by Your Name 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiModule.h" 9 | #import "Firebase.h" 10 | #import "TiFirebaseAuthModule.h" 11 | #import "TiFirebaseAnalyticsModule.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface TiFirebaseModule : TiModule 16 | { 17 | TiFirebaseAuthModule *firAuth; 18 | TiFirebaseAnalyticsModule *firAnalytics; 19 | } 20 | 21 | /** 22 | * Initialize and configure FIRApp. 23 | * 24 | * @param unused The proxy-argument handler (remains unused) 25 | */ 26 | - (void)configure:(_Nullable id)unused; 27 | 28 | /** 29 | * Manages authentication for Firebase apps 30 | * 31 | * @param unused The proxy-argument handler (remains unused) 32 | */ 33 | - (TiFirebaseAuthModule *_Nonnull)FIRAuth; 34 | 35 | /** 36 | * Manages analytics for Firebase apps 37 | * 38 | * @param unused The proxy-argument handler (remains unused) 39 | */ 40 | - (TiFirebaseAnalyticsModule*_Nonnull)FIRAnalytics; 41 | 42 | 43 | /** 44 | * Map error object to NSDictionary 45 | * 46 | * @param error The error-object 47 | * 48 | * @return The dictionary containing the extracted error-infos 49 | */ 50 | + (NSDictionary * _Nullable)dictionaryFromError:(NSError *_Nullable)error; 51 | 52 | /** 53 | * Map firebase user to an NSDictionary 54 | * 55 | * @param user The Firebase user-object 56 | * 57 | * @return The dictionary containing the extracted user-infos 58 | */ 59 | + (NSDictionary * _Nullable)dictionaryFromUser:(FIRUser *_Nullable) user; 60 | 61 | @end 62 | 63 | NS_ASSUME_NONNULL_END 64 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseModule.m: -------------------------------------------------------------------------------- 1 | /** 2 | * ti-firebase 3 | * 4 | * Created by Your Name 5 | * Copyright (c) 2016 Your Company. All rights reserved. 6 | */ 7 | 8 | #import "TiFirebaseModule.h" 9 | #import "TiBase.h" 10 | #import "TiHost.h" 11 | #import "TiUtils.h" 12 | 13 | @implementation TiFirebaseModule 14 | 15 | #pragma mark Internal 16 | 17 | - (id)moduleGUID 18 | { 19 | return @"1dc51f4a-d89b-4df2-89da-278d5a246c90"; 20 | } 21 | 22 | - (NSString*)moduleId 23 | { 24 | return @"ti.firebase"; 25 | } 26 | 27 | #pragma mark Lifecycle 28 | 29 | - (void)startup 30 | { 31 | [super startup]; 32 | NSLog(@"[DEBUG] %@ loaded",self); 33 | } 34 | 35 | #pragma Public APIs (FIRApp Class entry point) 36 | 37 | - (void)configure:(id)unused 38 | { 39 | [FIRApp configure]; 40 | } 41 | 42 | - (id)projectID 43 | { 44 | return [[FIROptions defaultOptions] projectID]; 45 | } 46 | 47 | #pragma Public APIs (FIRAuth Class entry point) 48 | 49 | - (TiFirebaseAuthModule*)FIRAuth 50 | { 51 | if (firAuth == nil) { 52 | return [[TiFirebaseAuthModule alloc] _initWithPageContext:[self executionContext]]; 53 | } 54 | return firAuth; 55 | } 56 | 57 | #pragma Public APIs (FIRAnalytics Class entry point) 58 | - (TiFirebaseAnalyticsModule*)FIRAnalytics 59 | { 60 | if (firAnalytics == nil) { 61 | return [[TiFirebaseAnalyticsModule alloc] _initWithPageContext:[self executionContext]]; 62 | } 63 | return firAnalytics; 64 | } 65 | 66 | 67 | #pragma mark Utilities 68 | 69 | + (NSDictionary *_Nullable)dictionaryFromError:(NSError *_Nullable)error 70 | { 71 | if (!error) { 72 | return nil; 73 | } 74 | 75 | return @{ 76 | @"code": NUMINTEGER([error code]), 77 | @"description": [error localizedDescription] 78 | }; 79 | } 80 | 81 | + (NSDictionary * _Nullable)dictionaryFromUser:(FIRUser *_Nullable) user 82 | { 83 | if (!user) { 84 | return nil; 85 | } 86 | 87 | return @{ 88 | @"email": [user email], 89 | @"providerID": [user providerID], 90 | @"uid": [user uid],// Provider-specific UID 91 | @"photoURL": NULL_IF_NIL([[user photoURL] absoluteString]), 92 | @"displayName": NULL_IF_NIL([user displayName]) 93 | }; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseModuleAssets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a generated file. Do not edit or your changes will be lost 3 | */ 4 | 5 | @interface TiFirebaseModuleAssets : NSObject 6 | { 7 | } 8 | - (NSData*) moduleAsset; 9 | - (NSData*) resolveModuleAsset:(NSString*)path; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iphone/Classes/TiFirebaseModuleAssets.m: -------------------------------------------------------------------------------- 1 | /** 2 | * This is a generated file. Do not edit or your changes will be lost 3 | */ 4 | #import "TiFirebaseModuleAssets.h" 5 | 6 | extern NSData* filterDataInRange(NSData* thedata, NSRange range); 7 | 8 | @implementation TiFirebaseModuleAssets 9 | 10 | - (NSData*) moduleAsset 11 | { 12 | 13 | 14 | return nil; 15 | } 16 | 17 | - (NSData*) resolveModuleAsset:(NSString*)path 18 | { 19 | 20 | 21 | return nil; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /iphone/Resources/README.md: -------------------------------------------------------------------------------- 1 | ======== Module project notes =========== 2 | 3 | Place your GoogleService-Info.plist in this folder, it will be copied to the product directory, where the firebase sdk will read and connect to your app url. 4 | 5 | 6 | ======== Module project notes =========== 7 | 8 | Files in this folder are copied directly into the compiled product directory 9 | when the iOS app is compiled: 10 | 11 | /build/iphone/build/Products//.app/ 12 | 13 | Place your module's iOS bundles and localization files in this folder. 14 | 15 | Files in this directory are copied directly on top of whatever files are already 16 | in the build directory, so please be careful that your files don't clobber 17 | essential project files or files from other modules. 18 | 19 | -------------------------------------------------------------------------------- /iphone/TiFirebase_Prefix.pch: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __OBJC__ 3 | #import 4 | #import 5 | #endif 6 | -------------------------------------------------------------------------------- /iphone/build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Appcelerator Titanium Module Packager 4 | # 5 | # 6 | import os, subprocess, sys, glob, string 7 | import zipfile 8 | from datetime import date 9 | 10 | cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) 11 | os.chdir(cwd) 12 | required_module_keys = ['architectures', 'name','version','moduleid','description','copyright','license','copyright','platform','minsdk'] 13 | module_defaults = { 14 | 'description':'My module', 15 | 'author': 'Your Name', 16 | 'license' : 'Specify your license', 17 | 'copyright' : 'Copyright (c) %s by Your Company' % str(date.today().year), 18 | } 19 | module_license_default = "TODO: place your license here and we'll include it in the module distribution" 20 | 21 | def find_sdk(config): 22 | sdk = config['TITANIUM_SDK'] 23 | return os.path.expandvars(os.path.expanduser(sdk)) 24 | 25 | def replace_vars(config,token): 26 | idx = token.find('$(') 27 | while idx != -1: 28 | idx2 = token.find(')',idx+2) 29 | if idx2 == -1: break 30 | key = token[idx+2:idx2] 31 | if not config.has_key(key): break 32 | token = token.replace('$(%s)' % key, config[key]) 33 | idx = token.find('$(') 34 | return token 35 | 36 | 37 | def read_ti_xcconfig(): 38 | contents = open(os.path.join(cwd,'titanium.xcconfig')).read() 39 | config = {} 40 | for line in contents.splitlines(False): 41 | line = line.strip() 42 | if line[0:2]=='//': continue 43 | idx = line.find('=') 44 | if idx > 0: 45 | key = line[0:idx].strip() 46 | value = line[idx+1:].strip() 47 | config[key] = replace_vars(config,value) 48 | return config 49 | 50 | def generate_doc(config): 51 | docdir = os.path.join(cwd,'documentation') 52 | if not os.path.exists(docdir): 53 | docdir = os.path.join(cwd,'..','documentation') 54 | if not os.path.exists(docdir): 55 | print "Couldn't find documentation file at: %s" % docdir 56 | return None 57 | 58 | try: 59 | import markdown2 as markdown 60 | except ImportError: 61 | import markdown 62 | documentation = [] 63 | for file in os.listdir(docdir): 64 | if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)): 65 | continue 66 | md = open(os.path.join(docdir,file)).read() 67 | html = markdown.markdown(md) 68 | documentation.append({file:html}); 69 | return documentation 70 | 71 | def compile_js(manifest,config): 72 | js_file = os.path.join(cwd,'assets','ti.firebase.js') 73 | if not os.path.exists(js_file): 74 | js_file = os.path.join(cwd,'..','assets','ti.firebase.js') 75 | if not os.path.exists(js_file): return 76 | 77 | from compiler import Compiler 78 | try: 79 | import json 80 | except: 81 | import simplejson as json 82 | 83 | compiler = Compiler(cwd, manifest['moduleid'], manifest['name'], 'commonjs') 84 | root_asset, module_assets = compiler.compile_module() 85 | 86 | root_asset_content = """ 87 | %s 88 | 89 | return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[0]); 90 | """ % root_asset 91 | 92 | module_asset_content = """ 93 | %s 94 | 95 | NSNumber *index = [map objectForKey:path]; 96 | if (index == nil) { 97 | return nil; 98 | } 99 | return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[index.integerValue]); 100 | """ % module_assets 101 | 102 | from tools import splice_code 103 | 104 | assets_router = os.path.join(cwd,'Classes','TiFirebaseModuleAssets.m') 105 | splice_code(assets_router, 'asset', root_asset_content) 106 | splice_code(assets_router, 'resolve_asset', module_asset_content) 107 | 108 | # Generate the exports after crawling all of the available JS source 109 | exports = open('metadata.json','w') 110 | json.dump({'exports':compiler.exports }, exports) 111 | exports.close() 112 | 113 | def die(msg): 114 | print msg 115 | sys.exit(1) 116 | 117 | def warn(msg): 118 | print "[WARN] %s" % msg 119 | 120 | def error(msg): 121 | print "[ERROR] %s" % msg 122 | 123 | def validate_license(): 124 | license_file = os.path.join(cwd,'LICENSE') 125 | if not os.path.exists(license_file): 126 | license_file = os.path.join(cwd,'..','LICENSE') 127 | if os.path.exists(license_file): 128 | c = open(license_file).read() 129 | if c.find(module_license_default)!=-1: 130 | warn('please update the LICENSE file with your license text before distributing') 131 | 132 | def validate_manifest(): 133 | path = os.path.join(cwd,'manifest') 134 | f = open(path) 135 | if not os.path.exists(path): die("missing %s" % path) 136 | manifest = {} 137 | for line in f.readlines(): 138 | line = line.strip() 139 | if line[0:1]=='#': continue 140 | if line.find(':') < 0: continue 141 | key,value = line.split(':') 142 | manifest[key.strip()]=value.strip() 143 | for key in required_module_keys: 144 | if not manifest.has_key(key): die("missing required manifest key '%s'" % key) 145 | if manifest[key].strip() == '': die("manifest key '%s' missing required value" % key) 146 | if module_defaults.has_key(key): 147 | defvalue = module_defaults[key] 148 | curvalue = manifest[key] 149 | if curvalue==defvalue: warn("please update the manifest key: '%s' to a non-default value" % key) 150 | return manifest,path 151 | 152 | ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README'] 153 | ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT'] 154 | 155 | def zip_dir(zf,dir,basepath,ignore=[],includeJSFiles=False): 156 | for root, dirs, files in os.walk(dir): 157 | for name in ignoreDirs: 158 | if name in dirs: 159 | dirs.remove(name) # don't visit ignored directories 160 | for file in files: 161 | if file in ignoreFiles: continue 162 | e = os.path.splitext(file) 163 | if len(e) == 2 and e[1] == '.pyc': continue 164 | if not includeJSFiles and len(e) == 2 and e[1] == '.js': continue 165 | from_ = os.path.join(root, file) 166 | to_ = from_.replace(dir, basepath, 1) 167 | zf.write(from_, to_) 168 | 169 | def glob_libfiles(): 170 | files = [] 171 | for libfile in glob.glob('build/**/*.a'): 172 | if libfile.find('Release-')!=-1: 173 | files.append(libfile) 174 | return files 175 | 176 | def build_module(manifest,config): 177 | from tools import ensure_dev_path 178 | ensure_dev_path() 179 | 180 | rc = os.system("xcodebuild -sdk iphoneos -configuration Release") 181 | if rc != 0: 182 | die("xcodebuild failed") 183 | rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release") 184 | if rc != 0: 185 | die("xcodebuild failed") 186 | # build the merged library using lipo 187 | moduleid = manifest['moduleid'] 188 | libpaths = '' 189 | for libfile in glob_libfiles(): 190 | libpaths+='%s ' % libfile 191 | 192 | os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid)) 193 | 194 | def verify_build_arch(manifest, config): 195 | binaryname = 'lib%s.a' % manifest['moduleid'] 196 | binarypath = os.path.join('build', binaryname) 197 | manifestarch = set(manifest['architectures'].split(' ')) 198 | 199 | output = subprocess.check_output('xcrun lipo -info %s' % binarypath, shell=True) 200 | 201 | builtarch = set(output.split(':')[-1].strip().split(' ')) 202 | 203 | print 'Check build architectures\n' 204 | 205 | if ('arm64' not in builtarch): 206 | warn('built module is missing 64-bit support.') 207 | 208 | if (manifestarch != builtarch): 209 | warn('architectures in manifest: %s' % ', '.join(manifestarch)) 210 | warn('compiled binary architectures: %s' % ', '.join(builtarch)) 211 | 212 | print '\nMODULE BUILD FAILED' 213 | error('there is discrepancy between the architectures specified in module manifest and compiled binary.') 214 | error('Please update manifest to match module binary architectures.') 215 | die('') 216 | 217 | def package_module(manifest,mf,config): 218 | name = manifest['name'].lower() 219 | moduleid = manifest['moduleid'].lower() 220 | version = manifest['version'] 221 | modulezip = '%s-iphone-%s.zip' % (moduleid,version) 222 | if os.path.exists(modulezip): os.remove(modulezip) 223 | zf = zipfile.ZipFile(modulezip, 'w', zipfile.ZIP_DEFLATED) 224 | modulepath = 'modules/iphone/%s/%s' % (moduleid,version) 225 | zf.write(mf,'%s/manifest' % modulepath) 226 | libname = 'lib%s.a' % moduleid 227 | zf.write('build/%s' % libname, '%s/%s' % (modulepath,libname)) 228 | docs = generate_doc(config) 229 | if docs!=None: 230 | for doc in docs: 231 | for file, html in doc.iteritems(): 232 | filename = string.replace(file,'.md','.html') 233 | zf.writestr('%s/documentation/%s'%(modulepath,filename),html) 234 | 235 | p = os.path.join(cwd, 'assets') 236 | if not os.path.exists(p): 237 | p = os.path.join(cwd, '..', 'assets') 238 | if os.path.exists(p): 239 | zip_dir(zf,p,'%s/%s' % (modulepath,'assets'),['README']) 240 | 241 | for dn in ('example','platform'): 242 | p = os.path.join(cwd, dn) 243 | if not os.path.exists(p): 244 | p = os.path.join(cwd, '..', dn) 245 | if os.path.exists(p): 246 | zip_dir(zf,p,'%s/%s' % (modulepath,dn),['README'],True) 247 | 248 | license_file = os.path.join(cwd,'LICENSE') 249 | if not os.path.exists(license_file): 250 | license_file = os.path.join(cwd,'..','LICENSE') 251 | if os.path.exists(license_file): 252 | zf.write(license_file,'%s/LICENSE' % modulepath) 253 | 254 | zf.write('module.xcconfig','%s/module.xcconfig' % modulepath) 255 | exports_file = 'metadata.json' 256 | if os.path.exists(exports_file): 257 | zf.write(exports_file, '%s/%s' % (modulepath, exports_file)) 258 | zf.close() 259 | 260 | 261 | if __name__ == '__main__': 262 | print "**************************************************************" 263 | print " WARNING!" 264 | print " This Python script is deprecated!" 265 | print " Please use 'ti build -p ios --build-only' instead" 266 | print "**************************************************************" 267 | print "" 268 | 269 | manifest,mf = validate_manifest() 270 | validate_license() 271 | config = read_ti_xcconfig() 272 | 273 | sdk = find_sdk(config) 274 | sys.path.insert(0,os.path.join(sdk,'iphone')) 275 | sys.path.append(os.path.join(sdk, "common")) 276 | 277 | compile_js(manifest,config) 278 | build_module(manifest,config) 279 | verify_build_arch(manifest, config) 280 | package_module(manifest,mf,config) 281 | sys.exit(0) 282 | -------------------------------------------------------------------------------- /iphone/manifest: -------------------------------------------------------------------------------- 1 | # 2 | # this is your module manifest and used by Titanium 3 | # during compilation, packaging, distribution, etc. 4 | 5 | version: 1.3.1 6 | apiversion: 2 7 | architectures: armv7 arm64 i386 x86_64 8 | description: ti-firebase 9 | author: cribe 10 | license: Apache 2 11 | copyright: Copyright (c) 2016-Present by ChrisRibe 12 | 13 | # these should not be edited 14 | name: ti-firebase 15 | moduleid: ti.firebase 16 | guid: 1dc51f4a-d89b-4df2-89da-278d5a246c90 17 | platform: iphone 18 | minsdk: 5.2.2.GA 19 | -------------------------------------------------------------------------------- /iphone/metadata.json: -------------------------------------------------------------------------------- 1 | {"exports":[]} -------------------------------------------------------------------------------- /iphone/module.modulemap: -------------------------------------------------------------------------------- 1 | module Firebase { 2 | header "Firebase.h" 3 | export * 4 | } 5 | -------------------------------------------------------------------------------- /iphone/module.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE 3 | // PICKED UP DURING THE APP BUILD FOR YOUR MODULE 4 | // 5 | // see the following webpage for instructions on the settings 6 | // for this file: 7 | // http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html 8 | // 9 | 10 | // 11 | // How to add a Framework (example) 12 | // 13 | // OTHER_LDFLAGS=$(inherited) -framework Foo 14 | // 15 | // Adding a framework for a specific version(s) of iPhone: 16 | // 17 | // OTHER_LDFLAGS[sdk=iphoneos4*]=$(inherited) -framework Foo 18 | // OTHER_LDFLAGS[sdk=iphonesimulator4*]=$(inherited) -framework Foo 19 | // 20 | // 21 | // How to add a compiler define: 22 | // 23 | // OTHER_CFLAGS=$(inherited) -DFOO=1 24 | // 25 | // 26 | // IMPORTANT NOTE: always use $(inherited) in your overrides 27 | // 28 | //Note: Do not use the MODULE_VERSION name tag, it is reserved or something and breaks builds if set. 29 | MODULE_VER=1.3.1 30 | FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/ti.firebase/$(MODULE_VER)/platform "~/Library/Application\ Support/Titanium/modules/iphone/ti.firebase/$(MODULE_VER)/platform/ios" 31 | OTHER_LDFLAGS=$(inherited) -framework FirebaseAnalytics -framework FirebaseInstanceID -framework FirebaseAuth -framework FirebaseCore -framework GoogleToolboxForMac -framework GTMSessionFetcher 32 | -------------------------------------------------------------------------------- /iphone/platform/Firebase.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #if !defined(__has_include) 5 | #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ 6 | import the headers individually." 7 | #else 8 | #if __has_include() 9 | #import 10 | #endif 11 | 12 | #if __has_include() 13 | #import 14 | #endif 15 | 16 | #if __has_include() 17 | #import 18 | #endif 19 | 20 | #if __has_include() 21 | #import 22 | #endif 23 | 24 | #if __has_include() 25 | #import 26 | #endif 27 | 28 | #if __has_include() 29 | #import 30 | #endif 31 | 32 | #if __has_include() 33 | #import 34 | #endif 35 | 36 | #if __has_include() 37 | #import 38 | #endif 39 | 40 | #if __has_include() 41 | #import 42 | #endif 43 | 44 | #if __has_include() 45 | #import 46 | #endif 47 | 48 | #if __has_include() 49 | #import 50 | #endif 51 | 52 | #endif // defined(__has_include) 53 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/FirebaseAnalytics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/FirebaseAnalytics.framework/FirebaseAnalytics -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "FIRAnalytics.h" 4 | 5 | /** 6 | * Provides App Delegate handlers to be used in your App Delegate. 7 | * 8 | * To save time integrating Firebase Analytics in an application, Firebase Analytics does not 9 | * require delegation implementation from the AppDelegate. Instead this is automatically done by 10 | * Firebase Analytics. Should you choose instead to delegate manually, you can turn off the App 11 | * Delegate Proxy by adding FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting 12 | * it to NO, and adding the methods in this category to corresponding delegation handlers. 13 | * 14 | * To handle Universal Links, you must return YES in 15 | * [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. 16 | */ 17 | @interface FIRAnalytics (AppDelegate) 18 | 19 | /** 20 | * Handles events related to a URL session that are waiting to be processed. 21 | * 22 | * For optimal use of Firebase Analytics, call this method from the 23 | * [UIApplicationDelegate application:handleEventsForBackgroundURLSession:completionHandler] 24 | * method of the app delegate in your app. 25 | * 26 | * @param identifier The identifier of the URL session requiring attention. 27 | * @param completionHandler The completion handler to call when you finish processing the events. 28 | * Calling this completion handler lets the system know that your app's user interface is 29 | * updated and a new snapshot can be taken. 30 | */ 31 | + (void)handleEventsForBackgroundURLSession:(NSString *)identifier 32 | completionHandler:(void (^)(void))completionHandler; 33 | 34 | /** 35 | * Handles the event when the app is launched by a URL. 36 | * 37 | * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and 38 | * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on iOS 8.x 39 | * and below) in your app. 40 | * 41 | * @param url The URL resource to open. This resource can be a network resource or a file. 42 | */ 43 | + (void)handleOpenURL:(NSURL *)url; 44 | 45 | /** 46 | * Handles the event when the app receives data associated with user activity that includes a 47 | * Universal Link (on iOS 9.0 and above). 48 | * 49 | * Call this method from [UIApplication continueUserActivity:restorationHandler:] in your app 50 | * delegate (on iOS 9.0 and above). 51 | * 52 | * @param userActivity The activity object containing the data associated with the task the user 53 | * was performing. 54 | */ 55 | + (void)handleUserActivity:(id)userActivity; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRAnalytics.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "FIREventNames.h" 4 | #import "FIRParameterNames.h" 5 | #import "FIRUserPropertyNames.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | /// The top level Firebase Analytics singleton that provides methods for logging events and setting 10 | /// user properties. See the developer guides for general 11 | /// information on using Firebase Analytics in your apps. 12 | @interface FIRAnalytics : NSObject 13 | 14 | /// Logs an app event. The event can have up to 25 parameters. Events with the same name must have 15 | /// the same parameters. Up to 500 event names are supported. Using predefined events and/or 16 | /// parameters is recommended for optimal reporting. 17 | /// 18 | /// The following event names are reserved and cannot be used: 19 | ///
    20 | ///
  • app_clear_data
  • 21 | ///
  • app_remove
  • 22 | ///
  • app_update
  • 23 | ///
  • error
  • 24 | ///
  • first_open
  • 25 | ///
  • in_app_purchase
  • 26 | ///
  • notification_dismiss
  • 27 | ///
  • notification_foreground
  • 28 | ///
  • notification_open
  • 29 | ///
  • notification_receive
  • 30 | ///
  • os_update
  • 31 | ///
  • session_start
  • 32 | ///
  • user_engagement
  • 33 | ///
34 | /// 35 | /// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or 36 | /// underscores. The name must start with an alphabetic character. Some event names are 37 | /// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix 38 | /// is reserved and should not be used. Note that event names are case-sensitive and that 39 | /// logging two events whose names differ only in case will result in two distinct events. 40 | /// @param parameters The dictionary of event parameters. Passing nil indicates that the event has 41 | /// no parameters. Parameter names can be up to 40 characters long and must start with an 42 | /// alphabetic character and contain only alphanumeric characters and underscores. Only NSString 43 | /// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are 44 | /// supported. NSString parameter values can be up to 100 characters long. The "firebase_" 45 | /// prefix is reserved and should not be used for parameter names. 46 | + (void)logEventWithName:(NSString *)name 47 | parameters:(nullable NSDictionary *)parameters; 48 | 49 | /// Sets a user property to a given value. Up to 25 user property names are supported. Once set, 50 | /// user property values persist throughout the app lifecycle and across sessions. 51 | /// 52 | /// The following user property names are reserved and cannot be used: 53 | ///
    54 | ///
  • first_open_time
  • 55 | ///
  • last_deep_link_referrer
  • 56 | ///
  • user_id
  • 57 | ///
58 | /// 59 | /// @param value The value of the user property. Values can be up to 36 characters long. Setting the 60 | /// value to nil removes the user property. 61 | /// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters 62 | /// or underscores and must start with an alphabetic character. The "firebase_" prefix is 63 | /// reserved and should not be used for user property names. 64 | + (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name; 65 | 66 | /// Sets the user ID property. This feature must be used in accordance with 67 | /// Google's Privacy Policy 68 | /// 69 | /// @param userID The user ID to ascribe to the user of this app on this device, which must be 70 | /// non-empty and no more than 36 characters long. Setting userID to nil removes the user ID. 71 | + (void)setUserID:(nullable NSString *)userID; 72 | 73 | /// Sets the current screen name, which specifies the current visual context in your app. This helps 74 | /// identify the areas in your app where users spend their time and how they interact with your app. 75 | /// 76 | /// Note that screen reporting is enabled automatically and records the class name of the current 77 | /// UIViewController for you without requiring you to call this method. If you implement 78 | /// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class 79 | /// will not be automatically tracked. The class name can optionally be overridden by calling this 80 | /// method in the viewDidAppear callback of your UIViewController and specifying the 81 | /// screenClassOverride parameter. 82 | /// 83 | /// If your app does not use a distinct UIViewController for each screen, you should call this 84 | /// method and specify a distinct screenName each time a new screen is presented to the user. 85 | /// 86 | /// The screen name and screen class remain in effect until the current UIViewController changes or 87 | /// a new call to setScreenName:screenClass: is made. 88 | /// 89 | /// @param screenName The name of the current screen. Should contain 1 to 100 characters. Set to nil 90 | /// to clear the current screen name. 91 | /// @param screenClassOverride The name of the screen class. Should contain 1 to 100 characters. By 92 | /// default this is the class name of the current UIViewController. Set to nil to revert to the 93 | /// default class name. 94 | + (void)setScreenName:(nullable NSString *)screenName 95 | screenClass:(nullable NSString *)screenClassOverride; 96 | 97 | /// The unique ID for this instance of the application. 98 | + (NSString *)appInstanceID; 99 | 100 | @end 101 | 102 | NS_ASSUME_NONNULL_END 103 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRApp.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIREventNames.h: -------------------------------------------------------------------------------- 1 | /// @file FIREventNames.h 2 | /// 3 | /// Predefined event names. 4 | /// 5 | /// An Event is an important occurrence in your app that you want to measure. You can report up to 6 | /// 500 different types of Events per app and you can associate up to 25 unique parameters with each 7 | /// Event type. Some common events are suggested below, but you may also choose to specify custom 8 | /// Event types that are associated with your specific app. Each event type is identified by a 9 | /// unique name. Event names can be up to 40 characters long, may only contain alphanumeric 10 | /// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_" 11 | /// prefix is reserved and should not be used. 12 | 13 | /// Add Payment Info event. This event signifies that a user has submitted their payment information 14 | /// to your app. 15 | static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; 16 | 17 | /// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for 18 | /// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness 19 | /// of your checkout process. Note: If you supply the @c kFIRParameterValue parameter, you must 20 | /// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed 21 | /// accurately. Params: 22 | /// 23 | ///
    24 | ///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • 25 | ///
  • @c kFIRParameterItemID (NSString)
  • 26 | ///
  • @c kFIRParameterItemName (NSString)
  • 27 | ///
  • @c kFIRParameterItemCategory (NSString)
  • 28 | ///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • 29 | ///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • 30 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 31 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 32 | ///
  • @c kFIRParameterOrigin (NSString) (optional)
  • 33 | ///
  • @c kFIRParameterDestination (NSString) (optional)
  • 34 | ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • 35 | ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • 36 | ///
37 | static NSString *const kFIREventAddToCart = @"add_to_cart"; 38 | 39 | /// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. 40 | /// Use this event to identify popular gift items in your app. Note: If you supply the 41 | /// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency 42 | /// parameter so that revenue metrics can be computed accurately. Params: 43 | /// 44 | ///
    45 | ///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • 46 | ///
  • @c kFIRParameterItemID (NSString)
  • 47 | ///
  • @c kFIRParameterItemName (NSString)
  • 48 | ///
  • @c kFIRParameterItemCategory (NSString)
  • 49 | ///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • 50 | ///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • 51 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 52 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 53 | ///
54 | static NSString *const kFIREventAddToWishlist = @"add_to_wishlist"; 55 | 56 | /// App Open event. By logging this event when an App is moved to the foreground, developers can 57 | /// understand how often users leave and return during the course of a Session. Although Sessions 58 | /// are automatically reported, this event can provide further clarification around the continuous 59 | /// engagement of app-users. 60 | static NSString *const kFIREventAppOpen = @"app_open"; 61 | 62 | /// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of 63 | /// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the 64 | /// effectiveness of your checkout process. Note: If you supply the @c kFIRParameterValue 65 | /// parameter, you must also supply the @c kFIRParameterCurrency parameter so that revenue 66 | /// metrics can be computed accurately. Params: 67 | /// 68 | ///
    69 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 70 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 71 | ///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • 72 | ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • 73 | ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • 74 | ///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for 75 | /// hotel bookings
  • 76 | ///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for 77 | /// hotel bookings
  • 78 | ///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) 79 | /// for travel bookings
  • 80 | ///
  • @c kFIRParameterOrigin (NSString) (optional)
  • 81 | ///
  • @c kFIRParameterDestination (NSString) (optional)
  • 82 | ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • 83 | ///
84 | static NSString *const kFIREventBeginCheckout = @"begin_checkout"; 85 | 86 | /// Campaign Detail event. Log this event to supply the referral details of a re-engagement 87 | /// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource, 88 | /// kFIRParameterMedium or kFIRParameterCampaign. Params: 89 | /// 90 | ///
    91 | ///
  • @c kFIRParameterSource (NSString)
  • 92 | ///
  • @c kFIRParameterMedium (NSString)
  • 93 | ///
  • @c kFIRParameterCampaign (NSString)
  • 94 | ///
  • @c kFIRParameterTerm (NSString) (optional)
  • 95 | ///
  • @c kFIRParameterContent (NSString) (optional)
  • 96 | ///
  • @c kFIRParameterAdNetworkClickID (NSString) (optional)
  • 97 | ///
  • @c kFIRParameterCP1 (NSString) (optional)
  • 98 | ///
99 | static NSString *const kFIREventCampaignDetails = @"campaign_details"; 100 | 101 | /// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log 102 | /// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy. 103 | /// Params: 104 | /// 105 | ///
    106 | ///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • 107 | ///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • 108 | ///
109 | static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; 110 | 111 | /// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note: 112 | /// This is different from the in-app purchase event, which is reported automatically for App 113 | /// Store-based apps. Note: If you supply the @c kFIRParameterValue parameter, you must also 114 | /// supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed 115 | /// accurately. Params: 116 | /// 117 | ///
    118 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 119 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 120 | ///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • 121 | ///
  • @c kFIRParameterTax (double as NSNumber) (optional)
  • 122 | ///
  • @c kFIRParameterShipping (double as NSNumber) (optional)
  • 123 | ///
  • @c kFIRParameterCoupon (NSString) (optional)
  • 124 | ///
  • @c kFIRParameterLocation (NSString) (optional)
  • 125 | ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • 126 | ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • 127 | ///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for 128 | /// hotel bookings
  • 129 | ///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for 130 | /// hotel bookings
  • 131 | ///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) 132 | /// for travel bookings
  • 133 | ///
  • @c kFIRParameterOrigin (NSString) (optional)
  • 134 | ///
  • @c kFIRParameterDestination (NSString) (optional)
  • 135 | ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • 136 | ///
137 | static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; 138 | 139 | /// Generate Lead event. Log this event when a lead has been generated in the app to understand the 140 | /// efficacy of your install and re-engagement campaigns. Note: If you supply the 141 | /// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency 142 | /// parameter so that revenue metrics can be computed accurately. Params: 143 | /// 144 | ///
    145 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 146 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 147 | ///
148 | static NSString *const kFIREventGenerateLead = @"generate_lead"; 149 | 150 | /// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use 151 | /// this event to analyze how popular certain groups or social features are in your app. Params: 152 | /// 153 | ///
    154 | ///
  • @c kFIRParameterGroupID (NSString)
  • 155 | ///
156 | static NSString *const kFIREventJoinGroup = @"join_group"; 157 | 158 | /// Level Up event. This event signifies that a player has leveled up in your gaming app. It can 159 | /// help you gauge the level distribution of your userbase and help you identify certain levels that 160 | /// are difficult to pass. Params: 161 | /// 162 | ///
    163 | ///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber)
  • 164 | ///
  • @c kFIRParameterCharacter (NSString) (optional)
  • 165 | ///
166 | static NSString *const kFIREventLevelUp = @"level_up"; 167 | 168 | /// Login event. Apps with a login feature can report this event to signify that a user has logged 169 | /// in. 170 | static NSString *const kFIREventLogin = @"login"; 171 | 172 | /// Post Score event. Log this event when the user posts a score in your gaming app. This event can 173 | /// help you understand how users are actually performing in your game and it can help you correlate 174 | /// high scores with certain audiences or behaviors. Params: 175 | /// 176 | ///
    177 | ///
  • @c kFIRParameterScore (signed 64-bit integer as NSNumber)
  • 178 | ///
  • @c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)
  • 179 | ///
  • @c kFIRParameterCharacter (NSString) (optional)
  • 180 | ///
181 | static NSString *const kFIREventPostScore = @"post_score"; 182 | 183 | /// Present Offer event. This event signifies that the app has presented a purchase offer to a user. 184 | /// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge 185 | /// your conversion process. Note: If you supply the @c kFIRParameterValue parameter, you must 186 | /// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed 187 | /// accurately. Params: 188 | /// 189 | ///
    190 | ///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
  • 191 | ///
  • @c kFIRParameterItemID (NSString)
  • 192 | ///
  • @c kFIRParameterItemName (NSString)
  • 193 | ///
  • @c kFIRParameterItemCategory (NSString)
  • 194 | ///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • 195 | ///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • 196 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 197 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 198 | ///
199 | static NSString *const kFIREventPresentOffer = @"present_offer"; 200 | 201 | /// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded. 202 | /// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the 203 | /// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. 204 | /// Params: 205 | /// 206 | ///
    207 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 208 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 209 | ///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • 210 | ///
211 | static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; 212 | 213 | /// Search event. Apps that support search features can use this event to contextualize search 214 | /// operations by supplying the appropriate, corresponding parameters. This event can help you 215 | /// identify the most popular content in your app. Params: 216 | /// 217 | ///
    218 | ///
  • @c kFIRParameterSearchTerm (NSString)
  • 219 | ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • 220 | ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • 221 | ///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for 222 | /// hotel bookings
  • 223 | ///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for 224 | /// hotel bookings
  • 225 | ///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) 226 | /// for travel bookings
  • 227 | ///
  • @c kFIRParameterOrigin (NSString) (optional)
  • 228 | ///
  • @c kFIRParameterDestination (NSString) (optional)
  • 229 | ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • 230 | ///
231 | static NSString *const kFIREventSearch = @"search"; 232 | 233 | /// Select Content event. This general purpose event signifies that a user has selected some content 234 | /// of a certain type in an app. The content can be any object in your app. This event can help you 235 | /// identify popular content and categories of content in your app. Params: 236 | /// 237 | ///
    238 | ///
  • @c kFIRParameterContentType (NSString)
  • 239 | ///
  • @c kFIRParameterItemID (NSString)
  • 240 | ///
241 | static NSString *const kFIREventSelectContent = @"select_content"; 242 | 243 | /// Share event. Apps with social features can log the Share event to identify the most viral 244 | /// content. Params: 245 | /// 246 | ///
    247 | ///
  • @c kFIRParameterContentType (NSString)
  • 248 | ///
  • @c kFIRParameterItemID (NSString)
  • 249 | ///
250 | static NSString *const kFIREventShare = @"share"; 251 | 252 | /// Sign Up event. This event indicates that a user has signed up for an account in your app. The 253 | /// parameter signifies the method by which the user signed up. Use this event to understand the 254 | /// different behaviors between logged in and logged out users. Params: 255 | /// 256 | ///
    257 | ///
  • @c kFIRParameterSignUpMethod (NSString)
  • 258 | ///
259 | static NSString *const kFIREventSignUp = @"sign_up"; 260 | 261 | /// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can 262 | /// help you identify which virtual goods are the most popular objects of purchase. Params: 263 | /// 264 | ///
    265 | ///
  • @c kFIRParameterItemName (NSString)
  • 266 | ///
  • @c kFIRParameterVirtualCurrencyName (NSString)
  • 267 | ///
  • @c kFIRParameterValue (signed 64-bit integer or double as NSNumber)
  • 268 | ///
269 | static NSString *const kFIREventSpendVirtualCurrency = @"spend_virtual_currency"; 270 | 271 | /// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use 272 | /// this in a funnel with kFIREventTutorialComplete to understand how many users complete this 273 | /// process and move on to the full app experience. 274 | static NSString *const kFIREventTutorialBegin = @"tutorial_begin"; 275 | 276 | /// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding 277 | /// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your 278 | /// on-boarding process. 279 | static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; 280 | 281 | /// Unlock Achievement event. Log this event when the user has unlocked an achievement in your 282 | /// game. Since achievements generally represent the breadth of a gaming experience, this event can 283 | /// help you understand how many users are experiencing all that your game has to offer. Params: 284 | /// 285 | ///
    286 | ///
  • @c kFIRParameterAchievementID (NSString)
  • 287 | ///
288 | static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; 289 | 290 | /// View Item event. This event signifies that some content was shown to the user. This content may 291 | /// be a product, a webpage or just a simple image or text. Use the appropriate parameters to 292 | /// contextualize the event. Use this event to discover the most popular items viewed in your app. 293 | /// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the 294 | /// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. 295 | /// Params: 296 | /// 297 | ///
    298 | ///
  • @c kFIRParameterItemID (NSString)
  • 299 | ///
  • @c kFIRParameterItemName (NSString)
  • 300 | ///
  • @c kFIRParameterItemCategory (NSString)
  • 301 | ///
  • @c kFIRParameterItemLocationID (NSString) (optional)
  • 302 | ///
  • @c kFIRParameterPrice (double as NSNumber) (optional)
  • 303 | ///
  • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber) (optional)
  • 304 | ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • 305 | ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • 306 | ///
  • @c kFIRParameterStartDate (NSString) (optional)
  • 307 | ///
  • @c kFIRParameterEndDate (NSString) (optional)
  • 308 | ///
  • @c kFIRParameterFlightNumber (NSString) (optional) for travel bookings
  • 309 | ///
  • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) 310 | /// for travel bookings
  • 311 | ///
  • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for 312 | /// travel bookings
  • 313 | ///
  • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for 314 | /// travel bookings
  • 315 | ///
  • @c kFIRParameterOrigin (NSString) (optional)
  • 316 | ///
  • @c kFIRParameterDestination (NSString) (optional)
  • 317 | ///
  • @c kFIRParameterSearchTerm (NSString) (optional) for travel bookings
  • 318 | ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • 319 | ///
320 | static NSString *const kFIREventViewItem = @"view_item"; 321 | 322 | /// View Item List event. Log this event when the user has been presented with a list of items of a 323 | /// certain category. Params: 324 | /// 325 | ///
    326 | ///
  • @c kFIRParameterItemCategory (NSString)
  • 327 | ///
328 | static NSString *const kFIREventViewItemList = @"view_item_list"; 329 | 330 | /// View Search Results event. Log this event when the user has been presented with the results of a 331 | /// search. Params: 332 | /// 333 | ///
    334 | ///
  • @c kFIRParameterSearchTerm (NSString)
  • 335 | ///
336 | static NSString *const kFIREventViewSearchResults = @"view_search_results"; 337 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIROptions.h: -------------------------------------------------------------------------------- 1 | #import 2 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRParameterNames.h: -------------------------------------------------------------------------------- 1 | /// @file FIRParameterNames.h 2 | /// 3 | /// Predefined event parameter names. 4 | /// 5 | /// Params supply information that contextualize Events. You can associate up to 25 unique Params 6 | /// with each Event type. Some Params are suggested below for certain common Events, but you are 7 | /// not limited to these. You may supply extra Params for suggested Events or custom Params for 8 | /// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric 9 | /// characters and underscores ("_"), and must start with an alphabetic character. Param values can 10 | /// be up to 100 characters long. The "firebase_" prefix is reserved and should not be used. 11 | 12 | /// Game achievement ID (NSString). 13 | ///
 14 | ///     NSDictionary *params = @{
 15 | ///       kFIRParameterAchievementID : @"10_matches_won",
 16 | ///       // ...
 17 | ///     };
 18 | /// 
19 | static NSString *const kFIRParameterAchievementID = @"achievement_id"; 20 | 21 | /// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format. 22 | ///
 23 | ///     NSDictionary *params = @{
 24 | ///       kFIRParameterAdNetworkClickID : @"1234567",
 25 | ///       // ...
 26 | ///     };
 27 | /// 
28 | static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; 29 | 30 | /// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to 31 | /// capture campaign information, otherwise can be populated by developer. Highly Recommended 32 | /// (NSString). 33 | ///
 34 | ///     NSDictionary *params = @{
 35 | ///       kFIRParameterCampaign : @"winter_promotion",
 36 | ///       // ...
 37 | ///     };
 38 | /// 
39 | static NSString *const kFIRParameterCampaign = @"campaign"; 40 | 41 | /// Character used in game (NSString). 42 | ///
 43 | ///     NSDictionary *params = @{
 44 | ///       kFIRParameterCharacter : @"beat_boss",
 45 | ///       // ...
 46 | ///     };
 47 | /// 
48 | static NSString *const kFIRParameterCharacter = @"character"; 49 | 50 | /// Campaign content (NSString). 51 | static NSString *const kFIRParameterContent = @"content"; 52 | 53 | /// Type of content selected (NSString). 54 | ///
 55 | ///     NSDictionary *params = @{
 56 | ///       kFIRParameterContentType : @"news article",
 57 | ///       // ...
 58 | ///     };
 59 | /// 
60 | static NSString *const kFIRParameterContentType = @"content_type"; 61 | 62 | /// Coupon code for a purchasable item (NSString). 63 | ///
 64 | ///     NSDictionary *params = @{
 65 | ///       kFIRParameterCoupon : @"zz123",
 66 | ///       // ...
 67 | ///     };
 68 | /// 
69 | static NSString *const kFIRParameterCoupon = @"coupon"; 70 | 71 | /// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign. 72 | /// Use varies by network. 73 | ///
 74 | ///     NSDictionary *params = @{
 75 | ///       kFIRParameterCP1 : @"custom_data",
 76 | ///       // ...
 77 | ///     };
 78 | /// 
79 | static NSString *const kFIRParameterCP1 = @"cp1"; 80 | 81 | /// Purchase currency in 3-letter 82 | /// ISO_4217 format (NSString). 83 | ///
 84 | ///     NSDictionary *params = @{
 85 | ///       kFIRParameterCurrency : @"USD",
 86 | ///       // ...
 87 | ///     };
 88 | /// 
89 | static NSString *const kFIRParameterCurrency = @"currency"; 90 | 91 | /// Flight or Travel destination (NSString). 92 | ///
 93 | ///     NSDictionary *params = @{
 94 | ///       kFIRParameterDestination : @"Mountain View, CA",
 95 | ///       // ...
 96 | ///     };
 97 | /// 
98 | static NSString *const kFIRParameterDestination = @"destination"; 99 | 100 | /// The arrival date, check-out date or rental end date for the item. This should be in 101 | /// YYYY-MM-DD format (NSString). 102 | ///
103 | ///     NSDictionary *params = @{
104 | ///       kFIRParameterEndDate : @"2015-09-14",
105 | ///       // ...
106 | ///     };
107 | /// 
108 | static NSString *const kFIRParameterEndDate = @"end_date"; 109 | 110 | /// Flight number for travel events (NSString). 111 | ///
112 | ///     NSDictionary *params = @{
113 | ///       kFIRParameterFlightNumber : @"ZZ800",
114 | ///       // ...
115 | ///     };
116 | /// 
117 | static NSString *const kFIRParameterFlightNumber = @"flight_number"; 118 | 119 | /// Group/clan/guild ID (NSString). 120 | ///
121 | ///     NSDictionary *params = @{
122 | ///       kFIRParameterGroupID : @"g1",
123 | ///       // ...
124 | ///     };
125 | /// 
126 | static NSString *const kFIRParameterGroupID = @"group_id"; 127 | 128 | /// Item category (NSString). 129 | ///
130 | ///     NSDictionary *params = @{
131 | ///       kFIRParameterItemCategory : @"t-shirts",
132 | ///       // ...
133 | ///     };
134 | /// 
135 | static NSString *const kFIRParameterItemCategory = @"item_category"; 136 | 137 | /// Item ID (NSString). 138 | ///
139 | ///     NSDictionary *params = @{
140 | ///       kFIRParameterItemID : @"p7654",
141 | ///       // ...
142 | ///     };
143 | /// 
144 | static NSString *const kFIRParameterItemID = @"item_id"; 145 | 146 | /// The Google Place ID (NSString) that 147 | /// corresponds to the associated item. Alternatively, you can supply your own custom Location ID. 148 | ///
149 | ///     NSDictionary *params = @{
150 | ///       kFIRParameterItemLocationID : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
151 | ///       // ...
152 | ///     };
153 | /// 
154 | static NSString *const kFIRParameterItemLocationID = @"item_location_id"; 155 | 156 | /// Item name (NSString). 157 | ///
158 | ///     NSDictionary *params = @{
159 | ///       kFIRParameterItemName : @"abc",
160 | ///       // ...
161 | ///     };
162 | /// 
163 | static NSString *const kFIRParameterItemName = @"item_name"; 164 | 165 | /// Level in game (signed 64-bit integer as NSNumber). 166 | ///
167 | ///     NSDictionary *params = @{
168 | ///       kFIRParameterLevel : @(42),
169 | ///       // ...
170 | ///     };
171 | /// 
172 | static NSString *const kFIRParameterLevel = @"level"; 173 | 174 | /// Location (NSString). The Google Place ID 175 | /// that corresponds to the associated event. Alternatively, you can supply your own custom 176 | /// Location ID. 177 | ///
178 | ///     NSDictionary *params = @{
179 | ///       kFIRParameterLocation : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
180 | ///       // ...
181 | ///     };
182 | /// 
183 | static NSString *const kFIRParameterLocation = @"location"; 184 | 185 | /// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended 186 | /// (NSString). 187 | ///
188 | ///     NSDictionary *params = @{
189 | ///       kFIRParameterMedium : @"email",
190 | ///       // ...
191 | ///     };
192 | /// 
193 | static NSString *const kFIRParameterMedium = @"medium"; 194 | 195 | /// Number of nights staying at hotel (signed 64-bit integer as NSNumber). 196 | ///
197 | ///     NSDictionary *params = @{
198 | ///       kFIRParameterNumberOfNights : @(3),
199 | ///       // ...
200 | ///     };
201 | /// 
202 | static NSString *const kFIRParameterNumberOfNights = @"number_of_nights"; 203 | 204 | /// Number of passengers traveling (signed 64-bit integer as NSNumber). 205 | ///
206 | ///     NSDictionary *params = @{
207 | ///       kFIRParameterNumberOfPassengers : @(11),
208 | ///       // ...
209 | ///     };
210 | /// 
211 | static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"; 212 | 213 | /// Number of rooms for travel events (signed 64-bit integer as NSNumber). 214 | ///
215 | ///     NSDictionary *params = @{
216 | ///       kFIRParameterNumberOfRooms : @(2),
217 | ///       // ...
218 | ///     };
219 | /// 
220 | static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms"; 221 | 222 | /// Flight or Travel origin (NSString). 223 | ///
224 | ///     NSDictionary *params = @{
225 | ///       kFIRParameterOrigin : @"Mountain View, CA",
226 | ///       // ...
227 | ///     };
228 | /// 
229 | static NSString *const kFIRParameterOrigin = @"origin"; 230 | 231 | /// Purchase price (double as NSNumber). 232 | ///
233 | ///     NSDictionary *params = @{
234 | ///       kFIRParameterPrice : @(1.0),
235 | ///       kFIRParameterCurrency : @"USD",  // e.g. $1.00 USD
236 | ///       // ...
237 | ///     };
238 | /// 
239 | static NSString *const kFIRParameterPrice = @"price"; 240 | 241 | /// Purchase quantity (signed 64-bit integer as NSNumber). 242 | ///
243 | ///     NSDictionary *params = @{
244 | ///       kFIRParameterQuantity : @(1),
245 | ///       // ...
246 | ///     };
247 | /// 
248 | static NSString *const kFIRParameterQuantity = @"quantity"; 249 | 250 | /// Score in game (signed 64-bit integer as NSNumber). 251 | ///
252 | ///     NSDictionary *params = @{
253 | ///       kFIRParameterScore : @(4200),
254 | ///       // ...
255 | ///     };
256 | /// 
257 | static NSString *const kFIRParameterScore = @"score"; 258 | 259 | /// The search string/keywords used (NSString). 260 | ///
261 | ///     NSDictionary *params = @{
262 | ///       kFIRParameterSearchTerm : @"periodic table",
263 | ///       // ...
264 | ///     };
265 | /// 
266 | static NSString *const kFIRParameterSearchTerm = @"search_term"; 267 | 268 | /// Shipping cost (double as NSNumber). 269 | ///
270 | ///     NSDictionary *params = @{
271 | ///       kFIRParameterShipping : @(9.50),
272 | ///       kFIRParameterCurrency : @"USD",  // e.g. $9.50 USD
273 | ///       // ...
274 | ///     };
275 | /// 
276 | static NSString *const kFIRParameterShipping = @"shipping"; 277 | 278 | /// Sign up method (NSString). 279 | ///
280 | ///     NSDictionary *params = @{
281 | ///       kFIRParameterSignUpMethod : @"google",
282 | ///       // ...
283 | ///     };
284 | /// 
285 | static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; 286 | 287 | /// The origin of your traffic, such as an Ad network (for example, google) or partner (urban 288 | /// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your 289 | /// property. Highly recommended (NSString). 290 | ///
291 | ///     NSDictionary *params = @{
292 | ///       kFIRParameterSource : @"InMobi",
293 | ///       // ...
294 | ///     };
295 | /// 
296 | static NSString *const kFIRParameterSource = @"source"; 297 | 298 | /// The departure date, check-in date or rental start date for the item. This should be in 299 | /// YYYY-MM-DD format (NSString). 300 | ///
301 | ///     NSDictionary *params = @{
302 | ///       kFIRParameterStartDate : @"2015-09-14",
303 | ///       // ...
304 | ///     };
305 | /// 
306 | static NSString *const kFIRParameterStartDate = @"start_date"; 307 | 308 | /// Tax amount (double as NSNumber). 309 | ///
310 | ///     NSDictionary *params = @{
311 | ///       kFIRParameterTax : @(1.0),
312 | ///       kFIRParameterCurrency : @"USD",  // e.g. $1.00 USD
313 | ///       // ...
314 | ///     };
315 | /// 
316 | static NSString *const kFIRParameterTax = @"tax"; 317 | 318 | /// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword 319 | /// (NSString). 320 | ///
321 | ///     NSDictionary *params = @{
322 | ///       kFIRParameterTerm : @"game",
323 | ///       // ...
324 | ///     };
325 | /// 
326 | static NSString *const kFIRParameterTerm = @"term"; 327 | 328 | /// A single ID for a ecommerce group transaction (NSString). 329 | ///
330 | ///     NSDictionary *params = @{
331 | ///       kFIRParameterTransactionID : @"ab7236dd9823",
332 | ///       // ...
333 | ///     };
334 | /// 
335 | static NSString *const kFIRParameterTransactionID = @"transaction_id"; 336 | 337 | /// Travel class (NSString). 338 | ///
339 | ///     NSDictionary *params = @{
340 | ///       kFIRParameterTravelClass : @"business",
341 | ///       // ...
342 | ///     };
343 | /// 
344 | static NSString *const kFIRParameterTravelClass = @"travel_class"; 345 | 346 | /// A context-specific numeric value which is accumulated automatically for each event type. This is 347 | /// a general purpose parameter that is useful for accumulating a key metric that pertains to an 348 | /// event. Examples include revenue, distance, time and points. Value should be specified as signed 349 | /// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events 350 | /// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be 351 | /// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is 352 | /// [-9,223,372,036,854.77, 9,223,372,036,854.77]. 353 | ///
354 | ///     NSDictionary *params = @{
355 | ///       kFIRParameterValue : @(3.99),
356 | ///       kFIRParameterCurrency : @"USD",  // e.g. $3.99 USD
357 | ///       // ...
358 | ///     };
359 | /// 
360 | static NSString *const kFIRParameterValue = @"value"; 361 | 362 | /// Name of virtual currency type (NSString). 363 | ///
364 | ///     NSDictionary *params = @{
365 | ///       kFIRParameterVirtualCurrencyName : @"virtual_currency_name",
366 | ///       // ...
367 | ///     };
368 | /// 
369 | static NSString *const kFIRParameterVirtualCurrencyName = @"virtual_currency_name"; 370 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h: -------------------------------------------------------------------------------- 1 | /// @file FIRUserPropertyNames.h 2 | /// 3 | /// Predefined user property names. 4 | /// 5 | /// A UserProperty is an attribute that describes the app-user. By supplying UserProperties, you can 6 | /// later analyze different behaviors of various segments of your userbase. You may supply up to 25 7 | /// unique UserProperties per app, and you can use the name and value of your choosing for each one. 8 | /// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and 9 | /// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to 10 | /// 36 characters long. The "firebase_" prefix is reserved and should not be used. 11 | 12 | /// The method used to sign in. For example, "google", "facebook" or "twitter". 13 | static NSString *const kFIRUserPropertySignUpMethod = @"sign_up_method"; 14 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h: -------------------------------------------------------------------------------- 1 | #import "FIRAnalyticsConfiguration.h" 2 | #import "FIRApp.h" 3 | #import "FIRConfiguration.h" 4 | #import "FIROptions.h" 5 | #import "FIRAnalytics+AppDelegate.h" 6 | #import "FIRAnalytics.h" 7 | #import "FIREventNames.h" 8 | #import "FIRParameterNames.h" 9 | #import "FIRUserPropertyNames.h" 10 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAnalytics.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FirebaseAnalytics { 2 | umbrella header "FirebaseAnalytics.h" 3 | export * 4 | module * { export *} 5 | link "sqlite3" 6 | link "z" 7 | link framework "CoreGraphics" 8 | link framework "Foundation" 9 | link framework "UIKit" 10 | } -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/FirebaseAuth: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/FirebaseAuth.framework/FirebaseAuth -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRAuthCredential.h: -------------------------------------------------------------------------------- 1 | /** @file FIRAuthCredential.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2015 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | /** @class FIRAuthCredential 13 | @brief Represents a credential. 14 | */ 15 | @interface FIRAuthCredential : NSObject 16 | 17 | /** @property provider 18 | @brief Gets the name of the identity provider for the credential. 19 | */ 20 | @property(nonatomic, copy, readonly) NSString *provider; 21 | 22 | /** @fn init 23 | @brief This is an abstract base class. Concrete instances should be created via factory 24 | methods available in the various authentication provider libraries (like the Facebook 25 | provider or the Google provider libraries.) 26 | */ 27 | - (instancetype)init NS_UNAVAILABLE; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRAuthErrors.h: -------------------------------------------------------------------------------- 1 | /** @file FIRAuthErrors.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2015 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | /** @class FIRAuthErrors 11 | @remarks Error Codes common to all API Methods: 12 |
    13 |
  • @c FIRAuthErrorCodeNetworkError
  • 14 |
  • @c FIRAuthErrorCodeUserNotFound
  • 15 |
  • @c FIRAuthErrorCodeUserTokenExpired
  • 16 |
  • @c FIRAuthErrorCodeTooManyRequests
  • 17 |
  • @c FIRAuthErrorCodeInvalidAPIKey
  • 18 |
  • @c FIRAuthErrorCodeAppNotAuthorized
  • 19 |
  • @c FIRAuthErrorCodeKeychainError
  • 20 |
  • @c FIRAuthErrorCodeInternalError
  • 21 |
22 | @remarks Common error codes for @c FIRUser operations: 23 |
    24 |
  • @c FIRAuthErrorCodeInvalidUserToken
  • 25 |
  • @c FIRAuthErrorCodeUserDisabled
  • 26 |
27 | */ 28 | @interface FIRAuthErrors 29 | 30 | /** 31 | @brief The Firebase Auth error domain. 32 | */ 33 | extern NSString *const FIRAuthErrorDomain; 34 | 35 | /** 36 | @brief The name of the key for the "error_name" string in the NSError userinfo dictionary. 37 | */ 38 | extern NSString *const FIRAuthErrorNameKey; 39 | 40 | /** 41 | @brief Error codes used by Firebase Auth. 42 | */ 43 | typedef NS_ENUM(NSInteger, FIRAuthErrorCode) { 44 | /** Indicates a validation error with the custom token. 45 | */ 46 | FIRAuthErrorCodeInvalidCustomToken = 17000, 47 | 48 | /** Indicates the service account and the API key belong to different projects. 49 | */ 50 | FIRAuthErrorCodeCustomTokenMismatch = 17002, 51 | 52 | /** Indicates the IDP token or requestUri is invalid. 53 | */ 54 | FIRAuthErrorCodeInvalidCredential = 17004, 55 | 56 | /** Indicates the user's account is disabled on the server. 57 | */ 58 | FIRAuthErrorCodeUserDisabled = 17005, 59 | 60 | /** Indicates the administrator disabled sign in with the specified identity provider. 61 | */ 62 | FIRAuthErrorCodeOperationNotAllowed = 17006, 63 | 64 | /** Indicates the email used to attempt a sign up is already in use. 65 | */ 66 | FIRAuthErrorCodeEmailAlreadyInUse = 17007, 67 | 68 | /** Indicates the email is invalid. 69 | */ 70 | FIRAuthErrorCodeInvalidEmail = 17008, 71 | 72 | /** Indicates the user attempted sign in with a wrong password. 73 | */ 74 | FIRAuthErrorCodeWrongPassword = 17009, 75 | 76 | /** Indicates that too many requests were made to a server method. 77 | */ 78 | FIRAuthErrorCodeTooManyRequests = 17010, 79 | 80 | /** Indicates the user account was not found. 81 | */ 82 | FIRAuthErrorCodeUserNotFound = 17011, 83 | 84 | /** Indicates account linking is required. 85 | */ 86 | FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012, 87 | 88 | /** Same enum as @c FIRAuthErrorCodeAccountExistsWithDifferentCredential , 89 | but with incorrect spelling. Only exists for backwards compatiblity. 90 | */ 91 | FIRAuthErrrorCodeAccountExistsWithDifferentCredential = 17012, 92 | 93 | /** Indicates the user has attemped to change email or password more than 5 minutes after 94 | signing in. 95 | */ 96 | FIRAuthErrorCodeRequiresRecentLogin = 17014, 97 | 98 | /** Indicates an attempt to link a provider to which the account is already linked. 99 | */ 100 | FIRAuthErrorCodeProviderAlreadyLinked = 17015, 101 | 102 | /** Indicates an attempt to unlink a provider that is not linked. 103 | */ 104 | FIRAuthErrorCodeNoSuchProvider = 17016, 105 | 106 | /** Indicates user's saved auth credential is invalid, the user needs to sign in again. 107 | */ 108 | FIRAuthErrorCodeInvalidUserToken = 17017, 109 | 110 | /** Indicates a network error occurred (such as a timeout, interrupted connection, or 111 | unreachable host). These types of errors are often recoverable with a retry. The @c 112 | NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the error 113 | encountered. 114 | */ 115 | FIRAuthErrorCodeNetworkError = 17020, 116 | 117 | /** Indicates the saved token has expired, for example, the user may have changed account 118 | password on another device. The user needs to sign in again on the device that made this 119 | request. 120 | */ 121 | FIRAuthErrorCodeUserTokenExpired = 17021, 122 | 123 | /** Indicates an invalid API key was supplied in the request. 124 | */ 125 | FIRAuthErrorCodeInvalidAPIKey = 17023, 126 | 127 | /** Indicates that an attempt was made to reauthenticate with a user which is not the current 128 | user. 129 | */ 130 | FIRAuthErrorCodeUserMismatch = 17024, 131 | 132 | /** Indicates an attempt to link with a credential that has already been linked with a 133 | different Firebase account 134 | */ 135 | FIRAuthErrorCodeCredentialAlreadyInUse = 17025, 136 | 137 | /** Indicates an attempt to set a password that is considered too weak. 138 | */ 139 | FIRAuthErrorCodeWeakPassword = 17026, 140 | 141 | /** Indicates the App is not authorized to use Firebase Authentication with the 142 | provided API Key. 143 | */ 144 | FIRAuthErrorCodeAppNotAuthorized = 17028, 145 | 146 | /** Indicates the OOB code is expired. 147 | */ 148 | FIRAuthErrorCodeExpiredActionCode = 17029, 149 | 150 | /** Indicates the OOB code is invalid. 151 | */ 152 | FIRAuthErrorCodeInvalidActionCode = 17030, 153 | 154 | /** Indicates that there are invalid parameters in the payload during a "send password reset 155 | * email" attempt. 156 | */ 157 | FIRAuthErrorCodeInvalidMessagePayload = 17031, 158 | 159 | /** Indicates that the sender email is invalid during a "send password reset email" attempt. 160 | */ 161 | FIRAuthErrorCodeInvalidSender = 17032, 162 | 163 | /** Indicates that the recipient email is invalid. 164 | */ 165 | FIRAuthErrorCodeInvalidRecipientEmail = 17033, 166 | 167 | /** Indicates an error occurred while attempting to access the keychain. 168 | */ 169 | FIRAuthErrorCodeKeychainError = 17995, 170 | 171 | /** Indicates an internal error occurred. 172 | */ 173 | FIRAuthErrorCodeInternalError = 17999, 174 | }; 175 | 176 | @end 177 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIREmailPasswordAuthProvider.h: -------------------------------------------------------------------------------- 1 | /** @file FIREmailPasswordAuthProvider.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | @class FIRAuthCredential; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | @brief A string constant identifying the email & password identity provider. 16 | */ 17 | extern NSString *const FIREmailPasswordAuthProviderID; 18 | 19 | /** @class FIREmailPasswordAuthProvider 20 | @brief A concrete implementation of @c FIRAuthProvider for Email & Password Sign In. 21 | */ 22 | @interface FIREmailPasswordAuthProvider : NSObject 23 | 24 | /** @fn credentialWithEmail:password: 25 | @brief Creates an @c FIRAuthCredential for an email & password sign in. 26 | 27 | @param email The user's email address. 28 | @param password The user's password. 29 | @return A FIRAuthCredential containing the email & password credential. 30 | */ 31 | + (FIRAuthCredential *)credentialWithEmail:(NSString *)email password:(NSString *)password; 32 | 33 | /** @fn init 34 | @brief This class is not meant to be initialized. 35 | */ 36 | - (instancetype)init NS_UNAVAILABLE; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRFacebookAuthProvider.h: -------------------------------------------------------------------------------- 1 | /** @file FIRFacebookAuthProvider.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | @class FIRAuthCredential; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | @brief A string constant identifying the Facebook identity provider. 16 | */ 17 | extern NSString *const FIRFacebookAuthProviderID; 18 | 19 | /** @class FIRFacebookAuthProvider 20 | @brief Utility class for constructing Facebook credentials. 21 | */ 22 | @interface FIRFacebookAuthProvider : NSObject 23 | 24 | /** @fn credentialWithAccessToken: 25 | @brief Creates an @c FIRAuthCredential for a Facebook sign in. 26 | 27 | @param accessToken The Access Token from Facebook. 28 | @return A FIRAuthCredential containing the Facebook credentials. 29 | */ 30 | + (FIRAuthCredential *)credentialWithAccessToken:(NSString *)accessToken; 31 | 32 | /** @fn init 33 | @brief This class should not be initialized. 34 | */ 35 | - (instancetype)init NS_UNAVAILABLE; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRGitHubAuthProvider.h: -------------------------------------------------------------------------------- 1 | /** @file FIRGitHubAuthProvider.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | @class FIRAuthCredential; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | @brief A string constant identifying the GitHub identity provider. 16 | */ 17 | extern NSString *const FIRGitHubAuthProviderID; 18 | 19 | /** @class FIRGitHubAuthProvider 20 | @brief Utility class for constructing GitHub credentials. 21 | */ 22 | @interface FIRGitHubAuthProvider : NSObject 23 | 24 | /** @fn credentialWithToken: 25 | @brief Creates an @c FIRAuthCredential for a GitHub sign in. 26 | 27 | @param token The GitHub OAuth access token. 28 | @return A FIRAuthCredential containing the GitHub credential. 29 | */ 30 | + (FIRAuthCredential *)credentialWithToken:(NSString *)token; 31 | 32 | /** @fn init 33 | @brief This class is not meant to be initialized. 34 | */ 35 | - (instancetype)init NS_UNAVAILABLE; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRGoogleAuthProvider.h: -------------------------------------------------------------------------------- 1 | /** @file FIRGoogleAuthProvider.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | @class FIRAuthCredential; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | @brief A string constant identifying the Google identity provider. 16 | */ 17 | extern NSString *const FIRGoogleAuthProviderID; 18 | 19 | /** @class FIRGoogleAuthProvider 20 | @brief Utility class for constructing Google Sign In credentials. 21 | */ 22 | @interface FIRGoogleAuthProvider : NSObject 23 | 24 | /** @fn credentialWithIDToken:accessToken: 25 | @brief Creates an @c FIRAuthCredential for a Google sign in. 26 | 27 | @param IDToken The ID Token from Google. 28 | @param accessToken The Access Token from Google. 29 | @return A FIRAuthCredential containing the Google credentials. 30 | */ 31 | + (FIRAuthCredential *)credentialWithIDToken:(NSString *)IDToken 32 | accessToken:(NSString *)accessToken; 33 | 34 | /** @fn init 35 | @brief This class should not be initialized. 36 | */ 37 | - (instancetype)init NS_UNAVAILABLE; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRTwitterAuthProvider.h: -------------------------------------------------------------------------------- 1 | /** @file FIRTwitterAuthProvider.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | @class FIRAuthCredential; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | @brief A string constant identifying the Twitter identity provider. 16 | */ 17 | extern NSString *const FIRTwitterAuthProviderID; 18 | 19 | /** @class FIRTwitterAuthProvider 20 | @brief Utility class for constructing Twitter credentials. 21 | */ 22 | @interface FIRTwitterAuthProvider : NSObject 23 | 24 | /** @fn credentialWithToken:secret: 25 | @brief Creates an @c FIRAuthCredential for a Twitter sign in. 26 | 27 | @param token The Twitter OAuth token. 28 | @param secret The Twitter OAuth secret. 29 | @return A FIRAuthCredential containing the Twitter credential. 30 | */ 31 | + (FIRAuthCredential *)credentialWithToken:(NSString *)token secret:(NSString *)secret; 32 | 33 | /** @fn init 34 | @brief This class is not meant to be initialized. 35 | */ 36 | - (instancetype)init NS_UNAVAILABLE; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRUser.h: -------------------------------------------------------------------------------- 1 | /** @file FIRUser.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2015 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | #import "FIRAuth.h" 11 | #import "FIRUserInfo.h" 12 | 13 | @class FIRUserProfileChangeRequest; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** @typedef FIRAuthTokenCallback 18 | @brief The type of block called when a token is ready for use. 19 | @see FIRUser.getTokenWithCompletion: 20 | @see FIRUser.getTokenForcingRefresh:withCompletion: 21 | 22 | @param token Optionally; an access token if the request was successful. 23 | @param error Optionally; the error which occurred - or nil if the request was successful. 24 | 25 | @remarks One of: @c token or @c error will always be non-nil. 26 | */ 27 | typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error); 28 | 29 | /** @typedef FIRUserProfileChangeCallback 30 | @brief The type of block called when a user profile change has finished. 31 | 32 | @param error Optionally; the error which occurred - or nil if the request was successful. 33 | */ 34 | typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error); 35 | 36 | /** @typedef FIRSendEmailVerificationCallback 37 | @brief The type of block called when a request to send an email verification has finished. 38 | 39 | @param error Optionally; the error which occurred - or nil if the request was successful. 40 | */ 41 | typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error); 42 | 43 | /** @class FIRUser 44 | @brief Represents a user. 45 | @remarks This class is thread-safe. 46 | */ 47 | @interface FIRUser : NSObject 48 | 49 | /** @property anonymous 50 | @brief Indicates the user represents an anonymous user. 51 | */ 52 | @property(nonatomic, readonly, getter=isAnonymous) BOOL anonymous; 53 | 54 | /** @property emailVerified 55 | @brief Indicates the email address associated with this user has been verified. 56 | */ 57 | @property(nonatomic, readonly, getter=isEmailVerified) BOOL emailVerified; 58 | 59 | /** @property refreshToken 60 | @brief A refresh token; useful for obtaining new access tokens independently. 61 | @remarks This property should only be used for advanced scenarios, and is not typically needed. 62 | */ 63 | @property(nonatomic, readonly, nullable) NSString *refreshToken; 64 | 65 | /** @property providerData 66 | @brief Profile data for each identity provider, if any. 67 | @remarks This data is cached on sign-in and updated when linking or unlinking. 68 | */ 69 | @property(nonatomic, readonly, nonnull) NSArray> *providerData; 70 | 71 | /** @fn init 72 | @brief This class should not be instantiated. 73 | @remarks To retrieve the current user, use @c FIRAuth.currentUser. To sign a user 74 | in or out, use the methods on @c FIRAuth. 75 | */ 76 | - (instancetype)init NS_UNAVAILABLE; 77 | 78 | /** @fn updateEmail:completion: 79 | @brief Updates the email address for the user. On success, the cached user profile data is 80 | updated. 81 | @remarks May fail if there is already an account with this email address that was created using 82 | email and password authentication. 83 | 84 | @param email The email address for the user. 85 | @param completion Optionally; the block invoked when the user profile change has finished. 86 | Invoked asynchronously on the main thread in the future. 87 | 88 | @remarks Possible error codes: 89 |
    90 |
  • @c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was 91 | sent in the request. 92 |
  • 93 |
  • @c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in 94 | the console for this action. 95 |
  • 96 |
  • @c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for 97 | sending update email. 98 |
  • 99 |
  • @c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email is already in use by another 100 | account. 101 |
  • 102 |
  • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed. 103 |
  • 104 |
  • @c FIRAuthErrorCodeRequiresRecentLogin - Updating a user’s email is a security 105 | sensitive operation that requires a recent login from the user. This error indicates 106 | the user has not signed in recently enough. To resolve, reauthenticate the user by 107 | invoking reauthenticateWithCredential:completion: on FIRUser. 108 |
  • 109 |
110 | 111 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 112 | */ 113 | - (void)updateEmail:(NSString *)email completion:(nullable FIRUserProfileChangeCallback)completion; 114 | 115 | /** @fn updatePassword:completion: 116 | @brief Updates the password for the user. On success, the cached user profile data is updated. 117 | 118 | @param password The new password for the user. 119 | @param completion Optionally; the block invoked when the user profile change has finished. 120 | Invoked asynchronously on the main thread in the future. 121 | 122 | @remarks Possible error codes: 123 |
    124 |
  • @c FIRAuthErrorCodeOperationNotAllowed - Indicates the administrator disabled 125 | sign in with the specified identity provider. 126 |
  • 127 |
  • @c FIRAuthErrorCodeRequiresRecentLogin - Updating a user’s password is a security 128 | sensitive operation that requires a recent login from the user. This error indicates 129 | the user has not signed in recently enough. To resolve, reauthenticate the user by 130 | invoking reauthenticateWithCredential:completion: on FIRUser. 131 |
  • 132 |
  • @c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is 133 | considered too weak. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo 134 | dictionary object will contain more detailed explanation that can be shown to the user. 135 |
  • 136 |
137 | 138 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 139 | */ 140 | - (void)updatePassword:(NSString *)password 141 | completion:(nullable FIRUserProfileChangeCallback)completion; 142 | 143 | /** @fn profileChangeRequest 144 | @brief Creates an object which may be used to change the user's profile data. 145 | 146 | @remarks Set the properties of the returned object, then call 147 | @c FIRUserProfileChangeRequest.commitChangesWithCallback: to perform the updates atomically. 148 | 149 | @return An object which may be used to change the user's profile data atomically. 150 | */ 151 | - (FIRUserProfileChangeRequest *)profileChangeRequest; 152 | 153 | /** @fn reloadWithCompletion: 154 | @brief Reloads the user's profile data from the server. 155 | 156 | @param completion Optionally; the block invoked when the reload has finished. Invoked 157 | asynchronously on the main thread in the future. 158 | 159 | @remarks May fail with a @c FIRAuthErrorCodeRequiresRecentLogin error code. In this case 160 | you should call @c FIRUser.reauthenticateWithCredential:completion: before re-invoking 161 | @c FIRUser.updateEmail:completion:. 162 | 163 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. 164 | */ 165 | - (void)reloadWithCompletion:(nullable FIRUserProfileChangeCallback)completion; 166 | 167 | /** @fn reauthenticateWithCredential:completion: 168 | @brief Renews the user's authentication tokens by validating a fresh set of credentials supplied 169 | by the user. 170 | 171 | @param credential A user-supplied credential, which will be validated by the server. This can be 172 | a successful third-party identity provider sign-in, or an email address and password. 173 | @param completion Optionally; the block invoked when the re-authentication operation has 174 | finished. Invoked asynchronously on the main thread in the future. 175 | 176 | @remarks If the user associated with the supplied credential is different from the current user, 177 | or if the validation of the supplied credentials fails; an error is returned and the current 178 | user remains signed in. 179 | 180 | @remarks Possible error codes: 181 |
    182 |
  • @c FIRAuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid. 183 | This could happen if it has expired or it is malformed. 184 |
  • 185 |
  • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the 186 | identity provider represented by the credential are not enabled. Enable them in the 187 | Auth section of the Firebase console. 188 |
  • 189 |
  • @c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential 190 | (e.g. the email in a Facebook access token) is already in use by an existing account, 191 | that cannot be authenticated with this method. Call fetchProvidersForEmail for 192 | this user’s email and then prompt them to sign in with any of the sign-in providers 193 | returned. This error will only be thrown if the "One account per email address" 194 | setting is enabled in the Firebase console, under Auth settings. Please note that the 195 | error code raised in this specific situation may not be the same on Web and Android. 196 |
  • 197 |
  • @c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled. 198 |
  • 199 |
  • @c FIRAuthErrorCodeWrongPassword - Indicates the user attempted reauthentication with 200 | an incorrect password, if credential is of the type EmailPasswordAuthCredential. 201 |
  • 202 |
  • @c FIRAuthErrorCodeUserMismatch - Indicates that an attempt was made to 203 | reauthenticate with a user which is not the current user. 204 |
  • 205 |
  • @c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
  • 206 |
207 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. 208 | */ 209 | - (void)reauthenticateWithCredential:(FIRAuthCredential *)credential 210 | completion:(nullable FIRUserProfileChangeCallback)completion; 211 | 212 | /** @fn getTokenWithCompletion: 213 | @brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired. 214 | 215 | @param completion Optionally; the block invoked when the token is available. Invoked 216 | asynchronously on the main thread in the future. 217 | 218 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. 219 | */ 220 | - (void)getTokenWithCompletion:(nullable FIRAuthTokenCallback)completion; 221 | 222 | /** @fn getTokenForcingRefresh:completion: 223 | @brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired. 224 | 225 | @param forceRefresh Forces a token refresh. Useful if the token becomes invalid for some reason 226 | other than an expiration. 227 | @param completion Optionally; the block invoked when the token is available. Invoked 228 | asynchronously on the main thread in the future. 229 | 230 | @remarks The authentication token will be refreshed (by making a network request) if it has 231 | expired, or if @c forceRefresh is YES. 232 | 233 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods. 234 | */ 235 | - (void)getTokenForcingRefresh:(BOOL)forceRefresh 236 | completion:(nullable FIRAuthTokenCallback)completion; 237 | 238 | /** @fn linkWithCredential:completion: 239 | @brief Associates a user account from a third-party identity provider with this user. 240 | 241 | @param credential The credential for the identity provider. 242 | @param completion Optionally; the block invoked when the unlinking is complete, or fails. 243 | Invoked asynchronously on the main thread in the future. 244 | 245 | @remarks Possible error codes: 246 |
    247 |
  • @c FIRAuthErrorCodeProviderAlreadyLinked - Indicates an attempt to link a provider of a 248 | type already linked to this account. 249 |
  • 250 |
  • @c FIRAuthErrorCodeCredentialAlreadyInUse - Indicates an attempt to link with a 251 | credential 252 | that has already been linked with a different Firebase account. 253 |
  • 254 |
  • @c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the identity 255 | provider represented by the credential are not enabled. Enable them in the Auth section 256 | of the Firebase console. 257 |
  • 258 |
259 | 260 | @remarks This method may also return error codes associated with updateEmail:completion: and 261 | updatePassword:completion: on FIRUser. 262 | 263 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 264 | */ 265 | - (void)linkWithCredential:(FIRAuthCredential *)credential 266 | completion:(nullable FIRAuthResultCallback)completion; 267 | 268 | /** @fn unlinkFromProvider:completion: 269 | @brief Disassociates a user account from a third-party identity provider with this user. 270 | 271 | @param provider The provider ID of the provider to unlink. 272 | @param completion Optionally; the block invoked when the unlinking is complete, or fails. 273 | Invoked asynchronously on the main thread in the future. 274 | 275 | @remarks Possible error codes: 276 |
    277 |
  • @c FIRAuthErrorCodeNoSuchProvider - Indicates an attempt to unlink a provider 278 | that is not linked to the account. 279 |
  • 280 |
  • @c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive 281 | operation that requires a recent login from the user. This error indicates the user 282 | has not signed in recently enough. To resolve, reauthenticate the user by invoking 283 | reauthenticateWithCredential:completion: on FIRUser. 284 |
  • 285 |
286 | 287 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 288 | */ 289 | - (void)unlinkFromProvider:(NSString *)provider 290 | completion:(nullable FIRAuthResultCallback)completion; 291 | 292 | /** @fn sendEmailVerificationWithCompletion: 293 | @brief Initiates email verification for the user. 294 | 295 | @param completion Optionally; the block invoked when the request to send an email verification 296 | is complete, or fails. Invoked asynchronously on the main thread in the future. 297 | 298 | @remarks Possible error codes: 299 |
    300 |
  • @c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was 301 | sent in the request. 302 |
  • 303 |
  • @c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in 304 | the console for this action. 305 |
  • 306 |
  • @c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for 307 | sending update email. 308 |
  • 309 |
  • @c FIRAuthErrorCodeUserNotFound - Indicates the user account was not found.
  • 310 |
311 | 312 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 313 | */ 314 | - (void)sendEmailVerificationWithCompletion:(nullable FIRSendEmailVerificationCallback)completion; 315 | 316 | /** @fn deleteWithCompletion: 317 | @brief Deletes the user account (also signs out the user, if this was the current user). 318 | 319 | @param completion Optionally; the block invoked when the request to delete the account is 320 | complete, or fails. Invoked asynchronously on the main thread in the future. 321 | 322 | @remarks Possible error codes: 323 |
    324 |
  • @c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive 325 | operation that requires a recent login from the user. This error indicates the user 326 | has not signed in recently enough. To resolve, reauthenticate the user by invoking 327 | reauthenticateWithCredential:completion: on FIRUser. 328 |
  • 329 |
330 | 331 | @remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods. 332 | 333 | */ 334 | - (void)deleteWithCompletion:(nullable FIRUserProfileChangeCallback)completion; 335 | 336 | @end 337 | 338 | /** @class FIRUserProfileChangeRequest 339 | @brief Represents an object capable of updating a user's profile data. 340 | @remarks Properties are marked as being part of a profile update when they are set. Setting a 341 | property value to nil is not the same as leaving the property unassigned. 342 | */ 343 | @interface FIRUserProfileChangeRequest : NSObject 344 | 345 | /** @fn init 346 | @brief Please use @c FIRUser.profileChangeRequest 347 | */ 348 | - (instancetype)init NS_UNAVAILABLE; 349 | 350 | /** @property displayName 351 | @brief The user's display name. 352 | @remarks It is an error to set this property after calling 353 | @c FIRUserProfileChangeRequest.commitChangesWithCallback: 354 | */ 355 | @property(nonatomic, copy, nullable) NSString *displayName; 356 | 357 | /** @property photoURL 358 | @brief The user's photo URL. 359 | @remarks It is an error to set this property after calling 360 | @c FIRUserProfileChangeRequest.commitChangesWithCallback: 361 | */ 362 | @property(nonatomic, copy, nullable) NSURL *photoURL; 363 | 364 | /** @fn commitChangesWithCompletion: 365 | @brief Commits any pending changes. 366 | @remarks This method should only be called once. Once called, property values should not be 367 | changed. 368 | 369 | @param completion Optionally; the block invoked when the user profile change has been applied. 370 | Invoked asynchronously on the main thread in the future. 371 | */ 372 | - (void)commitChangesWithCompletion:(nullable FIRUserProfileChangeCallback)completion; 373 | 374 | @end 375 | 376 | NS_ASSUME_NONNULL_END 377 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FIRUserInfo.h: -------------------------------------------------------------------------------- 1 | /** @file FIRUserInfo.h 2 | @brief Firebase Auth SDK 3 | @copyright Copyright 2015 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | /** 13 | @brief Represents user data returned from an identity provider. 14 | */ 15 | @protocol FIRUserInfo 16 | 17 | /** @property providerID 18 | @brief The provider identifier. 19 | */ 20 | @property(nonatomic, copy, readonly) NSString *providerID; 21 | 22 | /** @property uid 23 | @brief The provider's user ID for the user. 24 | */ 25 | @property(nonatomic, copy, readonly) NSString *uid; 26 | 27 | /** @property displayName 28 | @brief The name of the user. 29 | */ 30 | @property(nonatomic, copy, readonly, nullable) NSString *displayName; 31 | 32 | /** @property photoURL 33 | @brief The URL of the user's profile photo. 34 | */ 35 | @property(nonatomic, copy, readonly, nullable) NSURL *photoURL; 36 | 37 | /** @property email 38 | @brief The user's email address. 39 | */ 40 | @property(nonatomic, copy, readonly, nullable) NSString *email; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FirebaseAuth.h: -------------------------------------------------------------------------------- 1 | #import "FIREmailPasswordAuthProvider.h" 2 | #import "FIRFacebookAuthProvider.h" 3 | #import "FIRGitHubAuthProvider.h" 4 | #import "FIRGoogleAuthProvider.h" 5 | #import "FIRTwitterAuthProvider.h" 6 | #import "FIRAuth.h" 7 | #import "FIRAuthCredential.h" 8 | #import "FIRAuthErrors.h" 9 | #import "FIRUser.h" 10 | #import "FIRUserInfo.h" 11 | #import "FirebaseAuthVersion.h" 12 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Headers/FirebaseAuthVersion.h: -------------------------------------------------------------------------------- 1 | /*! @file FirebaseAuthVersion.h 2 | @brief Firebase SDK 3 | @copyright Copyright 2016 Google Inc. 4 | @remarks Use of this SDK is subject to the Google APIs Terms of Service: 5 | https://developers.google.com/terms/ 6 | */ 7 | 8 | #import 9 | 10 | /** 11 | Version number for FirebaseAuth. 12 | */ 13 | extern const double FirebaseAuthVersionNumber; 14 | 15 | /** 16 | Version string for FirebaseAuth. 17 | */ 18 | extern const unsigned char *const FirebaseAuthVersionString; 19 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseAuth.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FirebaseAuth { 2 | umbrella header "FirebaseAuth.h" 3 | export * 4 | module * { export *} 5 | link "z" 6 | link framework "CoreGraphics" 7 | link framework "Foundation" 8 | link framework "Security" 9 | link framework "UIKit" 10 | } -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/FirebaseCore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/FirebaseCore.framework/FirebaseCore -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * This class provides configuration fields for Firebase Analytics. 5 | */ 6 | @interface FIRAnalyticsConfiguration : NSObject 7 | 8 | /** 9 | * Returns the shared instance of FIRAnalyticsConfiguration. 10 | */ 11 | + (FIRAnalyticsConfiguration *)sharedInstance; 12 | 13 | /** 14 | * Sets the minimum engagement time in seconds required to start a new session. The default value 15 | * is 10 seconds. 16 | */ 17 | - (void)setMinimumSessionInterval:(NSTimeInterval)minimumSessionInterval; 18 | 19 | /** 20 | * Sets the interval of inactivity in seconds that terminates the current session. The default 21 | * value is 1800 seconds (30 minutes). 22 | */ 23 | - (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval; 24 | 25 | /** 26 | * Sets whether analytics collection is enabled for this app on this device. This setting is 27 | * persisted across app sessions. By default it is enabled. 28 | */ 29 | - (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; 30 | 31 | /** 32 | * Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By 33 | * default they are enabled. 34 | */ 35 | - (void)setIsEnabled:(BOOL)isEnabled 36 | DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead."); 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FIRApp.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @class FIROptions; 5 | 6 | NS_ASSUME_NONNULL_BEGIN 7 | 8 | /** A block that takes a BOOL and has no return value. */ 9 | typedef void (^FIRAppVoidBoolCallback)(BOOL success); 10 | 11 | /** 12 | * The entry point of Firebase SDKs. 13 | * 14 | * Initialize and configure FIRApp using +[FIRApp configure] 15 | * or other customized ways as shown below. 16 | * 17 | * The logging system has two modes: default mode and debug mode. In default mode, only logs with 18 | * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent 19 | * to device. The log levels that Firebase uses are consistent with the ASL log levels. 20 | * 21 | * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this 22 | * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, 23 | * further executions of the application will also be in debug mode. In order to return to default 24 | * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. 25 | * 26 | * It is also possible to change the default logging level in code by calling setLoggerLevel: on 27 | * the FIRConfiguration interface. 28 | */ 29 | @interface FIRApp : NSObject 30 | 31 | /** 32 | * Configures a default Firebase app. Raises an exception if any configuration step fails. The 33 | * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched 34 | * and before using Firebase services. This method is thread safe. 35 | */ 36 | + (void)configure; 37 | 38 | /** 39 | * Configures the default Firebase app with the provided options. The default app is named 40 | * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread 41 | * safe. 42 | * 43 | * @param options The Firebase application options used to configure the service. 44 | */ 45 | + (void)configureWithOptions:(FIROptions *)options; 46 | 47 | /** 48 | * Configures a Firebase app with the given name and options. Raises an exception if any 49 | * configuration step fails. This method is thread safe. 50 | * 51 | * @param name The application's name given by the developer. The name should should only contain 52 | Letters, Numbers and Underscore. 53 | * @param options The Firebase application options used to configure the services. 54 | */ 55 | + (void)configureWithName:(NSString *)name options:(FIROptions *)options; 56 | 57 | /** 58 | * Returns the default app, or nil if the default app does not exist. 59 | */ 60 | + (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp()); 61 | 62 | /** 63 | * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. 64 | * This method is thread safe. 65 | */ 66 | + (nullable FIRApp *)appNamed:(NSString *)name; 67 | 68 | /** 69 | * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This 70 | * method is thread safe. 71 | */ 72 | + (nullable NSDictionary *)allApps; 73 | 74 | /** 75 | * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for 76 | * future use. This method is thread safe. 77 | */ 78 | - (void)deleteApp:(FIRAppVoidBoolCallback)completion; 79 | 80 | /** 81 | * FIRApp instances should not be initialized directly. Call +[FIRApp configure], 82 | * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. 83 | */ 84 | - (instancetype)init NS_UNAVAILABLE; 85 | 86 | /** 87 | * Gets the name of this app. 88 | */ 89 | @property(nonatomic, copy, readonly) NSString *name; 90 | 91 | /** 92 | * Gets the options for this app. 93 | */ 94 | @property(nonatomic, readonly) FIROptions *options; 95 | 96 | @end 97 | 98 | NS_ASSUME_NONNULL_END 99 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FIRConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "FIRAnalyticsConfiguration.h" 4 | #import "FIRLoggerLevel.h" 5 | 6 | /** 7 | * The log levels used by FIRConfiguration. 8 | */ 9 | typedef NS_ENUM(NSInteger, FIRLogLevel) { 10 | /** Error */ 11 | kFIRLogLevelError __deprecated = 0, 12 | /** Warning */ 13 | kFIRLogLevelWarning __deprecated, 14 | /** Info */ 15 | kFIRLogLevelInfo __deprecated, 16 | /** Debug */ 17 | kFIRLogLevelDebug __deprecated, 18 | /** Assert */ 19 | kFIRLogLevelAssert __deprecated, 20 | /** Max */ 21 | kFIRLogLevelMax __deprecated = kFIRLogLevelAssert 22 | } DEPRECATED_MSG_ATTRIBUTE( 23 | "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); 24 | 25 | /** 26 | * This interface provides global level properties that the developer can tweak, and the singleton 27 | * of the Firebase Analytics configuration class. 28 | */ 29 | @interface FIRConfiguration : NSObject 30 | 31 | /** Returns the shared configuration object. */ 32 | + (FIRConfiguration *)sharedInstance; 33 | 34 | /** The configuration class for Firebase Analytics. */ 35 | @property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; 36 | 37 | /** Global log level. Defaults to kFIRLogLevelError. */ 38 | @property(nonatomic, readwrite, assign) FIRLogLevel logLevel DEPRECATED_MSG_ATTRIBUTE( 39 | "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); 40 | 41 | /** 42 | * Sets the logging level for internal Firebase logging. Firebase will only log messages 43 | * that are logged at or below loggerLevel. The messages are logged both to the Xcode 44 | * console and to the device's log. Note that if an app is running from AppStore, it will 45 | * never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose) 46 | * setting. 47 | * 48 | * @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice. 49 | */ 50 | - (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FIRLoggerLevel.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The log levels used by internal logging. 3 | */ 4 | typedef NS_ENUM(NSInteger, FIRLoggerLevel) { 5 | FIRLoggerLevelError = 3 /*ASL_LEVEL_ERR*/, 6 | FIRLoggerLevelWarning = 4 /*ASL_LEVEL_WARNING*/, 7 | FIRLoggerLevelNotice = 5 /*ASL_LEVEL_NOTICE*/, 8 | FIRLoggerLevelInfo = 6 /*ASL_LEVEL_INFO*/, 9 | FIRLoggerLevelDebug = 7 /*ASL_LEVEL_DEBUG*/, 10 | FIRLoggerLevelMin = FIRLoggerLevelError, 11 | FIRLoggerLevelMax = FIRLoggerLevelDebug 12 | }; 13 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FIROptions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * This class provides constant fields of Google APIs. 5 | */ 6 | @interface FIROptions : NSObject 7 | 8 | /** 9 | * Returns the default options. 10 | */ 11 | + (FIROptions *)defaultOptions; 12 | 13 | /** 14 | * An iOS API key used for authenticating requests from your app, e.g. 15 | * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. 16 | */ 17 | @property(nonatomic, readonly, copy) NSString *APIKey; 18 | 19 | /** 20 | * The OAuth2 client ID for iOS application used to authenticate Google users, for example 21 | * @"12345.apps.googleusercontent.com", used for signing in with Google. 22 | */ 23 | @property(nonatomic, readonly, copy) NSString *clientID; 24 | 25 | /** 26 | * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. 27 | */ 28 | @property(nonatomic, readonly, copy) NSString *trackingID; 29 | 30 | /** 31 | * The Project Number from the Google Developer's console, for example @"012345678901", used to 32 | * configure Google Cloud Messaging. 33 | */ 34 | @property(nonatomic, readonly, copy) NSString *GCMSenderID; 35 | 36 | /** 37 | * The Project ID from the Firebase console, for example @"abc-xyz-123". Currently only populated 38 | * when using [FIROptions defaultOptions]. 39 | */ 40 | @property(nonatomic, readonly, copy) NSString *projectID; 41 | 42 | /** 43 | * The Android client ID used in Google AppInvite when an iOS app has its Android version, for 44 | * example @"12345.apps.googleusercontent.com". 45 | */ 46 | @property(nonatomic, readonly, copy) NSString *androidClientID; 47 | 48 | /** 49 | * The Google App ID that is used to uniquely identify an instance of an app. 50 | */ 51 | @property(nonatomic, readonly, copy) NSString *googleAppID; 52 | 53 | /** 54 | * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". 55 | */ 56 | @property(nonatomic, readonly, copy) NSString *databaseURL; 57 | 58 | /** 59 | * The URL scheme used to set up Durable Deep Link service. 60 | */ 61 | @property(nonatomic, readwrite, copy) NSString *deepLinkURLScheme; 62 | 63 | /** 64 | * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". 65 | */ 66 | @property(nonatomic, readonly, copy) NSString *storageBucket; 67 | 68 | /** 69 | * Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID 70 | * are required. Other keys may required for configuring specific services. 71 | */ 72 | - (instancetype)initWithGoogleAppID:(NSString *)googleAppID 73 | bundleID:(NSString *)bundleID 74 | GCMSenderID:(NSString *)GCMSenderID 75 | APIKey:(NSString *)APIKey 76 | clientID:(NSString *)clientID 77 | trackingID:(NSString *)trackingID 78 | androidClientID:(NSString *)androidClientID 79 | databaseURL:(NSString *)databaseURL 80 | storageBucket:(NSString *)storageBucket 81 | deepLinkURLScheme:(NSString *)deepLinkURLScheme; 82 | 83 | /** 84 | * Initializes a customized instance of FIROptions from the file at the given plist file path. 85 | * For example, 86 | * NSString *filePath = 87 | * [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; 88 | * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; 89 | * Returns nil if the plist file does not exist or is invalid. 90 | */ 91 | - (instancetype)initWithContentsOfFile:(NSString *)plistPath; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Headers/FirebaseCore.h: -------------------------------------------------------------------------------- 1 | #import "FIRAnalyticsConfiguration.h" 2 | #import "FIRApp.h" 3 | #import "FIRConfiguration.h" 4 | #import "FIRLoggerLevel.h" 5 | #import "FIROptions.h" 6 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseCore.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FirebaseCore { 2 | umbrella header "FirebaseCore.h" 3 | export * 4 | module * { export *} 5 | link "z" 6 | link framework "Foundation" 7 | link framework "UIKit" 8 | } -------------------------------------------------------------------------------- /iphone/platform/FirebaseInstanceID.framework/FirebaseInstanceID: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/FirebaseInstanceID.framework/FirebaseInstanceID -------------------------------------------------------------------------------- /iphone/platform/FirebaseInstanceID.framework/Headers/FIRInstanceID.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | /** 4 | * @memberof FIRInstanceID 5 | * 6 | * The scope to be used when fetching/deleting a token for Firebase Messaging. 7 | */ 8 | FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging; 9 | 10 | /** 11 | * Called when the system determines that tokens need to be refreshed. 12 | * This method is also called if Instance ID has been reset in which 13 | * case, tokens and FCM topic subscriptions also need to be refreshed. 14 | * 15 | * Instance ID service will throttle the refresh event across all devices 16 | * to control the rate of token updates on application servers. 17 | */ 18 | FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification; 19 | 20 | /** 21 | * @related FIRInstanceID 22 | * 23 | * The completion handler invoked when the InstanceID token returns. If 24 | * the call fails we return the appropriate `error code` as described below. 25 | * 26 | * @param token The valid token as returned by InstanceID backend. 27 | * 28 | * @param error The error describing why generating a new token 29 | * failed. See the error codes below for a more detailed 30 | * description. 31 | */ 32 | typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error); 33 | 34 | 35 | /** 36 | * @related FIRInstanceID 37 | * 38 | * The completion handler invoked when the InstanceID `deleteToken` returns. If 39 | * the call fails we return the appropriate `error code` as described below 40 | * 41 | * @param error The error describing why deleting the token failed. 42 | * See the error codes below for a more detailed description. 43 | */ 44 | typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); 45 | 46 | /** 47 | * @related FIRInstanceID 48 | * 49 | * The completion handler invoked when the app identity is created. If the 50 | * identity wasn't created for some reason we return the appropriate error code. 51 | * 52 | * @param identity A valid identity for the app instance, nil if there was an error 53 | * while creating an identity. 54 | * @param error The error if fetching the identity fails else nil. 55 | */ 56 | typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error); 57 | 58 | /** 59 | * @related FIRInstanceID 60 | * 61 | * The completion handler invoked when the app identity and all the tokens associated 62 | * with it are deleted. Returns a valid error object in case of failure else nil. 63 | * 64 | * @param error The error if deleting the identity and all the tokens associated with 65 | * it fails else nil. 66 | */ 67 | typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error); 68 | 69 | /** 70 | * @enum FIRInstanceIDError 71 | */ 72 | typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { 73 | // Http related errors. 74 | 75 | /// Unknown error. 76 | FIRInstanceIDErrorUnknown = 0, 77 | 78 | /// Auth Error -- GCM couldn't validate request from this client. 79 | FIRInstanceIDErrorAuthentication = 1, 80 | 81 | /// NoAccess -- InstanceID service cannot be accessed. 82 | FIRInstanceIDErrorNoAccess = 2, 83 | 84 | /// Timeout -- Request to InstanceID backend timed out. 85 | FIRInstanceIDErrorTimeout = 3, 86 | 87 | /// Network -- No network available to reach the servers. 88 | FIRInstanceIDErrorNetwork = 4, 89 | 90 | /// OperationInProgress -- Another similar operation in progress, 91 | /// bailing this one. 92 | FIRInstanceIDErrorOperationInProgress = 5, 93 | 94 | /// InvalidRequest -- Some parameters of the request were invalid. 95 | FIRInstanceIDErrorInvalidRequest = 7, 96 | }; 97 | 98 | /** 99 | * The APNS token type for the app. If the token type is set to `UNKNOWN` 100 | * InstanceID will implicitly try to figure out what the actual token type 101 | * is from the provisioning profile. 102 | */ 103 | typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { 104 | /// Unknown token type. 105 | FIRInstanceIDAPNSTokenTypeUnknown, 106 | /// Sandbox token type. 107 | FIRInstanceIDAPNSTokenTypeSandbox, 108 | /// Production token type. 109 | FIRInstanceIDAPNSTokenTypeProd, 110 | }; 111 | 112 | /** 113 | * Instance ID provides a unique identifier for each app instance and a mechanism 114 | * to authenticate and authorize actions (for example, sending a GCM message). 115 | * 116 | * Instance ID is long lived but, may be reset if the device is not used for 117 | * a long time or the Instance ID service detects a problem. 118 | * If Instance ID is reset, the app will be notified via 119 | * `kFIRInstanceIDTokenRefreshNotification`. 120 | * 121 | * If the Instance ID has become invalid, the app can request a new one and 122 | * send it to the app server. 123 | * To prove ownership of Instance ID and to allow servers to access data or 124 | * services associated with the app, call 125 | * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. 126 | */ 127 | @interface FIRInstanceID : NSObject 128 | 129 | /** 130 | * FIRInstanceID. 131 | * 132 | * @return A shared instance of FIRInstanceID. 133 | */ 134 | + (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID()); 135 | 136 | /** 137 | * Unavailable. Use +instanceID instead. 138 | */ 139 | - (nonnull instancetype)init __attribute__((unavailable("Use +instanceID instead."))); 140 | 141 | /** 142 | * Set APNS token for the application. This APNS token will be used to register 143 | * with Firebase Messaging using `token` or 144 | * `tokenWithAuthorizedEntity:scope:options:handler`. If the token type is set to 145 | * `FIRInstanceIDAPNSTokenTypeUnknown` InstanceID will read the provisioning profile 146 | * to find out the token type. 147 | * 148 | * @param token The APNS token for the application. 149 | * @param type The APNS token type for the above token. 150 | */ 151 | - (void)setAPNSToken:(nonnull NSData *)token 152 | type:(FIRInstanceIDAPNSTokenType)type; 153 | 154 | #pragma mark - Tokens 155 | 156 | /** 157 | * Returns a Firebase Messaging scoped token for the firebase app. 158 | * 159 | * @return Null Returns null if the device has not yet been registerd with 160 | * Firebase Message else returns a valid token. 161 | */ 162 | - (nullable NSString *)token; 163 | 164 | /** 165 | * Returns a token that authorizes an Entity (example: cloud service) to perform 166 | * an action on behalf of the application identified by Instance ID. 167 | * 168 | * This is similar to an OAuth2 token except, it applies to the 169 | * application instance instead of a user. 170 | * 171 | * This is an asynchronous call. If the token fetching fails for some reason 172 | * we invoke the completion callback with nil `token` and the appropriate 173 | * error. 174 | * 175 | * Note, you can only have one `token` or `deleteToken` call for a given 176 | * authorizedEntity and scope at any point of time. Making another such call with the 177 | * same authorizedEntity and scope before the last one finishes will result in an 178 | * error with code `OperationInProgress`. 179 | * 180 | * @see FIRInstanceID deleteTokenWithAuthorizedEntity:scope:handler: 181 | * 182 | * @param authorizedEntity Entity authorized by the token. 183 | * @param scope Action authorized for authorizedEntity. 184 | * @param options The extra options to be sent with your token request. The 185 | * value for the `apns_token` should be the NSData object 186 | * passed to UIApplication's 187 | * `didRegisterForRemoteNotificationsWithDeviceToken` method. 188 | * All other keys and values in the options dict need to be 189 | * instances of NSString or else they will be discarded. Bundle 190 | * keys starting with 'GCM.' and 'GOOGLE.' are reserved. 191 | * @param handler The callback handler which is invoked when the token is 192 | * successfully fetched. In case of success a valid `token` and 193 | * `nil` error are returned. In case of any error the `token` 194 | * is nil and a valid `error` is returned. The valid error 195 | * codes have been documented above. 196 | */ 197 | - (void)tokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity 198 | scope:(nonnull NSString *)scope 199 | options:(nullable NSDictionary *)options 200 | handler:(nonnull FIRInstanceIDTokenHandler)handler; 201 | 202 | /** 203 | * Revokes access to a scope (action) for an entity previously 204 | * authorized by `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. 205 | * 206 | * This is an asynchronous call. Call this on the main thread since InstanceID lib 207 | * is not thread safe. In case token deletion fails for some reason we invoke the 208 | * `handler` callback passed in with the appropriate error code. 209 | * 210 | * Note, you can only have one `token` or `deleteToken` call for a given 211 | * authorizedEntity and scope at a point of time. Making another such call with the 212 | * same authorizedEntity and scope before the last one finishes will result in an error 213 | * with code `OperationInProgress`. 214 | * 215 | * @param authorizedEntity Entity that must no longer have access. 216 | * @param scope Action that entity is no longer authorized to perform. 217 | * @param handler The handler that is invoked once the unsubscribe call ends. 218 | * In case of error an appropriate error object is returned 219 | * else error is nil. 220 | */ 221 | - (void)deleteTokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity 222 | scope:(nonnull NSString *)scope 223 | handler:(nonnull FIRInstanceIDDeleteTokenHandler)handler; 224 | 225 | #pragma mark - Identity 226 | 227 | /** 228 | * Asynchronously fetch a stable identifier that uniquely identifies the app 229 | * instance. If the identifier has been revoked or has expired, this method will 230 | * return a new identifier. 231 | * 232 | * 233 | * @param handler The handler to invoke once the identifier has been fetched. 234 | * In case of error an appropriate error object is returned else 235 | * a valid identifier is returned and a valid identifier for the 236 | * application instance. 237 | */ 238 | - (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler; 239 | 240 | /** 241 | * Resets Instance ID and revokes all tokens. 242 | */ 243 | - (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler; 244 | 245 | @end 246 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h: -------------------------------------------------------------------------------- 1 | #import "FIRInstanceID.h" 2 | -------------------------------------------------------------------------------- /iphone/platform/FirebaseInstanceID.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module FirebaseInstanceID { 2 | umbrella header "FirebaseInstanceID.h" 3 | export * 4 | module * { export *} 5 | link framework "Foundation" 6 | link framework "UIKit" 7 | } -------------------------------------------------------------------------------- /iphone/platform/GTMSessionFetcher.framework/GTMSessionFetcher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/GTMSessionFetcher.framework/GTMSessionFetcher -------------------------------------------------------------------------------- /iphone/platform/GoogleToolboxForMac.framework/GoogleToolboxForMac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/platform/GoogleToolboxForMac.framework/GoogleToolboxForMac -------------------------------------------------------------------------------- /iphone/platform/README.md: -------------------------------------------------------------------------------- 1 | Firebase SDK: 3.15.0 2 | -------------------------------------------------------------------------------- /iphone/platform/module.modulemap: -------------------------------------------------------------------------------- 1 | module Firebase { 2 | export * 3 | header "Firebase.h" 4 | } -------------------------------------------------------------------------------- /iphone/ti-firebase.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iphone/ti-firebase.xcodeproj/project.xcworkspace/xcuserdata/cribe.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/iphone/ti-firebase.xcodeproj/project.xcworkspace/xcuserdata/cribe.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iphone/ti-firebase.xcodeproj/xcshareddata/xcschemes/ti-firebase.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 58 | 59 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 74 | 80 | 81 | 82 | 83 | 85 | 86 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /iphone/ti-firebase.xcodeproj/xcuserdata/cribe.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Build & Test.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | ti-firebase.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 24416B8111C4CA220047AFDD 21 | 22 | primary 23 | 24 | 25 | D2AAC07D0554694100DB518D 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iphone/timodule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /iphone/titanium.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT) 4 | // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR 5 | // 6 | // 7 | TITANIUM_SDK_VERSION = 6.0.2.GA 8 | 9 | 10 | // 11 | // THESE SHOULD BE OK GENERALLY AS-IS 12 | // 13 | TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) 14 | TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" 15 | TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" 16 | TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/JavaScriptCore" 17 | HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) $(TITANIUM_BASE_SDK3) 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ti.firebase-iphone-1.3.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisribe/ti-firebase/2a70e9741f9a902aa03ef38d3a6795710d181ae8/ti.firebase-iphone-1.3.1.zip --------------------------------------------------------------------------------