Skip to content

Instantly share code, notes, and snippets.

View helenaford's full-sized avatar

Helena Ford helenaford

View GitHub Profile
@helenaford
helenaford / RNFirebase Part 2 - AndroidManifest.xml
Created December 28, 2019 19:48
RNFirebase Part 2 - AndroidManifest.xml
<application>
...
<!-- schedule local notification -->
<receiver android:name="io.invertase.firebase.notifications.RNFirebaseNotificationReceiver"/>
<receiver android:enabled="true" android:exported="true" android:name="io.invertase.firebase.notifications.RNFirebaseNotificationsRebootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
<category android:name="android.intent.category.DEFAULT" />
@helenaford
helenaford / 1: App.js
Last active March 20, 2024 09:16
useNotificationService
import { useNotificationService } from './hooks';
function App() {
useNotificationService();
...
}
@helenaford
helenaford / build.gradle
Created August 22, 2019 21:37
React Native + Firebase: build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:3.4.1")
// ADD THIS LINE
classpath 'com.google.gms:google-services:4.2.0'
}
}
@helenaford
helenaford / App.js
Created August 19, 2019 18:25
React Native & Firebase: App.js
import React, { Component, Fragment } from 'react';
import firebase from 'react-native-firebase';
class App extends Component<Props> {
...
getToken = async () => {
let fcmToken = await AsyncStorage.getItem('fcmToken');
if (!fcmToken) {
fcmToken = await firebase.messaging().getToken();
@helenaford
helenaford / build.gradle
Created August 18, 2019 21:30
React Native + Firebase: app/build.gradle
dependencies {
// custom dependencies
// Firebase
implementation "com.google.android.gms:play-services-base:17.0.0"
implementation "com.google.firebase:firebase-core:17.0.1"
implementation "com.google.firebase:firebase-messaging:19.0.0"
}
@helenaford
helenaford / MainApplication.java
Created August 18, 2019 21:09
React Native + Firebase: MainApplication.java
import io.invertase.firebase.messaging.RNFirebaseMessagingPackage;
import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;
public class MainApplication extends Application implements ReactApplication {
...