Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
푸시알림 개발 및 에러수정
  • Loading branch information
yunyeop authored Dec 11, 2023
2 parents f877587 + 9490147 commit f2e8abd
Show file tree
Hide file tree
Showing 113 changed files with 2,058 additions and 1,154 deletions.
9 changes: 6 additions & 3 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import CodePush from 'react-native-code-push';
import { QueryClient, QueryClientProvider } from 'react-query';
import { Provider as ReduxProvider } from 'react-redux';
import { AuthProvider } from '@/provider/AuthProvider/AuthProvider';
import { NotificationProvider } from '@/provider/NotificationProvider';
import { SplashProvider } from '@/provider/SplashProvider';
import { ToastProvider } from '@/provider/ToastProvider/ToastProvider';
import store from '@/slices';
Expand All @@ -25,9 +26,11 @@ const App: FC = () => (
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<ToastProvider>
<AuthProvider>
<RootNavigation />
</AuthProvider>
<NotificationProvider>
<AuthProvider>
<RootNavigation />
</AuthProvider>
</NotificationProvider>
</ToastProvider>
</ThemeProvider>
</QueryClientProvider>
Expand Down
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ android {
applicationId "com.daedongbread"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 24
versionName "2.0.6"
versionCode 29
versionName "2.1.0"
resValue "string", "build_config_package", "com.daedongbread"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -226,6 +226,7 @@ android {
buildFeatures {
viewBinding = true
}
namespace 'com.daedongbread'
}

dependencies {
Expand Down
43 changes: 41 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.daedongbread">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.daedongbread">

<uses-permission android:name="android.permission.INTERNET" />
<!-- GEOLOCATION-->
Expand All @@ -12,6 +11,9 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application
android:usesCleartextTraffic="true"
android:name=".MainApplication"
Expand All @@ -23,6 +25,16 @@
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/GOOGLE_MAP_API_KEY_ANDROID" />

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />

<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/push_icon_background"
tools:replace="android:resource"/>

<uses-library android:name="org.apache.http.legacy" android:required="false" />
<activity
android:name=".MainActivity"
Expand All @@ -48,5 +60,32 @@
android:scheme="@string/KAKAO_API_KEY" />
</intent-filter>
</activity>

<!-- Change the value to true to enable pop-up for in foreground on receiving remote notifications (for prevent duplicating while showing local notifications set this to false) -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="false"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<!-- <meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@color/white"/> -->

<!-- <meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id" /> -->

<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver" android:exported="true">
<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"/>
</intent-filter>
</receiver>

<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

</application>
</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions android/app/src/main/res/values/color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
<color name="primary">@color/carrot_1</color>

<color name="carrot_1">#FF6E40</color>
<color name="white">#FFF</color>

<color name="push_icon_background">#FFF1EC</color>
</resources>
28 changes: 25 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native';
import { AppRegistry, Platform } from 'react-native';
import { LogBox } from 'react-native';
import { notification } from '@/utils/notification';
import PushNotification from 'react-native-push-notification';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import messaging from '@react-native-firebase/messaging';
import App from './App';
import { name as appName } from './app.json';
import store from './src/slices';
import { updateRequestedScreenInfo } from './src/slices/notification';
import { notification } from './src/utils/notification/notification';

LogBox.ignoreLogs([
"[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!",
'VirtualizedLists should never be nested',
]);

notification().init();
messaging().setBackgroundMessageHandler(async remoteMessage => {
notification().showANDROIDNotification(remoteMessage);
});

PushNotification.configure({
onNotification: function (_notification) {
// 푸시알림 클릭으로 앱 진입시
if (_notification.userInteraction) {
store.dispatch(updateRequestedScreenInfo(_notification.data));
}

if (Platform.OS === 'ios') {
if (notification.finish) {
notification.finish(PushNotificationIOS.FetchResult.NoData); //추가
}
}
},
});

AppRegistry.registerComponent(appName, () => App);
Loading

0 comments on commit f2e8abd

Please sign in to comment.