react-native-community / discussions-and-proposals

Discussions and proposal related to the main React Native project
https://facebook.github.io/react-native/
1.66k stars 125 forks source link

Supporting push notifications on Android #114

Closed gzzo closed 3 years ago

gzzo commented 5 years ago

Introduction

PushNotificationIOS works perfectly on iOS. React Native should support push notifications on Android as well.

The Core of It

It looks like the go-to library for Android support has been react-native-push-notification. However, it looks like that repository isn't maintained anymore and may have been abandoned.

I think it's reasonable to expect developers to want push notification support on both platforms mostly out-of-the-box without having to resort to third parties. There's several third parties with freemium react-native support (Firebase, OneSignal, Pusher).

Discussion points

Options:

  1. Adopt react-native-push-notification into react-native-community
  2. Create a PushNotificationAndroid API
  3. Add Android support into PushNotificationIOS and rename the API to PushNotification
cpojer commented 5 years ago

We are currently extracting this functionality from React Native into https://github.com/react-native-community/react-native-push-notification-ios

Would you be able to lead the effort to bring the Android version into the react-native-community and possibly building one library to handle push notifications for both platforms?

sibelius commented 5 years ago

you should check react-native-firebase for this

gzzo commented 5 years ago

@sibelius I mentioned that in the issue description. I don't think RN should rely on third parties with freemium models for Android push notifications.

@cpojer So is the preferred option from my description the third one, to have a unified API, PushNotification?

sibelius commented 5 years ago

firebase is de facto solution for android push

GCM is deprecated, everything now is FCM, you can use it for free forever

Google does not have any other option

gzzo commented 5 years ago

Thanks, I didn't know that. Looks like GCM will be deprecated 4/11/2019.

That means that the unified PushNotification API will only need to support FCM.

rhdeck commented 5 years ago

I contributed the FCM support PR for react-native-push-notification and I use it in production. Glad to belp a RNC initiative for that support.

On Fri, Mar 29, 2019 at 5:41 PM gzzo notifications@github.com wrote:

Thanks, I didn't know that. Looks like GCM will be deprecated 4/11/2019.

That means that the unified PushNotification API will only need to support FCM.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/react-native-community/discussions-and-proposals/issues/114#issuecomment-478158488, or mute the thread https://github.com/notifications/unsubscribe-auth/ALov_8Udc5aRMnUq-rDZsnm7y2QDoSApks5vboh7gaJpZM4cS7cE .

rafaellincoln commented 5 years ago

@gzzo Feel free to open a PR on push-notification-ios