This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from 'react-native-firebase'; | |
export default class App extends Component { | |
async componentDidMount() { | |
this.checkPermission(); | |
this.createNotificationListeners(); //add this line | |
} | |
////////////////////// Add these methods ////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import { AsyncStorage } from 'react-native'; | |
import firebase from 'react-native-firebase'; | |
export default class App extends Component { | |
async componentDidMount() { | |
this.checkPermission(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <UserNotifications/UserNotifications.h> | |
@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate> | |
@property (nonatomic, strong) UIWindow *window; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
implementation fileTree(include: ['*.jar'], dir: 'libs') | |
implementation 'com.android.support:appcompat-v7:27.1.1' | |
implementation 'com.facebook.react:react-native:+' | |
//Add these lines | |
implementation "com.google.android.gms:play-services-base:15.0.0" | |
implementation "com.google.firebase:firebase-core:15.0.2" | |
implementation "com.google.firebase:firebase-messaging:15.0.2" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment the next line to define a global platform for your project | |
platform :ios, '9.0' | |
target 'ReactPushNotifications' do | |
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks | |
# use_frameworks! | |
# Pods for ReactPushNotifications - Add these lines | |
pod 'Firebase/Core' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:3.1.2' | |
classpath 'com.google.gms:google-services:3.2.1' | |
} |
NewerOlder