Merge branch 'master' of https://github.com/invertase/react-native-firebase
This commit is contained in:
commit
333c449ab4
|
@ -54,6 +54,7 @@ All in all, RNFirebase provides much faster performance (~2x) over the web SDK a
|
|||
| Performance Monitoring | ✅ | ✅ | ❌ |
|
||||
| Realtime Database | ✅ | ✅ | ✅ |
|
||||
| - Offline Persistance | ✅ | ✅ | ❌ |
|
||||
| - Transactions | ✅ | ✅ | ❌ |
|
||||
| Remote Config | ✅ | ✅ | ❌ |
|
||||
| Storage | ✅ | ✅ | ❌ |
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ Currently due to the blackbox Firebase enviroment, we have found the best way to
|
|||
|
||||
For convenience all of the required NPM scripts are packaged with the main library to run the test app.
|
||||
|
||||
### Step 1 - Clone
|
||||
### Step 1 - Fork & Clone
|
||||
|
||||
```bash
|
||||
git clone git@github.com:invertase/react-native-firebase.git
|
||||
git clone git@github.com:<username>/react-native-firebase.git
|
||||
```
|
||||
|
||||
### Step 2 - Install dependencies
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
!> Performance monitoring requires react-native-firebase version 1.2.0.
|
||||
|
||||
?> If you plan on using this module in your own application, please ensure the optional setup instructions for
|
||||
[Android](#) and [iOS](#) have been followed.
|
||||
?> Android: If you plan on using this module in your own application, please ensure the optional setup instructions for
|
||||
[Android](http://invertase.io/react-native-firebase/#/installation-android?id=_4-performance-monitoring-optional) have been followed.
|
||||
|
||||
Out of the box, [Firebase Performance Monitoring](https://firebase.google.com/docs/perf-mon/automatic) monitors a number of
|
||||
[automatic traces](https://firebase.google.com/docs/perf-mon/automatic) such as app start/background/foreground response times.
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
# Transactions
|
||||
|
||||
!> Transactions is currently an experimental feature in RNFirebase. Whilst it does work there may still be some issues with it, especially around offline connectivity handling. Please report any issues in the usual manner.
|
||||
|
||||
|
||||
?> For help on how to use firebase transactions please see the [Firebase Transaction Documentation](https://firebase.google.com/docs/reference/js/firebase.database.Reference#transaction).
|
||||
|
||||
### Android Implementation
|
||||
|
|
|
@ -35,7 +35,7 @@ RCT_EXPORT_METHOD(initialize:
|
|||
RCT_EXPORT_METHOD(openDebugMenu:
|
||||
(NSString *) appId) {
|
||||
GADDebugOptionsViewController *debugOptionsViewController = [GADDebugOptionsViewController debugOptionsViewControllerWithAdUnitID:appId];
|
||||
UIWindow* window = [UIApplication sharedApplication].keyWindow;
|
||||
UIWindow *window = [UIApplication sharedApplication].keyWindow;
|
||||
|
||||
[[window rootViewController] presentViewController:debugOptionsViewController animated:YES completion:nil];
|
||||
}
|
||||
|
@ -68,6 +68,11 @@ RCT_EXPORT_METHOD(rewardedVideoShowAd:
|
|||
[rewardedVideo show];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(clearInterstitial:
|
||||
(NSString *) adUnit) {
|
||||
if (_interstitials[adUnit]) [_interstitials removeObjectForKey:adUnit];
|
||||
}
|
||||
|
||||
- (RNFirebaseAdMobInterstitial *)getOrCreateInterstitial:(NSString *)adUnit {
|
||||
if (_interstitials[adUnit]) {
|
||||
return _interstitials[adUnit];
|
||||
|
@ -187,8 +192,8 @@ RCT_EXPORT_METHOD(rewardedVideoShowAd:
|
|||
NSString *matchText = [value substringWithRange:[match range]];
|
||||
if (matchText) {
|
||||
NSArray *values = [matchText componentsSeparatedByString:@"x"];
|
||||
CGFloat width = (CGFloat)[values[0] intValue];
|
||||
CGFloat height = (CGFloat)[values[1] intValue];
|
||||
CGFloat width = (CGFloat) [values[0] intValue];
|
||||
CGFloat height = (CGFloat) [values[1] intValue];
|
||||
return GADAdSizeFromCGSize(CGSizeMake(width, height));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { NativeModules } from 'react-native';
|
||||
import { NativeModules, Platform } from 'react-native';
|
||||
import { statics } from './';
|
||||
import AdRequest from './AdRequest';
|
||||
import { nativeToJSError } from '../../utils';
|
||||
|
@ -8,6 +8,11 @@ const FirebaseAdMob = NativeModules.RNFirebaseAdMob;
|
|||
export default class Interstitial {
|
||||
|
||||
constructor(admob: Object, adUnit: string) {
|
||||
// Interstitials on iOS require a new instance each time
|
||||
if (Platform.OS === 'ios') {
|
||||
FirebaseAdMob.clearInterstitial(adUnit);
|
||||
}
|
||||
|
||||
this.admob = admob;
|
||||
this.adUnit = adUnit;
|
||||
this.loaded = false;
|
||||
|
|
Loading…
Reference in New Issue