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 PushNotification from 'react-native-push-notification'; | |
import PushNotificationIOS from '@react-native-community/push-notification-ios'; | |
import { AppState, Platform } from 'react-native'; | |
import { checkNotifications, RESULTS } from 'react-native-permissions'; | |
// BIIIIG WARNING: in iOS you'll get a token ONLY if you request permission for it. | |
// Therefore, a call for PushNotification.requestPermissions() is required. | |
// Android doesn't need the user's consent to send notifications, whereas iOS does | |
// but Android's user can still turn off notifications in the system settings |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pushtest"> <!-- YOUR BUNDLE ID HERE --> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:name=".MainApplication" | |
android:label="@string/app_name" | |
android:icon="@mipmap/ic_launcher" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:allowBackup="false" |
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
require_relative '../node_modules/react-native/scripts/react_native_pods' | |
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | |
platform :ios, '10.0' | |
target 'le_gratin' do | |
config = use_native_modules! | |
permissions_path = '../node_modules/react-native-permissions/ios' | |
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec" |
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/RCTBridgeDelegate.h> | |
#import <UIKit/UIKit.h> | |
#import <UserNotifications/UNUserNotificationCenter.h> | |
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, 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
yarn package-all | |
yarn run v1.21.1 | |
$ yarn build && electron-builder build -mwl | |
$ concurrently "yarn build-main" "yarn build-renderer" | |
$ cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors | |
$ cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors | |
[0] Hash: 14f890f1e10c18274383 | |
[0] Version: webpack 4.41.2 | |
[0] Time: 3824ms | |
[0] Built at: 01/16/2020 4:43:50 PM |
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 from 'react'; | |
import { SafeAreaView, StyleSheet, View, Text, StatusBar, TouchableOpacity, Platform, Alert } from 'react-native'; | |
import DeviceInfo from 'react-native-device-info'; | |
import Notifications from './NotificationService' | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
Notifications.init(this.handleRegister); | |
} |
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 from 'react'; | |
import {SafeAreaView, StyleSheet, View, Text, StatusBar, TouchableOpacity, Platform} from 'react-native'; | |
import Notifications from './NotificationService' | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
Notifications.init(this.handleRegister); | |
} | |
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 from 'react'; | |
import {SafeAreaView, StyleSheet, View, Text, StatusBar, TouchableOpacity, Platform} from 'react-native'; | |
import Notifications from './NotificationService' | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
Notifications.init(this.handleRegister); | |
} | |
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 "AppDelegate.h" | |
#import <React/RCTBridge.h> | |
#import <React/RCTBundleURLProvider.h> | |
#import <React/RCTRootView.h> | |
#import "UserNotifications/UserNotifications.h" | |
#import "RNCPushNotificationIOS.h" | |
#ifdef FB_SONARKIT_ENABLED |
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 from 'react'; | |
import { | |
SafeAreaView, | |
StyleSheet, | |
View, | |
Text, | |
StatusBar, | |
TouchableOpacity, | |
} from 'react-native'; |
NewerOlder