Skip to content

Commit 6010685

Browse files
committed
chore: one signal config app
1 parent 4a47b80 commit 6010685

File tree

18 files changed

+387
-76
lines changed

18 files changed

+387
-76
lines changed

template/.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ENV=dev
22
SENTRY_DSN=
3-
BASE_URL=https://swapi.dev/api/
3+
BASE_URL=https://swapi.dev/api/
4+
ONESIGNAL_IOS_KEY=
5+
ONESIGNAL_ANDROID_KEY=

template/App.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import 'localization';
55
import Router from 'navigation/Router';
66
import { enableScreens } from 'react-native-screens';
77
import { FileLogger } from 'react-native-file-logger';
8-
import { SENTRY_DSN, ENV } from '@env';
8+
import { SENTRY_DSN, ENV, ONESIGNAL_ANDROID_KEY } from '@env';
99
import * as Sentry from '@sentry/react-native';
1010
import codePush, { CodePushOptions } from 'react-native-code-push';
1111
import useNetworkError from 'hooks/useNetworkError';
1212
import useStartupTime from 'hooks/useStartupTime';
13+
import useOneSignal from 'hooks/useOneSignal';
1314
import useAppState from 'react-native-appstate-hook';
1415
import { Provider } from 'react-redux';
1516
import store from './src/store';
@@ -21,7 +22,7 @@ FileLogger.configure({
2122
maximumNumberOfFiles: 3,
2223
});
2324

24-
log({ ENV, SENTRY_DSN });
25+
log({ ENV, SENTRY_DSN, ONESIGNAL_ANDROID_KEY });
2526

2627
if (typeof SENTRY_DSN === 'string' && SENTRY_DSN.length > 0) {
2728
Sentry.init({
@@ -32,7 +33,7 @@ const queryClient = new QueryClient();
3233

3334
const App = () => {
3435
useNavigationMounting();
35-
36+
useOneSignal();
3637
useStartupTime();
3738

3839
useNetworkError();

template/android/app/build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
buildscript {
2+
repositories {
3+
gradlePluginPortal()
4+
}
5+
dependencies {
6+
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
7+
}
8+
}
9+
10+
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
11+
// apply plugin: 'com.google.gms.google-services'
112
apply plugin: "com.android.application"
213
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
314

@@ -210,7 +221,7 @@ dependencies {
210221
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
211222

212223
implementation 'com.google.firebase:firebase-core:16.0.0'
213-
224+
// implementation platform('com.google.firebase:firebase-bom:28.0.1')
214225
implementation 'androidx.multidex:multidex:2.0.1'
215226
compile project(':react-native-vector-icons')
216227

template/android/app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
android:networkSecurityConfig="@xml/network_security_config"
1414
android:largeHeap="true"
1515
>
16+
<meta-data android:name="com.onesignal.NotificationAccentColor.DEFAULT" android:value="FF00FF00" />
17+
18+
<meta-data
19+
android:name="com.google.firebase.messaging.default_notification_icon"
20+
android:resource="@drawable/ic_stat_onesignal_default" />
21+
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming
22+
notification message. See README(https://goo.gl/6BKBk7) for more. -->
23+
<meta-data
24+
android:name="com.google.firebase.messaging.default_notification_color"
25+
android:resource="@color/colorAccent" />
26+
1627
<activity
1728
android:name=".MainActivity"
1829
android:label="@string/app_name"
308 Bytes
Loading
269 Bytes
Loading
390 Bytes
Loading
569 Bytes
Loading
846 Bytes
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<resources>
22
<color name="bootsplash_background">#FFFFFF</color>
3+
<color name="colorAccent">#C60C30</color>
34
</resources>

0 commit comments

Comments
 (0)