Closed sadiqkhoja closed 5 years ago
We had a React Native app developed for iOS and Android and as we needed to support UWP platform as well, we decided to give React Native Windows a chance. We started in November 2017 and were able to publish the app for UWP in just two months. It is a large-size enterprise app, that requires performant offline database, access to local filesystem, i18n support, secure storage (like keychain on iOS), push notifications, support for file downloads (thousands of files), it needs to be able to display different file types (videos, PDFs, images, web content etc.) and most of all it needs to run smooth.
Based on our experience, I can already recommend RN Windows for production. You just need to be preapared to develop the missing native modules that your app might need. For example our iOS and Android versions are using Realm React Native as offline database but since Realm RN doesn’t support UWP, we decided to write a native module for Ream .NET. Other than that we were surprised to find out that for example react-native-fs module already supports RN Windows.
@juhasuni did you contribute your Realm RN Windows support upstream? If not, anything we can do to help?
My previous employer, BlueJeans, chose to invest in porting RN Windows to WPF to achieve a larger strategy. They have a commitment to WebRTC and joining video meetings directly from the browser, which meant a corpus of JavaScript code. They also have another product called Huddle that uses a Windows 10 device with a UWP UI and needed a way to share a lot of code. RN Windows allowed them to have engineering resources between those products be more fungible, in addition to sharing private universal libraries and React components that could dramatically reduce duplicated work. It teed them up for a very scalable client engineering organziation, and provide significantly better performance over an Electron/node-WebKit solution.
Their/my collaboration with Microsoft to extend the reach of React Native to tens (hundreds?) of millions of Windows 7/8 devices was so successful that I’m still contributing 2 years on. I’m looking forward to another 2 years, at least.
@juhasuni @rozele any suggestion on best way to approach implementing push notifications in RNW? thanks for your help!
@npmun we wrote a native module for Azure Notification Hub awhile back. It's not supported but could be a good starting point for adding push notification support. https://github.com/CatalystCode/react-native-azurenotificationhub
@npmun We've connected the app with Windows Notification Services: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/windows-push-notification-services--wns--overview
The implementation was quite straightforward. First you need to ask user's permission using UserNotificationListener
and RequestAccessAsync
. Be sure to do this in the UI thread. Then you'll obtain a channel URI (similar to APN device token on iOS) using PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync()
. This URI is device-specific so you need to send it to your backend to be able to send notifications to the particular device. Now you're ready to start listening to notifications using UserNotificationListener
.
These are all UWP
APIs.
Be prepared to spend some time investigating what kind of notifications (Toasts) you can dispatch.
Small correction: you don't have to listen to anything, you just override OnActivated
method in your ReactApplication
sub class and check if the app was activated via Toast. (applies to our case, where the app is opened from the Toast, you're app may require something else).
@rozele @juhasuni thank you for the information. I will keep your inputs in mind when I start implementing push notifications in our app.
to be honest the ability to keep a single codebase for multiple platforms sounded attractive. but in practice , due to a lot android-ios-specific packages, this wasn't easily achievable, so I found that using a separate code base foe windows seems easier.
Not sure if this is right place to ask this question but do we have any success story of React Native Windows. Any UWP app in the windows store that is developed using React Native?