From 2d6b9355606dc4a5daf80ea52ce177b28b0b8438 Mon Sep 17 00:00:00 2001 From: Ravindra Date: Wed, 23 May 2018 20:44:16 +0530 Subject: [PATCH 1/4] observerevent event type issue fixed Looks like the MAKE_SYSTEM_PROP was not setting event values properly. I think keeping it in Module file is a good idea. Also, DATA_EVENT_TYPE_VALUE was set to FIRDataEventTypeChildAdded. Now changed to FIRDataEventTypeValue. --- ios/Classes/FirebaseDatabaseModule.m | 6 +++++ ios/Classes/FirebaseDatabaseReferenceProxy.m | 28 ++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ios/Classes/FirebaseDatabaseModule.m b/ios/Classes/FirebaseDatabaseModule.m index 6b061bb..db49c1a 100644 --- a/ios/Classes/FirebaseDatabaseModule.m +++ b/ios/Classes/FirebaseDatabaseModule.m @@ -16,6 +16,12 @@ @implementation FirebaseDatabaseModule #pragma mark Internal +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_VALUE, FIRDataEventTypeValue); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_ADD, FIRDataEventTypeChildAdded); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_REMOVE, FIRDataEventTypeChildRemoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_MOVE, FIRDataEventTypeChildMoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHANGE, FIRDataEventTypeChildChanged); + - (id)moduleGUID { return @"70e51a34-9140-4f84-bc9b-59960d99fbf8"; diff --git a/ios/Classes/FirebaseDatabaseReferenceProxy.m b/ios/Classes/FirebaseDatabaseReferenceProxy.m index c270ece..52498cb 100644 --- a/ios/Classes/FirebaseDatabaseReferenceProxy.m +++ b/ios/Classes/FirebaseDatabaseReferenceProxy.m @@ -60,9 +60,9 @@ - (FirebaseDatabaseReferenceProxy *)child:(id)arguments - (FirebaseDatabaseReferenceProxy *)parent:(id)arguments { ENSURE_SINGLE_ARG(arguments, NSDictionary); - + NSArray *observableEvents = [arguments objectForKey:@"observableEvents"]; - + return [[FirebaseDatabaseReferenceProxy alloc] _initWithPageContext:self.pageContext andDatabaseReference:[self _referenceFromArguments:arguments andType:TiReferenceTypeParent] observableEvents:observableEvents]; @@ -71,9 +71,9 @@ - (FirebaseDatabaseReferenceProxy *)parent:(id)arguments - (FirebaseDatabaseReferenceProxy *)root:(id)arguments { ENSURE_SINGLE_ARG(arguments, NSDictionary); - + NSArray *observableEvents = [arguments objectForKey:@"observableEvents"]; - + return [[FirebaseDatabaseReferenceProxy alloc] _initWithPageContext:self.pageContext andDatabaseReference:[self _referenceFromArguments:arguments andType:TiReferenceTypeRoot] observableEvents:observableEvents]; @@ -196,29 +196,29 @@ - (FIRDatabaseReference *)_referenceFromArguments:(NSDictionary *)arguments andT if (type == TiReferenceTypeRoot) { return [_reference root]; } - + if (type == TiReferenceTypeParent) { return [_reference parent]; } - + NSString *identifier = [arguments objectForKey:@"identifier"]; NSString *path = [arguments objectForKey:@"path"]; NSString *url = [arguments objectForKey:@"url"]; - + FIRDatabaseReference *reference = nil; - + if (identifier != nil) { return [[[FIRDatabase database] reference] child:identifier]; } - + if (path != nil) { return [[FIRDatabase database] referenceWithPath:path]; } - + if (url != nil) { return [[FIRDatabase database] referenceFromURL:url]; } - + [self throwException:@"Cannot construct database reference" subreason:@"No valid key (identifier, path or url) found" location:CODELOCATION]; @@ -247,10 +247,4 @@ - (void)_sendEvent:(NSDictionary *)event forEventType:(FIRDataEventType)eventTyp [self fireEvent:identifier withObject:event]; } -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_VALUE, FIRDataEventTypeChildAdded); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_ADD, FIRDataEventTypeChildAdded); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_REMOVE, FIRDataEventTypeChildRemoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_MOVE, FIRDataEventTypeChildMoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHANGE, FIRDataEventTypeChildChanged); - @end From 441f9de72144061b8782d609c3d9921706fbef9b Mon Sep 17 00:00:00 2001 From: Ravindra Date: Wed, 23 May 2018 21:38:08 +0530 Subject: [PATCH 2/4] Version number updated to 1.2 Observerevent name changed. Documentation updated. --- README.md | 20 ++++++++++---------- ios/Classes/FirebaseDatabaseModule.m | 8 ++++---- ios/manifest | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a52da9d..bc53027 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Use the native Firebase SDK in Axway Titanium. This repository is part of the [T - `root(arguments)` -> `FirebaseDatabaseReference`  - `observableEvents` ([`DATA_EVENT_TYPE_*`]) - + - `parent(arguments)` -> `FirebaseDatabaseReference` - `observableEvents` ([`DATA_EVENT_TYPE_*`]) @@ -39,7 +39,7 @@ Use the native Firebase SDK in Axway Titanium. This repository is part of the [T - `removeValue(callback)`  - `callback` (optional, Function) - + - `updateChildValues(childValues, callback)`  - `childValues` (Dictionary)  - `callback` (optional, Function) @@ -64,10 +64,10 @@ Use the native Firebase SDK in Axway Titanium. This repository is part of the [T #### Constants - `DATA_EVENT_TYPE_VALUE` -- `DATA_EVENT_TYPE_ADD` -- `DATA_EVENT_TYPE_CHANGE` -- `DATA_EVENT_TYPE_MOVE` -- `DATA_EVENT_TYPE_REMOVE` +- `DATA_EVENT_TYPE_CHILD_ADD` +- `DATA_EVENT_TYPE_CHILD_CHANGE` +- `DATA_EVENT_TYPE_CHILD_MOVE` +- `DATA_EVENT_TYPE_CHILD_REMOVE` ## Events @@ -75,10 +75,10 @@ Important note: Events are added and removed generically. They are only fired if the `observableEvents` parameter. - `value` (via `DATA_EVENT_TYPE_VALUE`) -- `add` (via `DATA_EVENT_TYPE_ADD`) -- `change` (via `DATA_EVENT_TYPE_CHANGE`) -- `move` (via `DATA_EVENT_TYPE_MOVE`) -- `remove` (via `DATA_EVENT_TYPE_REMOVE`) +- `add` (via `DATA_EVENT_TYPE_CHILD_ADD`) +- `change` (via `DATA_EVENT_TYPE_CHILD_CHANGE`) +- `move` (via `DATA_EVENT_TYPE_CHILD_MOVE`) +- `remove` (via `DATA_EVENT_TYPE_CHILD_REMOVE`) ## Example ```js diff --git a/ios/Classes/FirebaseDatabaseModule.m b/ios/Classes/FirebaseDatabaseModule.m index db49c1a..8e4a262 100644 --- a/ios/Classes/FirebaseDatabaseModule.m +++ b/ios/Classes/FirebaseDatabaseModule.m @@ -17,10 +17,10 @@ @implementation FirebaseDatabaseModule #pragma mark Internal MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_VALUE, FIRDataEventTypeValue); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_ADD, FIRDataEventTypeChildAdded); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_REMOVE, FIRDataEventTypeChildRemoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_MOVE, FIRDataEventTypeChildMoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHANGE, FIRDataEventTypeChildChanged); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_ADDED, FIRDataEventTypeChildAdded); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_REMOVE, FIRDataEventTypeChildRemoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_MOVE, FIRDataEventTypeChildMoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_CHANGE, FIRDataEventTypeChildChanged); - (id)moduleGUID { diff --git a/ios/manifest b/ios/manifest index f5a37e9..b92b79c 100644 --- a/ios/manifest +++ b/ios/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 1.1.0 +version: 1.2.0 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: titanium-firebase-database @@ -15,4 +15,4 @@ name: titanium-firebase-database moduleid: firebase.database guid: 70e51a34-9140-4f84-bc9b-59960d99fbf8 platform: iphone -minsdk: 6.3.0.GA \ No newline at end of file +minsdk: 6.3.0.GA From b9871b22776db1cbd99b93be0e7d87a6881597eb Mon Sep 17 00:00:00 2001 From: Ravindra Date: Thu, 24 May 2018 12:09:32 +0530 Subject: [PATCH 3/4] Version number correction 1.1.1 1. Typo fixed. 2. According to https://semver.org the patch version should be 1.1.1 Now it has been corrected. --- README.md | 16 ++++++++-------- ios/Classes/FirebaseDatabaseModule.m | 6 +++--- ios/manifest | 2 +- ios/titanium.xcconfig | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index bc53027..72a325f 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ Use the native Firebase SDK in Axway Titanium. This repository is part of the [T #### Constants - `DATA_EVENT_TYPE_VALUE` -- `DATA_EVENT_TYPE_CHILD_ADD` -- `DATA_EVENT_TYPE_CHILD_CHANGE` -- `DATA_EVENT_TYPE_CHILD_MOVE` -- `DATA_EVENT_TYPE_CHILD_REMOVE` +- `DATA_EVENT_TYPE_CHILD_ADDED` +- `DATA_EVENT_TYPE_CHILD_CHANGED` +- `DATA_EVENT_TYPE_CHILD_MOVED` +- `DATA_EVENT_TYPE_CHILD_REMOVED` ## Events @@ -75,10 +75,10 @@ Important note: Events are added and removed generically. They are only fired if the `observableEvents` parameter. - `value` (via `DATA_EVENT_TYPE_VALUE`) -- `add` (via `DATA_EVENT_TYPE_CHILD_ADD`) -- `change` (via `DATA_EVENT_TYPE_CHILD_CHANGE`) -- `move` (via `DATA_EVENT_TYPE_CHILD_MOVE`) -- `remove` (via `DATA_EVENT_TYPE_CHILD_REMOVE`) +- `add` (via `DATA_EVENT_TYPE_CHILD_ADDED`) +- `change` (via `DATA_EVENT_TYPE_CHILD_CHANGED`) +- `move` (via `DATA_EVENT_TYPE_CHILD_MOVED`) +- `remove` (via `DATA_EVENT_TYPE_CHILD_REMOVED`) ## Example ```js diff --git a/ios/Classes/FirebaseDatabaseModule.m b/ios/Classes/FirebaseDatabaseModule.m index 8e4a262..b1d54bf 100644 --- a/ios/Classes/FirebaseDatabaseModule.m +++ b/ios/Classes/FirebaseDatabaseModule.m @@ -18,9 +18,9 @@ @implementation FirebaseDatabaseModule MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_VALUE, FIRDataEventTypeValue); MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_ADDED, FIRDataEventTypeChildAdded); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_REMOVE, FIRDataEventTypeChildRemoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_MOVE, FIRDataEventTypeChildMoved); -MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_CHANGE, FIRDataEventTypeChildChanged); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_REMOVED, FIRDataEventTypeChildRemoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_MOVED, FIRDataEventTypeChildMoved); +MAKE_SYSTEM_PROP(DATA_EVENT_TYPE_CHILD_CHANGED, FIRDataEventTypeChildChanged); - (id)moduleGUID { diff --git a/ios/manifest b/ios/manifest index b92b79c..b33405c 100644 --- a/ios/manifest +++ b/ios/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 1.2.0 +version: 1.1.1 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: titanium-firebase-database diff --git a/ios/titanium.xcconfig b/ios/titanium.xcconfig index 4591cb5..04da774 100644 --- a/ios/titanium.xcconfig +++ b/ios/titanium.xcconfig @@ -4,12 +4,12 @@ // OF YOUR TITANIUM SDK YOU'RE BUILDING FOR // // -TITANIUM_SDK_VERSION = 7.0.1.GA +TITANIUM_SDK_VERSION = 7.1.1.GA // // THESE SHOULD BE OK GENERALLY AS-IS // -TITANIUM_SDK = /Users/hknoechel/Library/Application Support/Titanium/mobilesdk/osx/7.0.1.GA +TITANIUM_SDK = /Users/ravindra/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/JavaScriptCore" From d20be8b2741baabe4e23ac9b1b6d88ca57b0d6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Thu, 24 May 2018 10:05:19 +0200 Subject: [PATCH 4/4] Update titanium.xcconfig --- ios/titanium.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/titanium.xcconfig b/ios/titanium.xcconfig index 04da774..baae9a6 100644 --- a/ios/titanium.xcconfig +++ b/ios/titanium.xcconfig @@ -9,7 +9,7 @@ TITANIUM_SDK_VERSION = 7.1.1.GA // // THESE SHOULD BE OK GENERALLY AS-IS // -TITANIUM_SDK = /Users/ravindra/Library/Application Support/Titanium/mobilesdk/osx/7.1.1.GA +TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/JavaScriptCore"