Skip to content

Commit c28e8e7

Browse files
committed
Merged
2 parents 0a505be + ab3a798 commit c28e8e7

File tree

121 files changed

+6344
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+6344
-81
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
node_modules
2-
.DS_Store
32
npm-debug.log
4-
ios/Firestack.xcodeproj/project.xcworkspace/xcuserdata/auser.xcuserdatad/UserInterfaceState.xcuserstate
3+
*.DS_Store
4+
5+
# Xcode
6+
*.pbxuser
7+
*.mode1v3
8+
*.mode2v3
9+
*.perspectivev3
10+
*.xcuserstate
11+
project.xcworkspace/
12+
xcuserdata/

Firestack.podspec

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ version = package["version"]
44
repo = package['repository']
55
author = package['author']
66

7+
all_pods = [
8+
'FirebaseAnalytics', 'FirebaseAuth', 'FirebaseRemoteConfig',
9+
'FirebaseDatabase', 'FirebaseStorage', 'FirebaseInstanceID',
10+
'GoogleInterchangeUtilities', 'GoogleIPhoneUtilities',
11+
'GoogleNetworkingUtilities', 'GoogleParsingUtilities',
12+
'GoogleSymbolUtilities'
13+
]
14+
715
Pod::Spec.new do |s|
816

917
s.name = "Firestack"
1018
s.version = version
1119
s.summary = "Firestack makes working with Firebase v3 easy"
20+
1221
s.description = <<-DESC
1322
Wanna integrate firebase into your app using React Native?
1423
DESC
1524

1625
s.homepage = "http://fullstackreact.com"
26+
1727
s.license = { :type => "MIT", :file => "LICENSE" }
1828
s.author = { "Ari Lerner" => author }
1929
s.social_media_url = 'http://twitter.com/fullstackio'
@@ -61,6 +71,4 @@ Pod::Spec.new do |s|
6171
].join(' '),
6272
'OTHER_LDFLAGS' => '$(inherited) -ObjC'
6373
}
64-
65-
s.requires_arc = true
66-
end
74+
end

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,22 @@ gem install cocoapods
3838

3939
> If you run into issues installing cocoapods, please see their [getting started guide](https://guides.cocoapods.org/using/getting-started.html) for help.
4040
41-
With cocoapods installed, we'll need to
41+
42+
With cocoapods installed, we'll need to create a `Podfile` to manage our dependencies and list our new `Firestack` library as a dependency of our project.
43+
44+
```shell
45+
(cd ios && pod init)
46+
```
47+
48+
This command will create a `Podfile` in the `ios/` directory of our project. In this file, we'll need to list our dependencies. For now, we'll list one. The `Podfile` itself can be incredibly simple
49+
50+
51+
```ruby
52+
platform :ios, '8.0'
53+
target 'RoundHere' do
54+
pod 'Firestack', :path => '../node_modules/react-native-firestack'
55+
end
56+
```
4257

4358
### Android
4459

firestack.ios.js

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ const storage = require('firebase/storage');
1111
import {NativeModules, NativeAppEventEmitter} from 'react-native';
1212
const FirebaseHelper = NativeModules.Firestack;
1313

14-
const promisify = fn => (...args) => {
15-
return new Promise((resolve, reject) => {
16-
const handler = (err, resp) => err ? reject(err) : resolve(resp);
17-
args.push(handler);
18-
(typeof fn === 'function' ? fn : FirebaseHelper[fn])
19-
.call(FirebaseHelper, ...args);
20-
});
21-
};
22-
23-
export default class Firestack {
14+
import promisify from './lib/promisify'
15+
import RemoteConfig from './lib/remoteConfig'
16+
17+
export class Firestack {
18+
2419
constructor(options) {
2520
this.options = options || {};
21+
22+
this._remoteConfig = options.remoteConfig || {};
23+
delete options.remoteConfig;
24+
2625
this.appInstance = app.initializeApp(options);
2726
this.configured = false;
27+
this._debug = options.debug || false;
2828

2929
this.eventHandlers = {};
3030
}
@@ -174,15 +174,15 @@ export default class Firestack {
174174
}
175175

176176
// Storage
177-
178-
/**
179-
* Configure the library to store the storage url
180-
* @param {string} url A string of your firebase storage url
181-
* @return {Promise}
182-
*/
183-
setStorageUrl(url) {
184-
return promisify('setStorageUrl')(url);
185-
}
177+
//
178+
// /**
179+
// * Configure the library to store the storage url
180+
// * @param {string} url A string of your firebase storage url
181+
// * @return {Promise}
182+
// */
183+
// setStorageUrl(url) {
184+
// return promisify('setStorageUrl')(url);
185+
// }
186186

187187
/**
188188
* Upload a filepath
@@ -197,7 +197,8 @@ export default class Firestack {
197197

198198
// database
199199
get database() {
200-
return db();
200+
db.enableLogging(this._debug);
201+
return db()
201202
}
202203

203204
/**
@@ -213,6 +214,24 @@ export default class Firestack {
213214
return db.ServerValue;
214215
}
215216

217+
/**
218+
* remote config
219+
*/
220+
get remoteConfig() {
221+
if (!this.remoteConfig) {
222+
this.remoteConfig = new RemoteConfig(this._remoteConfig);
223+
}
224+
return this.remoteConfig;
225+
}
226+
227+
/**
228+
* Redux store
229+
**/
230+
store(store) {
231+
this._store = store;
232+
return this;
233+
}
234+
216235
on(name, cb) {
217236
if (!this.eventHandlers[name]) {
218237
this.eventHandlers[name] = [];
@@ -227,5 +246,6 @@ export default class Firestack {
227246
this.eventHandlers.forEach(subscription => subscription.remove());
228247
}
229248
}
230-
231249
}
250+
251+
export default Firestack

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Firestack from './firestack'
2+
export { FirestackModule } from './lib/firestackModule'
3+
4+
export default Firestack

ios/Firestack.xcodeproj/project.pbxproj

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
990C5C2244881F67F82F4623 /* libPods-Firestack.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CFBF14844A3A71271E0CE035 /* libPods-Firestack.a */; };
1011
D950369E1D19C77400F7094D /* Firestack.m in Sources */ = {isa = PBXBuildFile; fileRef = D950369D1D19C77400F7094D /* Firestack.m */; };
12+
D9FF4BF31D19F5FF00238046 /* libPods-Firestack.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D95036B81D19C90300F7094D /* libPods-Firestack.a */; settings = {ATTRIBUTES = (Weak, ); }; };
1113
/* End PBXBuildFile section */
1214

1315
/* Begin PBXContainerItemProxy section */
@@ -18,6 +20,13 @@
1820
remoteGlobalIDString = 6A0E8DDC7C16F5507F1B7E4EF54F4E39;
1921
remoteInfo = "Pods-Firestack";
2022
};
23+
D9841C431D4A7E8C00C9BEA8 /* PBXContainerItemProxy */ = {
24+
isa = PBXContainerItemProxy;
25+
containerPortal = D95036B31D19C90300F7094D /* Pods.xcodeproj */;
26+
proxyType = 1;
27+
remoteGlobalIDString = 815EB7527B696DB4C2DE9602F3C0A177;
28+
remoteInfo = "Pods-Firestack";
29+
};
2130
/* End PBXContainerItemProxy section */
2231

2332
/* Begin PBXCopyFilesBuildPhase section */
@@ -34,6 +43,9 @@
3443

3544
/* Begin PBXFileReference section */
3645
134814201AA4EA6300B7C361 /* libFirestack.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFirestack.a; sourceTree = BUILT_PRODUCTS_DIR; };
46+
612D3268D15D0E9231997758 /* Pods-Firestack.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestack.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestack/Pods-Firestack.release.xcconfig"; sourceTree = "<group>"; };
47+
CEE8E427185097CF7EF3A3EB /* Pods-Firestack.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestack.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestack/Pods-Firestack.debug.xcconfig"; sourceTree = "<group>"; };
48+
CFBF14844A3A71271E0CE035 /* libPods-Firestack.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Firestack.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3749
D950369C1D19C77400F7094D /* Firestack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Firestack.h; path = Firestack/Firestack.h; sourceTree = "<group>"; };
3850
D950369D1D19C77400F7094D /* Firestack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Firestack.m; path = Firestack/Firestack.m; sourceTree = "<group>"; };
3951
D95036B31D19C90300F7094D /* Pods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pods.xcodeproj; path = Pods/Pods.xcodeproj; sourceTree = "<group>"; };
@@ -44,6 +56,8 @@
4456
isa = PBXFrameworksBuildPhase;
4557
buildActionMask = 2147483647;
4658
files = (
59+
D9FF4BF31D19F5FF00238046 /* libPods-Firestack.a in Frameworks */,
60+
990C5C2244881F67F82F4623 /* libPods-Firestack.a in Frameworks */,
4761
);
4862
runOnlyForDeploymentPostprocessing = 0;
4963
};
@@ -62,6 +76,7 @@
6276
isa = PBXGroup;
6377
children = (
6478
D95036B31D19C90300F7094D /* Pods.xcodeproj */,
79+
CFBF14844A3A71271E0CE035 /* libPods-Firestack.a */,
6580
);
6681
name = Frameworks;
6782
sourceTree = "<group>";
@@ -72,14 +87,24 @@
7287
D950369C1D19C77400F7094D /* Firestack.h */,
7388
D950369D1D19C77400F7094D /* Firestack.m */,
7489
134814211AA4EA7D00B7C361 /* Products */,
90+
6FD8667D22972EC49DB4BE7E /* Pods */,
7591
4C361DE13748C14BF1F87624 /* Frameworks */,
7692
);
7793
sourceTree = "<group>";
7894
};
95+
6FD8667D22972EC49DB4BE7E /* Pods */ = {
96+
isa = PBXGroup;
97+
children = (
98+
CEE8E427185097CF7EF3A3EB /* Pods-Firestack.debug.xcconfig */,
99+
612D3268D15D0E9231997758 /* Pods-Firestack.release.xcconfig */,
100+
);
101+
name = Pods;
102+
sourceTree = "<group>";
103+
};
79104
D95036B41D19C90300F7094D /* Products */ = {
80105
isa = PBXGroup;
81106
children = (
82-
D95036B81D19C90300F7094D /* Pods_Firestack.framework */,
107+
D95036B81D19C90300F7094D /* libPods-Firestack.a */,
83108
);
84109
name = Products;
85110
sourceTree = "<group>";
@@ -100,6 +125,7 @@
100125
buildRules = (
101126
);
102127
dependencies = (
128+
D9841C441D4A7E8C00C9BEA8 /* PBXTargetDependency */,
103129
);
104130
name = Firestack;
105131
productName = RCTDataManager;
@@ -144,10 +170,10 @@
144170
/* End PBXProject section */
145171

146172
/* Begin PBXReferenceProxy section */
147-
D95036B81D19C90300F7094D /* Pods_Firestack.framework */ = {
173+
D95036B81D19C90300F7094D /* libPods-Firestack.a */ = {
148174
isa = PBXReferenceProxy;
149-
fileType = wrapper.framework;
150-
path = Pods_Firestack.framework;
175+
fileType = archive.ar;
176+
path = "libPods-Firestack.a";
151177
remoteRef = D95036B71D19C90300F7094D /* PBXContainerItemProxy */;
152178
sourceTree = BUILT_PRODUCTS_DIR;
153179
};
@@ -197,6 +223,14 @@
197223
};
198224
/* End PBXSourcesBuildPhase section */
199225

226+
/* Begin PBXTargetDependency section */
227+
D9841C441D4A7E8C00C9BEA8 /* PBXTargetDependency */ = {
228+
isa = PBXTargetDependency;
229+
name = "Pods-Firestack";
230+
targetProxy = D9841C431D4A7E8C00C9BEA8 /* PBXContainerItemProxy */;
231+
};
232+
/* End PBXTargetDependency section */
233+
200234
/* Begin XCBuildConfiguration section */
201235
58B511ED1A9E6C8500147676 /* Debug */ = {
202236
isa = XCBuildConfiguration;
@@ -276,7 +310,9 @@
276310
};
277311
58B511F01A9E6C8500147676 /* Debug */ = {
278312
isa = XCBuildConfiguration;
313+
baseConfigurationReference = CEE8E427185097CF7EF3A3EB /* Pods-Firestack.debug.xcconfig */;
279314
buildSettings = {
315+
DYLIB_INSTALL_NAME_BASE = "";
280316
ENABLE_BITCODE = NO;
281317
FRAMEWORK_SEARCH_PATHS = (
282318
"$(inherited)",
@@ -292,16 +328,14 @@
292328
"$(SRCROOT)/../../node_modules/react-native/React/**",
293329
"$(SRCROOT)/../../react-native/React/**",
294330
);
295-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
331+
LD_DYLIB_INSTALL_NAME = "";
296332
LIBRARY_SEARCH_PATHS = "$(inherited)";
297-
MACH_O_TYPE = staticlib;
333+
MACH_O_TYPE = mh_dylib;
298334
ONLY_ACTIVE_ARCH = YES;
299335
OTHER_LDFLAGS = (
300336
"$(inherited)",
301337
"-undefined",
302338
dynamic_lookup,
303-
"-lc++",
304-
"-ObjC",
305339
);
306340
PRODUCT_NAME = Firestack;
307341
SKIP_INSTALL = YES;
@@ -310,7 +344,9 @@
310344
};
311345
58B511F11A9E6C8500147676 /* Release */ = {
312346
isa = XCBuildConfiguration;
347+
baseConfigurationReference = 612D3268D15D0E9231997758 /* Pods-Firestack.release.xcconfig */;
313348
buildSettings = {
349+
DYLIB_INSTALL_NAME_BASE = "";
314350
ENABLE_BITCODE = NO;
315351
FRAMEWORK_SEARCH_PATHS = (
316352
"$(inherited)",
@@ -326,15 +362,13 @@
326362
"$(SRCROOT)/../../node_modules/react-native/React/**",
327363
"$(SRCROOT)/../../react-native/React/**",
328364
);
329-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
365+
LD_DYLIB_INSTALL_NAME = "";
330366
LIBRARY_SEARCH_PATHS = "$(inherited)";
331-
MACH_O_TYPE = staticlib;
367+
MACH_O_TYPE = mh_dylib;
332368
OTHER_LDFLAGS = (
333369
"$(inherited)",
334370
"-undefined",
335371
dynamic_lookup,
336-
"-lc++",
337-
"-ObjC",
338372
);
339373
PRODUCT_NAME = Firestack;
340374
SKIP_INSTALL = YES;

ios/Firestack.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/Firestack/Firestack.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
@implementation Firestack
1010

11+
@import Firebase;
12+
1113
@synthesize bridge = _bridge;
1214

1315
RCT_EXPORT_MODULE(Firestack);

0 commit comments

Comments
 (0)