This file contains hidden or 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
| fastlane_version "2.25.0" | |
| default_platform :ios | |
| platform :ios do | |
| lane :beta do |values| | |
| # Before calling match, we make sure all our devices are registered on the Apple Developer Portal | |
| register_devices( | |
| devices_file: "./fastlane/devices.txt", | |
| username: '[email protected]' |
This file contains hidden or 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
| const functions = require('firebase-functions'); | |
| const admin = require('firebase-admin'); | |
| admin.initializeApp(functions.config().firebase); | |
| /** | |
| * Triggers when new subject added in the list and sends a notification. | |
| */ | |
| exports.sendNotification = functions.database.ref('/subjects/{subjectKey}').onWrite((event) => { |
This file contains hidden or 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 { View, StyleSheet, Text } from 'react-native'; | |
| import { Actions } from 'react-native-router-flux'; | |
| import FCM from 'react-native-fcm'; | |
| ..... | |
| _onLoginSuccess = () => { | |
| const topic = '/topics/list' | |
| FCM.subscribeToTopic(topic); // subscribe to topic |
This file contains hidden or 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
| var firebase = require('firebase-admin'); | |
| var request = require('request'); | |
| // Fetch the service account key JSON file contents | |
| var serviceAccount = require("path/to/serviceAccountKey.json"); | |
| var env = require("path/to/env.json"); | |
| // Your Firebase Cloud Messaging Server API key | |
| var API_KEY = env.CLOUD_MESSAGE_API_KEY; |
This file contains hidden or 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
| _onPress = () => { | |
| const subjectsRef = firebase.database().ref('subjects'); | |
| const notificationReqsRef = firebase.database().ref('notificationRequests'); | |
| const subjectData = { | |
| author: 'TJ', | |
| title: this.state.subjectText, | |
| }; | |
| const notificationReq = { | |
| from_username: 'TJ', | |
| message: `just posted new topic "${this.state.topicText}"`, |
This file contains hidden or 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
| /** | |
| * Sample React Native App | |
| * https://github.com/facebook/react-native | |
| * @flow | |
| */ | |
| import React, { Component } from 'react'; | |
| import { | |
| StyleSheet, | |
| Text, |
NewerOlder