Skip to content

Commit

Permalink
Merge pull request #50 from tuarua/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
tuarua authored Jan 24, 2021
2 parents 780d3a7 + 83d472d commit fc87e21
Show file tree
Hide file tree
Showing 66 changed files with 243 additions and 69 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 0.17.0
- [Firestore] fix callback bug
- [Firestore] added `FieldValue.serverTimestamp()`
- [Firestore] added `FieldValue.remove()`
- [Firestore] added `FieldValue.increment(value:)`

### 0.16.0
- Upgraded to AIR 33.1.1.345
- AND: Updated to FreKotlin 1.42.0
Expand Down
4 changes: 3 additions & 1 deletion example/.idea/libraries/extensions.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions example/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase-sample",
"version": "0.16.0",
"version": "0.17.0",
"appDescriptor": "src/Main-app.xml",
"variables": {
"firebase_associated_domain": "xxxx.app.goo.gl",
Expand All @@ -15,17 +15,17 @@
"url": "https://tuarua.github.io/air/air_packages.json"
},
"dependencies": {
"com.tuarua.firebase.FirebaseANE": "0.16.0",
"com.tuarua.firebase.AnalyticsANE": "0.16.0",
"com.tuarua.firebase.AuthANE": "0.16.0",
"com.tuarua.firebase.DynamicLinksANE": "0.16.0",
"com.tuarua.firebase.FirestoreANE": "0.16.0",
"com.tuarua.firebase.MessagingANE": "0.16.0",
"com.tuarua.firebase.PerformanceANE": "0.16.0",
"com.tuarua.firebase.RemoteConfigANE": "0.16.0",
"com.tuarua.firebase.StorageANE": "0.16.0",
"com.tuarua.firebase.CrashlyticsANE": "0.16.0",
"com.tuarua.google.GoogleSignInANE": "0.16.0",
"com.tuarua.OneSignalANE": "0.16.0"
"com.tuarua.firebase.FirebaseANE": "0.17.0",
"com.tuarua.firebase.AnalyticsANE": "0.17.0",
"com.tuarua.firebase.AuthANE": "0.17.0",
"com.tuarua.firebase.DynamicLinksANE": "0.17.0",
"com.tuarua.firebase.FirestoreANE": "0.17.0",
"com.tuarua.firebase.MessagingANE": "0.17.0",
"com.tuarua.firebase.PerformanceANE": "0.17.0",
"com.tuarua.firebase.RemoteConfigANE": "0.17.0",
"com.tuarua.firebase.StorageANE": "0.17.0",
"com.tuarua.firebase.CrashlyticsANE": "0.17.0",
"com.tuarua.google.GoogleSignInANE": "0.17.0",
"com.tuarua.OneSignalANE": "0.17.0"
}
}
2 changes: 1 addition & 1 deletion example/src/Main-app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebaseane.example</id>
<filename>FireBaseExample</filename>
<name>FIR-Example</name>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<!-- Settings for the application's initial window. Required. -->
<initialWindow>
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
Expand Down
4 changes: 2 additions & 2 deletions example/src/views/examples/FirestoreExample.as
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.tuarua.firebase.firestore.DocumentChange;
import com.tuarua.firebase.firestore.DocumentChangeType;
import com.tuarua.firebase.firestore.DocumentReference;
import com.tuarua.firebase.firestore.DocumentSnapshot;
import com.tuarua.firebase.firestore.FieldValue;
import com.tuarua.firebase.firestore.FirestoreError;
import com.tuarua.firebase.firestore.FirestoreSettings;
import com.tuarua.firebase.firestore.Query;
Expand Down Expand Up @@ -219,7 +220,7 @@ public class FirestoreExample extends Sprite implements IExample {
private function onUpdateDocumentClick(event:TouchEvent):void {
var touch:Touch = event.getTouch(btnUpdateDocument);
if (touch != null && touch.phase == TouchPhase.ENDED) {
sanFran.updateData({"population": 860999}, onDocUpdated);
sanFran.updateData({"population": FieldValue.increment(1212)}, onDocUpdated);
}
}

Expand All @@ -228,7 +229,6 @@ public class FirestoreExample extends Sprite implements IExample {
statusLabel.text = "onDocUpdated error: " + error.errorID + " : " + error.message;
return;
}
trace(path);
statusLabel.text = "Updated " + path;
}

Expand Down
4 changes: 3 additions & 1 deletion example_vision/.idea/libraries/extensions.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions example_vision/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase-sample",
"version": "0.16.0",
"version": "0.17.0",
"appDescriptor": "src/Main-app.xml",
"variables": {},
"airDotPrefix": true,
Expand All @@ -9,13 +9,13 @@
"url": "https://tuarua.github.io/air/air_packages.json"
},
"dependencies": {
"com.tuarua.firebase.FirebaseANE": "0.16.0",
"com.tuarua.firebase.AnalyticsANE": "0.16.0",
"com.tuarua.firebase.VisionANE": "0.16.0",
"com.tuarua.firebase.VisionCloudTextANE": "0.16.0",
"com.tuarua.firebase.VisionCloudDocumentANE": "0.16.0",
"com.tuarua.firebase.VisionCloudLabelANE": "0.16.0",
"com.tuarua.firebase.VisionLandmarkANE": "0.16.0",
"com.tuarua.firebase.ModelInterpreterANE": "0.16.0"
"com.tuarua.firebase.FirebaseANE": "0.17.0",
"com.tuarua.firebase.AnalyticsANE": "0.17.0",
"com.tuarua.firebase.VisionANE": "0.17.0",
"com.tuarua.firebase.VisionCloudTextANE": "0.17.0",
"com.tuarua.firebase.VisionCloudDocumentANE": "0.17.0",
"com.tuarua.firebase.VisionCloudLabelANE": "0.17.0",
"com.tuarua.firebase.VisionLandmarkANE": "0.17.0",
"com.tuarua.firebase.ModelInterpreterANE": "0.17.0"
}
}
2 changes: 1 addition & 1 deletion example_vision/src/Main-app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebaseane.example</id>
<filename>FireBaseExample</filename>
<name>FIR-Example</name>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<!-- Settings for the application's initial window. Required. -->
<initialWindow>
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
Expand Down
2 changes: 1 addition & 1 deletion native_extension/AnalyticsANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.AnalyticsANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/AnalyticsANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.AnalyticsANE</id>
<name>Firebase Analytics ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2018 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/AnalyticsANE/bin/AnalyticsANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/AuthANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.AuthANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/AuthANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.AuthANE</id>
<name>Firebase Auth ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2018 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/AuthANE/bin/AuthANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/CrashlyticsANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.CrashlyticsANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/CrashlyticsANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.CrashlyticsANE</id>
<name>Firebase Crashlytics ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2018 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/CrashlyticsANE/bin/CrashlyticsANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/DynamicLinksANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.DynamicLinksANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/DynamicLinksANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.DynamicLinksANE</id>
<name>Firebase Dynamic Links ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2017 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/DynamicLinksANE/bin/DynamicLinksANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/FirestoreANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.FirestoreANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/FirestoreANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.FirestoreANE</id>
<name>Firebase Firestore ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2017 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/FirestoreANE/bin/FirestoreANE.swc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public class FirestoreANEContext {
} else if (argsAsJSON.hasOwnProperty("data") && argsAsJSON.data && argsAsJSON.data.hasOwnProperty("path")) {
path = argsAsJSON.data.path;
}
callCallback(argsAsJSON.callbackId, true, err);
callCallback(argsAsJSON.callbackId, true, path, err);
} catch (e:Error) {
trace("parsing error", event.code, e.message);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2021 Tua Rua Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.tuarua.firebase.firestore {
public class DeleteFieldValue extends FieldValue {
public var methodName:String = "FieldValue.delete";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2021 Tua Rua Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.tuarua.firebase.firestore {
public class FieldValue {
/**
* Returns a sentinel for use with set() or update() to include a server-generated
* timestamp in the written data.
*/
public static function serverTimestamp():FieldValue {
return new ServerTimestampFieldValue();
}

/** Returns a sentinel for use with update() to mark a field for deletion. */
public static function remove():FieldValue {
return new DeleteFieldValue();
}

/**
* Returns a special value that can be used with set() or update() that tells the
* server to increment the field's current value by the given value.
*
* <p>If the current value is an integer or a double, both the current and the given value will be
* interpreted as doubles and all arithmetic will follow IEEE 754 semantics. Otherwise, the
* transformation will set the field to the given value.
*
* @return The FieldValue sentinel for use in a call to set() or update().
*/
public static function increment(by: Number):FieldValue {
return new NumericIncrementFieldValue(by);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2021 Tua Rua Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.tuarua.firebase.firestore {
public class NumericIncrementFieldValue extends FieldValue {
public var operand:Number;
public var methodName:String = "FieldValue.increment";
public function NumericIncrementFieldValue(operand:Number) {
super();
this.operand = operand;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2021 Tua Rua Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.tuarua.firebase.firestore {
public class ServerTimestampFieldValue extends FieldValue {
public var methodName:String = "FieldValue.serverTimestamp";
}
}
2 changes: 1 addition & 1 deletion native_extension/GoogleSignInANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.google.GoogleSignInANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/GoogleSignInANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.google.GoogleSignInANE</id>
<name>Google Sign In ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2018 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/GoogleSignInANE/bin/GoogleSignInANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/MessagingANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.MessagingANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
2 changes: 1 addition & 1 deletion native_extension/MessagingANE/ane/extension_multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>com.tuarua.firebase.MessagingANE</id>
<name>Firebase Messaging ANE</name>
<copyright>This work is licensed under Apache License, Copyright (c) 2018 Tua Rua Ltd.</copyright>
<versionNumber>0.16.0</versionNumber>
<versionNumber>0.17.0</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
Expand Down
Binary file modified native_extension/MessagingANE/bin/MessagingANE.swc
Binary file not shown.
2 changes: 1 addition & 1 deletion native_extension/ModelInterpreterANE/ane/air_package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.tuarua.firebase.ModelInterpreterANE",
"version": "0.16.0",
"version": "0.17.0",
"repository": {
"url": "https://tuarua.github.io/air/air_packages.json"
},
Expand Down
Loading

0 comments on commit fc87e21

Please sign in to comment.