Skip to content

Commit 5683916

Browse files
committed
Added blocking whenReady to Base to ensure app is configured before sending a native call
1 parent 710d5ad commit 5683916

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

ios/Firestack/FirestackCloudMessaging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717

1818
}
1919

20-
+ (void) setup;
20+
+ (void) setup:(UIApplication *)application;
2121

2222
@end

lib/modules/analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Analytics extends Base {
1919
* @return {Promise}
2020
*/
2121
logEventWithName(name, props) {
22-
return promisify('logEventWithName', FirestackAnalytics)(name, props);
22+
return this.whenReady(promisify('logEventWithName', FirestackAnalytics)(name, props))
2323
}
2424

2525
enable() {

lib/modules/base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export class Base {
4141
return this.firestack.app;
4242
}
4343

44+
whenReady(fn) {
45+
return this.firestack.configurePromise.then(fn);
46+
}
47+
4448
get namespace() {
4549
return 'firestack:base';
4650
}

0 commit comments

Comments
 (0)